Cantera  3.1.0
Loading...
Searching...
No Matches
Thermodynamic Properties

These classes are used to compute the thermodynamic properties of phases of matter. More...

Collaboration diagram for Thermodynamic Properties:

Detailed Description

These classes are used to compute the thermodynamic properties of phases of matter.

The main base class for describing thermodynamic properties of phases within Cantera is called ThermoPhase. ThermoPhase is a large class that describes the interface within Cantera to thermodynamic functions for a phase.

Categorizing the Different ThermoPhase Objects

ThermoPhase objects may be cataloged into four general bins.

The first type are those whose underlying species have a reference state associated with them. The reference state describes the thermodynamic functions for a species at a single reference pressure, \( p_0 \). The thermodynamic functions are specified via derived objects of the SpeciesThermoInterpType object class, and usually consist of polynomials in temperature such as the NASA polynomial or the Shomate polynomial. Calculators for these reference states, which manage the calculation for all of the species in a phase, are all derived from the virtual base class SpeciesThermoInterpType. Calculators are needed because the actual calculation of the reference state thermodynamics has been shown to be relatively expensive. A great deal of work has gone into devising efficient schemes for calculating the thermodynamic polynomials of a set of species in a phase, in particular gas species in ideal gas phases whose reference state thermodynamics is specified by NASA polynomials.

The reference state thermodynamics combined with the mixing rules and an assumption about the pressure dependence yields the thermodynamic functions for the phase. Expressions involving the specification of the fugacities of species would fall into this category of ThermoPhase objects. Note, however, that at this time, we do not have any nontrivial examples of these types of phases. In general, the independent variables that completely describe the state of the system for this class are temperature, the phase density, and \( N - 1 \) species mole or mass fractions. Additionally, if the phase involves charged species, the phase electric potential is an added independent variable. Examples of this first class of ThermoPhase models, which includes the IdealGasPhase object, the most commonly used object with Cantera, include:

The second class of objects are all derivatives of the VPStandardStateTP class listed above. These classes assume that there exists a standard state for each species in the phase, where the thermodynamic functions are specified as a function of temperature and pressure. Standard state objects for each species are all derived from the PDSS virtual base class. In turn, these standard states may employ reference state calculation to aid in their calculations. However, there are some PDSS objects which do not employ reference state calculations. An example of this is real equation of state for liquid water used within the calculation of brine thermodynamics. In general, the independent variables that completely describe the state of the system for this class are temperature, the phase pressure, and \( N - 1 \) species mole or mass fractions or molalities. The standard state thermodynamics combined with the mixing rules yields the thermodynamic functions for the phase. Mixing rules are given in terms of specifying the molar-base activity coefficients or activities. Lists of phases which belong to this group are given below

Note, the ideal gas and ideal solution approximations are lumped together in the class IdealSolnGasVPSS, because at this level they look alike having the same mixing rules with respect to the specification of the excess thermodynamic properties.

The third class of objects are all derivatives of the MolalityVPSSTP object. They assume that the standard states are temperature and pressure dependent but they also assume that the standard states are molality-based. In other words, they assume that the standard state of the solute species are in a pseudo state of 1 molality but at infinite dilution. A solvent must be specified in these calculations, defined as the first species in the phase, and its standard state is the pure solvent state. Phases which belong to this group include:

The fourth class of ThermoPhase objects are stoichiometric phases. Stoichiometric phases are phases which consist of one and only one species. The class SingleSpeciesTP is the base class for these substances. Within the class, the general ThermoPhase interface is dumbed down so that phases consisting of one species may be succinctly described. These phases may have PDSS classes or SpeciesThermoInterpType calculators associated with them. In general, the independent variables that completely describe the state of the system for this class are temperature and either the phase density or the phase pressure. Classes in this group include:

Creating ThermoPhase objects

Instances of subclasses of ThermoPhase should be created using the factory methods newThermo(const string&, const string&), newThermo(const AnyMap&, const AnyMap&), or newThermoModel(). This allows new classes to be used with the various Cantera language interfaces.

Defining new thermodynamic models

To implement a new equation of state, derive a class from ThermoPhase or a relevant existing derived class and overload the virtual methods in ThermoPhase. Methods that are not needed can be left unimplemented, which will cause an exception to be thrown if they are called.

Modules

 Species Standard-State Thermodynamic Properties
 In this module we describe Cantera's treatment of pressure dependent standard states (PDSS) objects.
 
 Species Reference-State Thermodynamic Properties
 To compute the thermodynamic properties of multicomponent solutions, it is necessary to know something about the thermodynamic properties of the individual species present in the solution.
 

Classes

class  BinarySolutionTabulatedThermo
 Overloads the virtual methods of class IdealSolidSolnPhase to implement tabulated standard state thermodynamics for one species in a binary solution. More...
 
class  DebyeHuckel
 Class DebyeHuckel represents a dilute liquid electrolyte phase which obeys the Debye Huckel formulation for nonideality. More...
 
class  EdgePhase
 A thermodynamic phase representing a one dimensional edge between two surfaces. More...
 
class  HMWSoln
 Class HMWSoln represents a dilute or concentrated liquid electrolyte phase which obeys the Pitzer formulation for nonideality. More...
 
class  IdealGasPhase
 Class IdealGasPhase represents low-density gases that obey the ideal gas equation of state. More...
 
