Cantera  4.0.0a1
Loading...
Searching...
No Matches
Substance Class Referenceabstract

Base class from which all pure substances are derived. More...

#include <Sub.h>

Inheritance diagram for Substance:
[legend]

Detailed Description

Base class from which all pure substances are derived.

Definition at line 36 of file Sub.h.

Public Member Functions

void setStdState (double h0=0.0, double s0=0.0, double t0=298.15, double p0=1.01325e5)
 
virtual double Pp ()=0
 
double hp ()
 Enthalpy of a single-phase state.
 
double gp ()
 Gibbs function of a single-phase state.
 
double prop (propertyFlag::type ijob)
 
void set_TPp (double t0, double p0)
 set T and P
 
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 and y0 is the value of the second property.
 
Information about a substance
virtual double MolWt ()=0
 Molecular weight [kg/kmol].
 
virtual double Tcrit ()=0
 Critical temperature [K].
 
virtual double Pcrit ()=0
 Critical pressure [Pa].
 
virtual double Vcrit ()=0
 Critical specific volume [m^3/kg].
 
virtual double Tmin ()=0
 Minimum temperature for which the equation of state is valid.
 
virtual double Tmax ()=0
 Maximum temperature for which the equation of state is valid.
 
const char * name ()
 Name of the substance.
 
const char * formula ()
 Chemical formula for the substance.
 
Properties
double P ()
 Pressure [Pa].
 
double Temp ()
 Temperature [K].
 
double v ()
 Specific volume [m^3/kg].
 
double u ()
 Internal energy [J/kg].
 
double h ()
 Enthalpy [J/kg].
 
double s ()
 Entropy [J/kg/K].
 
double f ()
 Helmholtz function [J/kg].
 
double g ()
 Gibbs function [J/kg].
 
virtual double cv ()
 Specific heat at constant volume [J/kg/K].
 
virtual double cp ()
 Specific heat at constant pressure [J/kg/K].
 
virtual double thermalExpansionCoeff ()
 
virtual double isothermalCompressibility ()
 
virtual double internalPressure ()
 Internal pressure [Pa], evaluated as \( \pi_T = (\partial U / \partial V)_T \).
 
Saturation Properties
double Ps ()
 
virtual double dPsdT ()
 The derivative of the saturation pressure with respect to temperature.
 
double Tsat (double p)
 Saturation temperature at pressure p.
 
double x ()
 Vapor mass fraction.
 
int TwoPhase (bool strict=false)
 Returns 1 if the current state is a liquid/vapor mixture, 0 otherwise.
 

Protected Member Functions

virtual double ldens ()=0
 
virtual double Psat ()=0
 Saturation pressure, Pa.
 
virtual double up ()=0
 Internal energy of a single-phase state.
 
virtual double sp ()=0
 Entropy of a single-phase state.
 
virtual int ideal ()
 
double vp ()
 
int Lever (int itp, double sat, double val, propertyFlag::type ifunc)
 Uses the lever rule to set state in the dome.
 
void update_sat ()
 Update saturated liquid and vapor densities and saturation pressure.
 

Protected Attributes

double T = Undef
 
double Rho = Undef
 
double Tslast = Undef
 
double Rhf = Undef
 
double Rhv = Undef
 
double Pst = Undef
 
double m_energy_offset = 0.0
 
double m_entropy_offset = 0.0
 
std::string m_name
 
std::string m_formula
 

Private Member Functions

void set_Rho (double r0)
 
void set_T (double t0)
 
void set_v (double v0)
 
void BracketSlope (double p)
 
double vprop (propertyFlag::type ijob)
 
void set_xy (propertyFlag::type if1, propertyFlag::type if2, double X, double Y, double atx, double aty, double rtx, double rty)
 

Private Attributes

int kbr = 0
 
double Vmin
 
double Vmax
 
double Pmin
 
double Pmax
 
double dvbf
 
double dv
 
double v_here
 
double P_here
 

Member Function Documentation

◆ setStdState()

void setStdState ( double  h0 = 0.0,
double  s0 = 0.0,
double  t0 = 298.15,
double  p0 = 1.01325e5 
)

Definition at line 25 of file Sub.cpp.

◆ MolWt()

virtual double MolWt ( )
pure virtual

Molecular weight [kg/kmol].

Implemented in CarbonDioxide, Heptane, HFC134a, hydrogen, methane, nitrogen, oxygen, and water.

