17 TV = 12, HP = 34, SP = 54, PV = 42, TP = 14, UV = 62, ST = 51,
18 SV = 52, UP = 64, VH = 23, TH = 13, SH = 53, PX = 47, TX = 17,
19 VT = -12, PH = -34, PS = -54, VP = -42, PT = -14, VU = -62, TS = -51,
20 VS = -52, PU = -64, HV = -23, HT = -13, HS = -53, XP = -47, XT = -17
24const int Pgiven = 0, Tgiven = 1;
28enum type { H, S, U, V, P, T };
31const double Undef = 999.1234;
39 Substance() =
default;
41 virtual ~Substance() =
default;
43 void setStdState(
double h0 = 0.0,
double s0 = 0.0,
44 double t0 = 298.15,
double p0 = 1.01325e5);
69 return m_name.c_str();
74 return m_formula.c_str();
94 return prop(propertyFlag::V);
99 return prop(propertyFlag::U);
104 return prop(propertyFlag::H);
109 return prop(propertyFlag::S);
128 virtual double thermalExpansionCoeff();
130 virtual double isothermalCompressibility();
139 virtual double dPsdT();
142 double Tsat(
double p);
154 virtual double Pp()=0;
158 return up() + Pp()/Rho;
163 return hp() - T*
sp();
166 double prop(propertyFlag::type ijob);
169 void set_TPp(
double t0,
double p0);
174 void Set(PropertyPair::type XY,
double x0,
double y0);
179 double Tslast = Undef;
183 double m_energy_offset = 0.0;
184 double m_entropy_offset = 0.0;
186 std::string m_formula;
188 virtual double ldens()=0;
194 virtual double up()=0;
197 virtual double sp()=0;
199 virtual int ideal() {
209 int Lever(
int itp,
double sat,
double val, propertyFlag::type ifunc);
215 void set_Rho(
double r0);
216 void set_T(
double t0);
217 void set_v(
double v0);
218 void BracketSlope(
double p);
219 double vprop(propertyFlag::type ijob);
220 void set_xy(propertyFlag::type if1, propertyFlag::type if2,
222 double atx,
double aty,
double rtx,
double rty);
228 double v_here, P_here;
virtual double up()=0
Internal energy of a single-phase state.
const char * formula()
Chemical formula for the substance.
virtual double Vcrit()=0
Critical specific volume [m^3/kg].
double hp()
Enthalpy of a single-phase state.
int TwoPhase(bool strict=false)
Returns 1 if the current state is a liquid/vapor mixture, 0 otherwise.
virtual double cp()
Specific heat at constant pressure [J/kg/K].
double gp()
Gibbs function of a single-phase state.
double x()
Vapor mass fraction.
virtual double Tmax()=0
Maximum temperature for which the equation of state is valid.
double u()
Internal energy [J/kg].
virtual double MolWt()=0
Molecular weight [kg/kmol].
double h()
Enthalpy [J/kg].
virtual double cv()
Specific heat at constant volume [J/kg/K].
double Temp()
Temperature [K].
virtual double Tmin()=0
Minimum temperature for which the equation of state is valid.
int Lever(int itp, double sat, double val, propertyFlag::type ifunc)
Uses the lever rule to set state in the dome.
double g()
Gibbs function [J/kg].
const char * name()
Name of the substance.
virtual double sp()=0
Entropy of a single-phase state.
virtual double Psat()=0
Saturation pressure, Pa.
double f()
Helmholtz function [J/kg].
double v()
Specific volume [m^3/kg].
virtual double Tcrit()=0
Critical temperature [K].
void Set(PropertyPair::type XY, double x0, double y0)
Function to set or change the state for a property pair XY where x0 is the value of first property an...
virtual double Pcrit()=0
Critical pressure [Pa].
virtual double dPsdT()
The derivative of the saturation pressure with respect to temperature.
double Tsat(double p)
Saturation temperature at pressure p.
void update_sat()
Update saturated liquid and vapor densities and saturation pressure.
void set_TPp(double t0, double p0)
set T and P
double s()
Entropy [J/kg/K].
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...