Add the ability to access all the critical points in C++ and python; closes #807

This commit is contained in:
Ian Bell
2015-09-03 22:28:46 -06:00
parent e914d54b39
commit da015ffb68
7 changed files with 66 additions and 11 deletions

View File

@@ -347,7 +347,7 @@ protected:
virtual void calc_viscosity_contributions(CoolPropDbl &dilute, CoolPropDbl &initial_density, CoolPropDbl &residual, CoolPropDbl &critical){ throw NotImplementedError("calc_viscosity_contributions is not implemented for this backend"); };
virtual void calc_conductivity_contributions(CoolPropDbl &dilute, CoolPropDbl &initial_density, CoolPropDbl &residual, CoolPropDbl &critical){ throw NotImplementedError("calc_conductivity_contributions is not implemented for this backend"); };
virtual std::vector<CriticalState> calc_all_critical_points(void){ throw NotImplementedError("calc_all_critical_points is not implemented for this backend"); };
public:
AbstractState() :_fluid_type(FLUID_TYPE_UNDEFINED), _phase(iphase_unknown), _rhospline(-_HUGE), _dsplinedp(-_HUGE), _dsplinedh(-_HUGE){ clear(); }
@@ -482,6 +482,9 @@ public:
double rhomolar_critical(void);
/// Return the critical molar density in kg/m^3
double rhomass_critical(void);
/// Return the vector of critical points, including points that are unstable or correspond to negative pressure
std::vector<CriticalState> all_critical_points(void){ return calc_all_critical_points(); };
/// Return the reducing point temperature in K
double T_reducing(void);

View File

@@ -22,6 +22,13 @@ struct SimpleState
}
bool is_valid(){return ValidNumber(rhomolar) && ValidNumber(T) && ValidNumber(hmolar) && ValidNumber(p);}
};
struct CriticalState : SimpleState
{
bool stable;
CriticalState() :stable(false){ fill(_HUGE); }
};
/// A modified class for the state point at the maximum saturation entropy on the vapor curve
struct SsatSimpleState : public SimpleState