◆ Tcrit()

virtual double Tcrit ( )
pure virtual

Critical temperature [K].

Implemented in CarbonDioxide, Heptane, HFC134a, hydrogen, methane, nitrogen, oxygen, and water.

◆ Pcrit()

virtual double Pcrit ( )
pure virtual

Critical pressure [Pa].

Implemented in CarbonDioxide, Heptane, HFC134a, hydrogen, methane, nitrogen, oxygen, and water.

◆ Vcrit()

virtual double Vcrit ( )
pure virtual

Critical specific volume [m^3/kg].

Implemented in CarbonDioxide, Heptane, HFC134a, hydrogen, methane, nitrogen, oxygen, and water.

◆ Tmin()

virtual double Tmin ( )
pure virtual

Minimum temperature for which the equation of state is valid.

Implemented in CarbonDioxide, Heptane, HFC134a, hydrogen, methane, nitrogen, oxygen, and water.

◆ Tmax()

virtual double Tmax ( )
pure virtual

Maximum temperature for which the equation of state is valid.

Implemented in CarbonDioxide, Heptane, HFC134a, hydrogen, methane, nitrogen, oxygen, and water.

◆ name()

const char * name ( )
inline

Name of the substance.

Definition at line 68 of file Sub.h.

◆ formula()

const char * formula ( )
inline

Chemical formula for the substance.

Definition at line 73 of file Sub.h.

◆ P()

double P ( )

Pressure [Pa].

If two phases are present, return the saturation pressure; otherwise return the pressure computed directly from the underlying eos.

Definition at line 36 of file Sub.cpp.

◆ Temp()

double Temp ( )
inline

Temperature [K].

Definition at line 88 of file Sub.h.

◆ v()

double v ( )
inline

Specific volume [m^3/kg].

Definition at line 93 of file Sub.h.

◆ u()

double u ( )
inline

Internal energy [J/kg].

Definition at line 98 of file Sub.h.

◆ h()

double h ( )
inline

Enthalpy [J/kg].

Definition at line 103 of file Sub.h.

◆ s()

double s ( )
inline

Entropy [J/kg/K].

Definition at line 108 of file Sub.h.

◆ f()

double f ( )
inline

Helmholtz function [J/kg].

Definition at line 113 of file Sub.h.

◆ g()

double g ( )
inline

Gibbs function [J/kg].

Definition at line 118 of file Sub.h.

◆ cv()

double cv ( )
virtual

Specific heat at constant volume [J/kg/K].

Definition at line 43 of file Sub.cpp.

◆ cp()

double cp ( )
virtual

Specific heat at constant pressure [J/kg/K].

Definition at line 81 of file Sub.cpp.

◆ thermalExpansionCoeff()

double thermalExpansionCoeff ( )
virtual

Definition at line 133 of file Sub.cpp.

◆ isothermalCompressibility()

double isothermalCompressibility ( )
virtual

Definition at line 186 of file Sub.cpp.

◆ internalPressure()

double internalPressure ( )
virtual

Internal pressure [Pa], evaluated as \( \pi_T = (\partial U / \partial V)_T \).

Definition at line 234 of file Sub.cpp.

◆ Ps()

double Ps ( )

Definition at line 505 of file Sub.cpp.

◆ dPsdT()

double dPsdT ( )
virtual

The derivative of the saturation pressure with respect to temperature.

Definition at line 253 of file Sub.cpp.

◆ Tsat()

double Tsat ( double  p)

Saturation temperature at pressure p.

Definition at line 300 of file Sub.cpp.

◆ x()

double x ( )

Vapor mass fraction.

If T >= Tcrit, 0 is returned for v < Vcrit, and 1 is returned if v > Vcrit.

Definition at line 282 of file Sub.cpp.

◆ TwoPhase()

int TwoPhase ( bool  strict = false)

Returns 1 if the current state is a liquid/vapor mixture, 0 otherwise.

By default, saturated vapor and saturated liquid are included; setting the flag strict to true will exclude the boundaries.

Definition at line 270 of file Sub.cpp.

◆ Pp()

virtual double Pp ( )
pure virtual

Implemented in CarbonDioxide, and Heptane.

◆ hp()

double hp ( )
inline

Enthalpy of a single-phase state.

Definition at line 161 of file Sub.h.

◆ gp()

double gp ( )
inline

Gibbs function of a single-phase state.

