mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Parse out zero mole fraction components in PropsSI() (#1628)
* Parse out zero mole fraction components in PropsSI() * PropsSI() smallest mixture fraction to ignore = 10*DBL_EPSILON
This commit is contained in:
@@ -148,11 +148,14 @@ std::string extract_fractions(const std::string &fluid_string, std::vector<doubl
|
||||
// If pEnd points to the last character in the string, it wasn't able to do the conversion
|
||||
if (pEnd == &(fraction[fraction.size()-1])){throw ValueError(format("Could not convert [%s] into number", fraction.c_str()));}
|
||||
|
||||
// And add to vector
|
||||
fractions.push_back(f);
|
||||
if (f > 10*DBL_EPSILON) // Only push component if fraction is positive and non-zero
|
||||
{
|
||||
// And add to vector
|
||||
fractions.push_back(f);
|
||||
|
||||
// Add name
|
||||
names.push_back(name);
|
||||
// Add name
|
||||
names.push_back(name);
|
||||
}
|
||||
}
|
||||
|
||||
if (get_debug_level()>10) std::cout << format("%s:%d: Detected fractions of %s for %s.",__FILE__,__LINE__,vec_to_string(fractions).c_str(), (strjoin(names, "&")).c_str());
|
||||
|
||||
Reference in New Issue
Block a user