mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Add the ability to access all the critical points in C++ and python; closes #807
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user