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;
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();
143 virtual double dPsdT();
146 double Tsat(
double p);
158 virtual double Pp()=0;
162 return up() + Pp()/Rho;
167 return hp() - T*
sp();
170 double prop(propertyFlag::type ijob);
173 void set_TPp(
double t0,
double p0);
178 void Set(PropertyPair::type XY,
double x0,
double y0);
183 double Tslast = Undef;
187 double m_energy_offset = 0.0;
188 double m_entropy_offset = 0.0;
190 std::string m_formula;
192 virtual double ldens()=0;
198 virtual double up()=0;
201 virtual double sp()=0;
203 virtual int ideal() {
213 int Lever(
int itp,
double sat,
double val, propertyFlag::type ifunc);
219 void set_Rho(
double r0);
220 void set_T(
double t0);
221 void set_v(
double v0);
222 void BracketSlope(
double p);
223 double vprop(propertyFlag::type ijob);
224 void set_xy(propertyFlag::type if1, propertyFlag::type if2,
226 double atx,
double aty,
double rtx,
double rty);
232 double v_here, P_here;
Base class from which all pure substances are derived.
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 internalPressure()
Internal pressure [Pa], evaluated as .
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...
const double Undef
Fairly random number to be used to initialize variables against to see if they are subsequently defin...