Definition at line 166 of file Sub.h.

◆ prop()

double prop ( propertyFlag::type  ijob)

Definition at line 743 of file Sub.cpp.

◆ set_TPp()

void set_TPp ( double  t0,
double  p0 
)

set T and P

Definition at line 788 of file Sub.cpp.

◆ Set()

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 and y0 is the value of the second property.

Definition at line 353 of file Sub.cpp.

◆ ldens()

virtual double ldens ( )
protectedpure virtual

◆ Psat()

virtual double Psat ( )
protectedpure virtual

Saturation pressure, Pa.

Implemented in CarbonDioxide, Heptane, HFC134a, hydrogen, methane, nitrogen, oxygen, and water.

◆ up()

virtual double up ( )
protectedpure virtual

Internal energy of a single-phase state.

Implemented in CarbonDioxide, Heptane, HFC134a, hydrogen, methane, nitrogen, oxygen, and water.

◆ sp()

virtual double sp ( )
protectedpure virtual

Entropy of a single-phase state.

Implemented in CarbonDioxide, Heptane, HFC134a, hydrogen, methane, nitrogen, oxygen, and water.

◆ ideal()

virtual int ideal ( )
inlineprotectedvirtual

Definition at line 203 of file Sub.h.

◆ vp()

double vp ( )
inlineprotected

Definition at line 207 of file Sub.h.

◆ Lever()

int Lever ( int  itp,
double  sat,
double  val,
propertyFlag::type  ifunc 
)
protected

Uses the lever rule to set state in the dome.

Returns 1 if in dome, 0 if not, in which case state not set.

Definition at line 597 of file Sub.cpp.

◆ update_sat()

void update_sat ( )
protected

Update saturated liquid and vapor densities and saturation pressure.

Definition at line 515 of file Sub.cpp.

◆ set_Rho()

void set_Rho ( double  r0)
private

Definition at line 477 of file Sub.cpp.

◆ set_T()

void set_T ( double  t0)
private

Definition at line 486 of file Sub.cpp.

◆ set_v()

void set_v ( double  v0)
private

Definition at line 495 of file Sub.cpp.

◆ BracketSlope()

void BracketSlope ( double  p)
private

Definition at line 769 of file Sub.cpp.

◆ vprop()

double vprop ( propertyFlag::type  ijob)
private

Definition at line 579 of file Sub.cpp.

◆ set_xy()

void set_xy ( propertyFlag::type  if1,
propertyFlag::type  if2,
double  X,
double  Y,
double  atx,
double  aty,
double  rtx,
double  rty 
)
private

Definition at line 640 of file Sub.cpp.

Member Data Documentation

◆ T

double T = Undef
protected

Definition at line 181 of file Sub.h.

◆ Rho

double Rho = Undef
protected

Definition at line 182 of file Sub.h.

◆ Tslast

double Tslast = Undef
protected

Definition at line 183 of file Sub.h.

◆ Rhf

double Rhf = Undef
protected

Definition at line 184 of file Sub.h.

◆ Rhv

double Rhv = Undef
protected

Definition at line 185 of file Sub.h.

◆ Pst

double Pst = Undef
protected

Definition at line 186 of file Sub.h.

◆ m_energy_offset

double m_energy_offset = 0.0
protected

Definition at line 187 of file Sub.h.

◆ m_entropy_offset

double m_entropy_offset = 0.0
protected

Definition at line 188 of file Sub.h.

◆ m_name

std::string m_name
protected

Definition at line 189 of file Sub.h.

◆ m_formula

std::string m_formula
protected

Definition at line 190 of file Sub.h.

◆ kbr

int kbr = 0
private

Definition at line 228 of file Sub.h.

◆ Vmin

double Vmin
private

Definition at line 229 of file Sub.h.

◆ Vmax

double Vmax
private

Definition at line 229 of file Sub.h.

◆ Pmin

double Pmin
private

Definition at line 230 of file Sub.h.

◆ Pmax

double Pmax
private

Definition at line 230 of file Sub.h.

◆ dvbf

double dvbf
private

Definition at line 231 of file Sub.h.

◆ dv

double dv
private

Definition at line 231 of file Sub.h.

◆ v_here

double v_here
private

Definition at line 232 of file Sub.h.

◆ P_here

double P_here
private

Definition at line 232 of file Sub.h.


The documentation for this class was generated from the following files: