15 namespace PropertyPair
18 TV = 12, HP = 34, SP = 54, PV = 42, TP = 14, UV = 62, ST = 51,
19 SV = 52, UP = 64, VH = 23, TH = 13, SH = 53, PX = 47, TX = 17,
20 VT = -12, PH = -34, PS = -54, VP = -42, PT = -14, VU = -62, TS = -51,
21 VS = -52, PU = -64, HV = -23, HT = -13, HS = -53, XP = -47, XT = -17
25 const int Pgiven = 0, Tgiven = 1;
27 namespace propertyFlag
29 enum type { H, S, U, V, P, T };
32 const double Undef = 999.1234;
44 void setStdState(
double h0 = 0.0,
double s0 = 0.0,
45 double t0 = 298.15,
double p0 = 1.01325e5);
51 virtual double MolWt()=0;
54 virtual double Tcrit()=0;
57 virtual double Pcrit()=0;
60 virtual double Vcrit()=0;
63 virtual double Tmin()=0;
66 virtual double Tmax()=0;
70 return m_name.c_str();
75 return m_formula.c_str();
95 return prop(propertyFlag::V);
100 return prop(propertyFlag::U);
105 return prop(propertyFlag::H);
110 return prop(propertyFlag::S);
129 virtual double thermalExpansionCoeff();
131 virtual double isothermalCompressibility();
140 virtual double dPsdT();
143 double Tsat(
double p);
153 virtual double Pp()=0;
157 return up() + Pp()/Rho;
162 return hp() - T*
sp();
165 double prop(propertyFlag::type ijob);
168 void set_TPp(
double t0,
double p0);
173 void Set(PropertyPair::type XY,
double x0,
double y0);
177 double Tslast, Rhf, Rhv;
179 double m_energy_offset;
180 double m_entropy_offset;
182 std::string m_formula;
184 virtual double ldens()=0;
187 virtual double Psat()=0;
190 virtual double up()=0;
193 virtual double sp()=0;
195 virtual int ideal() {
205 int Lever(
int itp,
double sat,
double val, propertyFlag::type ifunc);
211 void set_Rho(
double r0);
212 void set_T(
double t0);
213 void set_v(
double v0);
214 void BracketSlope(
double p);
215 double vprop(propertyFlag::type ijob);
216 void set_xy(propertyFlag::type if1, propertyFlag::type if2,
218 double atx,
double aty,
double rtx,
double rty);
224 double v_here, P_here;
virtual double MolWt()=0
Molecular weight [kg/kmol].
virtual double Vcrit()=0
Critical specific volume [m^3/kg].
virtual double dPsdT()
The derivative of the saturation pressure with respect to temperature.
virtual double sp()=0
Entropy of a single-phase state.
double x()
Vapor mass fraction.
int TwoPhase()
Returns 1 if the current state is a liquid/vapor mixture, 0 otherwise.
double Tsat(double p)
Saturation temperature at pressure p.
const char * name()
Name of the substance.
double gp()
Gibbs function of a single-phase state.
virtual double Tmin()=0
Minimum temperature for which the equation of state is valid.
virtual double cp()
Specific heat at constant pressure [J/kg/K].
double s()
Entropy [J/kg/K].
double v()
Specific volume [m^3/kg].
double f()
Helmholtz function [J/kg].
const doublereal Undef
Fairly random number to be used to initialize variables against to see if they are subsequently defin...
void update_sat()
Update saturated liquid and vapor densities and saturation pressure.
void set_TPp(double t0, double p0)
set T and P
virtual double up()=0
Internal energy of a single-phase state.
double Temp()
Temperature [K].
virtual double cv()
Specific heat at constant volume [J/kg/K].
double hp()
Enthaply of a single-phase state.
double g()
Gibbs function [J/kg].
virtual double Tmax()=0
Maximum temperature for which the equation of state is valid.
virtual double Tcrit()=0
Critical temperature [K].
virtual double Psat()=0
Saturation pressure, Pa.
double h()
Enthalpy [J/kg].
double u()
Internal energy [J/kg].
const char * formula()
Chemical formula for the substance.
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].
int Lever(int itp, double sat, double val, propertyFlag::type ifunc)
Uses the lever rule to set state in the dome.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...