Predefined mixtures working in PropsSI now

Added Catch test

``` python
In [1]: import CoolProp

In [2]: CoolProp.CoolProp.PropsSI('D','P',101325,'T',300,'Air.mix')
Out[2]: 1.1766975266680577
```

Closes https://github.com/CoolProp/CoolProp/issues/287

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-12-05 11:24:29 -05:00
parent 93305f0413
commit 0cb02a3e2f
5 changed files with 39 additions and 4 deletions

View File

@@ -37,6 +37,16 @@ class PredefinedMixturesLibrary{
};
static PredefinedMixturesLibrary predefined_mixtures_library;
std::string get_csv_predefined_mixtures()
{
std::vector<std::string> out;
for (std::map< std::string, Dictionary >::iterator it = predefined_mixtures_library.predefined_mixture_map.begin(); it != predefined_mixtures_library.predefined_mixture_map.end(); ++it)
{
out.push_back(it->first);
}
return strjoin(out, ",");
}
bool is_predefined_mixture(const std::string name, Dictionary &dict){
if (predefined_mixtures_library.predefined_mixture_map.find(name) != predefined_mixtures_library.predefined_mixture_map.end()){
dict = predefined_mixtures_library.predefined_mixture_map[name];