class  IdealMolalSoln
 This phase is based upon the mixing-rule assumption that all molality-based activity coefficients are equal to one. More...
 
class  IdealSolidSolnPhase
 Class IdealSolidSolnPhase represents a condensed phase ideal solution compound. More...
 
class  IdealSolnGasVPSS
 An ideal solution approximation of a phase. More...
 
class  LatticePhase
 A simple thermodynamic model for a bulk phase, assuming a lattice of solid atoms. More...
 
class  MargulesVPSSTP
 MargulesVPSSTP is a derived class of GibbsExcessVPSSTP that employs the Margules approximation for the excess Gibbs free energy. More...
 
class  MetalPhase
 Class MetalPhase represents electrons in a metal. More...
 
class  MixtureFugacityTP
 This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handling mixture of gases that whose standard states are defined as ideal gases, but which describe also non-ideal solutions. More...
 
class  PengRobinson
 Implementation of a multi-species Peng-Robinson equation of state. More...
 
class  Phase
 Class Phase is the base class for phases of matter, managing the species and elements in a phase, as well as the independent variables of temperature, mass density (compressible substances) or pressure (incompressible substances), species mass/mole fraction, and other generalized forces and intrinsic properties (such as electric potential) that define the thermodynamic state. More...
 
class  PlasmaPhase
 Base class for a phase with plasma properties. More...
 
class  PureFluidPhase
 This phase object consists of a single component that can be a gas, a liquid, a mixed gas-liquid fluid, or a fluid beyond its critical point. More...
 
class  RedlichKisterVPSSTP
 RedlichKisterVPSSTP is a derived class of GibbsExcessVPSSTP that employs the Redlich-Kister approximation for the excess Gibbs free energy. More...
 
class  RedlichKwongMFTP
 Implementation of a multi-species Redlich-Kwong equation of state. More...
 
class  SingleSpeciesTP
 The SingleSpeciesTP class is a filter class for ThermoPhase. More...
 
class  StoichSubstance
 Class StoichSubstance represents a stoichiometric (fixed composition) incompressible substance. More...
 
class  SurfPhase
 A simple thermodynamic model for a surface phase, assuming an ideal solution model. More...
 
class  ThermoFactory
 Factory class for thermodynamic property managers. More...
 
class  ThermoPhase
 Base class for a phase with thermodynamic properties. More...
 
class  VPStandardStateTP
 This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handling a variable pressure standard state for species. More...
 
class  WaterPropsIAPWS
 Class for calculating the equation of state of water. More...
 
class  WaterSSTP
 Class for single-component water. More...
 

Functions

shared_ptr< ThermoPhasenewThermoModel (const string &model)
 Create a new ThermoPhase instance.
 
shared_ptr< ThermoPhasenewThermo (const AnyMap &phaseNode, const AnyMap &rootNode=AnyMap())
 Create a new ThermoPhase object and initialize it.
 
shared_ptr< ThermoPhasenewThermo (const string &infile, const string &id="")
 Create and Initialize a ThermoPhase object from an input file.
 
void setupPhase (ThermoPhase &phase, const AnyMap &phaseNode, const AnyMap &rootNode=AnyMap())
 Initialize a ThermoPhase object.
 

Function Documentation

◆ newThermoModel()

shared_ptr< ThermoPhase > newThermoModel ( const string &  model)

Create a new ThermoPhase instance.

Parameters
modelString to look up the model against
Returns
a shared pointer to a new ThermoPhase object of the type specified. Throws a CanteraError if the named model is not registered with ThermoFactory.
Since
New in Cantera 3.0. Replaces newThermo

Definition at line 119 of file ThermoFactory.cpp.

◆ newThermo() [1/2]

shared_ptr< ThermoPhase > newThermo ( const AnyMap phaseNode,
const AnyMap rootNode = AnyMap() 
)

Create a new ThermoPhase object and initialize it.

Parameters
phaseNodeThe node containing the phase definition (that is, thermo model, list of species, and initial state)
rootNodeThe root node of the tree containing the phase definition, which will be used as the default location from which to read species definitions.
Since
New in Cantera 3.0.

Definition at line 125 of file ThermoFactory.cpp.

◆ newThermo() [2/2]

shared_ptr< ThermoPhase > newThermo ( const string &  infile,
const string &  id = "" 
)

Create and Initialize a ThermoPhase object from an input file.

This function uses AnyMap::fromYamlFile() to read the input file, newThermo() to create an empty ThermoPhase of the appropriate type, and setupPhase() to initialize the phase.

Parameters
infilename of the input file
idname (id) of the phase in the file. If this is blank, the first phase in the file is used.
Returns
an initialized ThermoPhase object.
Since
Changed in Cantera 3.0. Prior to Cantera 3.0, the function used a single argument specifying the thermo model, which is now deprecated.

Definition at line 138 of file ThermoFactory.cpp.

◆ setupPhase()

void setupPhase ( ThermoPhase phase,
const AnyMap phaseNode,
const AnyMap rootNode = AnyMap() 
)

Initialize a ThermoPhase object.

Parameters
phaseThe ThermoPhase object to be initialized
phaseNodeThe node containing the phase definition (that is, thermo model, list of species, and initial state)
rootNodeThe root node of the tree containing the phase definition, which will be used as the default location from which to read species definitions.

Definition at line 207 of file ThermoFactory.cpp.