Add REFPROP_DONT_ESTIMATE_INTERACTION_PARAMETERS config variable and implement; closes #804

This commit is contained in:
Ian Bell
2015-09-01 18:45:41 -06:00
parent 2d6e3386c1
commit 34ed28987c

View File

@@ -253,6 +253,9 @@ void REFPROPMixtureBackend::set_REFPROP_fluids(const std::vector<std::string> &f
}
if (CoolProp::get_debug_level() > 5){ std::cout << format("%s:%d: Successfully loaded REFPROP fluid: %s\n",__FILE__,__LINE__, components_joined.c_str()); }
if (dbg_refprop) std::cout << format("%s:%d: Successfully loaded REFPROP fluid: %s\n",__FILE__,__LINE__, components_joined.c_str());
if (get_config_bool(REFPROP_DONT_ESTIMATE_INTERACTION_PARAMETERS) && ierr == -117){
throw ValueError(format("Interaction parameter estimation has been disabled: %s", herr));
}
set_mole_fractions(std::vector<CoolPropDbl>(x.begin(), x.begin()+N));
return;
}
@@ -306,10 +309,16 @@ void REFPROPMixtureBackend::set_REFPROP_fluids(const std::vector<std::string> &f
cached_component_string = component_string;
if (CoolProp::get_debug_level() > 5){ std::cout << format("%s:%d: Successfully loaded REFPROP fluid: %s\n",__FILE__,__LINE__, components_joined.c_str()); }
if (dbg_refprop) std::cout << format("%s:%d: Successfully loaded REFPROP fluid: %s\n",__FILE__,__LINE__, components_joined.c_str());
if (get_config_bool(REFPROP_DONT_ESTIMATE_INTERACTION_PARAMETERS) && ierr == -117){
throw ValueError(format("Interaction parameter estimation has been disabled: %s", herr));
}
return;
}
else if (k < number_of_endings-1){ // Keep going
if (CoolProp::get_debug_level() > 5){std::cout << format("REFPROP error/warning [ierr: %d]: %s",ierr, herr) << std::endl;}
if (get_config_bool(REFPROP_DONT_ESTIMATE_INTERACTION_PARAMETERS) && ierr == -117){
throw ValueError(format("Interaction parameter estimation has been disabled: %s", herr));
}
continue;
}
else