mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-02-03 10:24:58 -05:00
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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user