Cantera
2.1.2
|
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. More...
Classes | |
class | UnknownVPSSMgrModel |
Throw a named error for an unknown or missing vpss species thermo model. More... | |
class | VPSSMgrFactory |
Factory to build instances of classes that manage the standard-state thermodynamic properties of a set of species. More... | |
class | VPSSMgr_ConstVol |
Constant Molar Volume e VPSS species thermo manager class. More... | |
class | VPSSMgr_General |
Class that handles the calculation of standard state thermo properties for a set of species belonging to a single phase in a completely general but slow way. More... | |
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.
Exactly what sort of species properties are required depends on the thermodynamic model for the solution. For a gaseous solution (i.e., a gas mixture), the species properties required are usually ideal gas properties at the mixture temperature and at a reference pressure (almost always at 1 bar). For other types of solutions, however, it may not be possible to isolate the species in a "pure" state. For example, the thermodynamic properties of, say, Na+ and Cl- in saltwater are not easily determined from data on the properties of solid NaCl, or solid Na metal, or chlorine gas. In this case, the solvation in water is fundamental to the identity of the species, and some other reference state must be used. One common convention for liquid solutions is to use thermodynamic data for the solutes in the limit of infinite dilution within the pure solvent; another convention is to reference all properties to unit molality.
In defining these standard states for species in a phase, we make the following definition. A reference state is a standard state of a species in a phase limited to one particular pressure, the reference pressure. The reference state specifies the dependence of all thermodynamic functions as a function of the temperature, in between a minimum temperature and a maximum temperature. The reference state also specifies the molar volume of the species as a function of temperature. The molar volume is a thermodynamic function. A full standard state does the same thing as a reference state, but specifies the thermodynamics functions at all pressures.
Class VPSSMgr is the base class for a family of classes that compute properties of all species in a phase in their standard states, for a range of temperatures and pressures.
Phases which use the VPSSMGr class must have their respective ThermoPhase objects actually be derivatives of the VPStandardState class. 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 thermo objects for each species in the phase are all derived from the PDSS virtual base class. Calculators for these standard state thermo , which coordinate the calculation for all of the species in a phase, are all derived from VPSSMgr. In turn, these standard states may employ reference state calculation to aid in their calculations. And the VPSSMgr calculators may also employ SimpleThermo calculators to help in calculating the properties for all of the species in a phase. However, there are some PDSS objects which do not employ reference state calculations. An example of this is a real equation of state for liquid water used within the calculation of brine thermodynamics.
Typically calls to calculate standard state thermo properties are virtual calls at the ThermoPhase level. It is left to the child classes of ThermoPhase to specify how these are carried out. Usually, this will involve calling the m_spthermo pointer to a SpeciesThermo object to calculate the reference state thermodynamic properties. Then, the pressure dependence is added in within the child ThermoPhase object to complete the specification of the standard state. The VPStandardStateTP class, however, redefines the calls to the calculation of standard state properties to use VPSSMgr class calls. A listing of these classes and important pointers are supplied below.
- ThermoPhase - \link Cantera::ThermoPhase::m_spthermo m_spthermo\endlink This is a pointer to a %SpeciesThermo manager class that handles the reference %state Thermodynamic calculations. - VPStandardStateTP (inherits from %ThermoPhase) - \link Cantera::ThermoPhase::m_spthermo m_spthermo\endlink %SpeciesThermo manager handling reference %state Thermodynamic calculations. may or may not be used by the VPSSMgr class. For species which don't have a reference state class defined, a default class, called STITbyPDSS which is installed into the SpeciesThermo class, actually calculates reference state thermo by calling a PDSS object. - \link Cantera::VPStandardStateTP::m_VPSS_ptr m_VPSS_ptr\endlink This is a pointer to a %VPSSMgr class which handles the standard %state thermo calculations. It may or may not use the pointer, m_spthermo, in its calculations.
The following classes inherit from VPSSMgr. Each of these classes handle multiple species and by definition all of the species in a phase. It is a requirement that a VPSSMgr object handles all of the species in a phase.
The choice of which VPSSMgr object to be used is implicitly made by Cantera by querying the XML data file for compatibility. However, each of these VPSSMgr objects may be explicitly requested in the XML file by adding in the following XML node into the thermo section of the phase XML Node. For example, the code example listed below explicitly requests that the VPSSMgr_IdealGas object be used to handle the standard state thermodynamics calculations.
If it turns out that the VPSSMgr_IdealGas class can not handle the standard state calculation, then Cantera will fail during the instantiation phase printing out an informative error message.
In the source code listing above, the thermo model, VPIdealGas ,was requested. The thermo model specifies the type of ThermoPhase object to use. In this case the object IdealSolnGasVPSS (with the ideal gas suboption) is used. IdealSolnGasVPSS inherits from VPStandardStateTP, so that it actually has a VPSSMgr pointer to be specified. Note, in addition to the IdealGas entry to the model parameter in standardState node, we could have also specified the "General" option. The general option will always work. An example of this usage is listed below.
The "General" option will cause the VPSSMgr_General VPSSMgr class to be used. In this manager, the calculations are all handled at the PDSS object level. This is completely general, but, may be significantly slower.