A species thermodynamic property manager for a phase. More...
#include <MultiSpeciesThermo.h>
A species thermodynamic property manager for a phase.
This is a general manager that can handle a wide variety of species thermodynamic polynomials for individual species and compute their nondimensional, reference-state thermodynamic properties (that is, as a function of temperature only).
The ThermoPhase object relies on MultiSpeciesThermo to calculate the thermodynamic properties of the reference state for all of the species in the phase, for a range of temperatures. Note, the pressure dependence of the species thermodynamic functions is not handled at this level. Species using the same parameterization are grouped together in order to minimize the operation count and achieve better efficiency.
The most important member function for the MultiSpeciesThermo class is the member function MultiSpeciesThermo::update(). The function calculates the values of Cp/R, H/RT, and S/R for all of the species at once at the specified temperature.
Usually, all of the species in a phase are installed into a MultiSpeciesThermo object. However, there is no requirement that a MultiSpeciesThermo object handles all of the species in a phase. The member function install_STIT() is called to install each species into the MultiSpeciesThermo object.
Definition at line 46 of file MultiSpeciesThermo.h.
Public Member Functions | |
MultiSpeciesThermo ()=default | |
Constructor. | |
MultiSpeciesThermo (const MultiSpeciesThermo &b)=delete | |
MultiSpeciesThermo & | operator= (const MultiSpeciesThermo &b)=delete |
virtual void | install_STIT (size_t index, shared_ptr< SpeciesThermoInterpType > stit) |
Install a new species thermodynamic property parameterization for one species. | |
virtual void | modifySpecies (size_t index, shared_ptr< SpeciesThermoInterpType > spec) |
Modify the species thermodynamic property parameterization for a species. | |
virtual void | update_single (size_t k, double T, double *cp_R, double *h_RT, double *s_R) const |
Get reference-state properties for a single species. | |
virtual void | update (double T, double *cp_R, double *h_RT, double *s_R) const |
Compute the reference-state properties for all species. | |
virtual double | minTemp (size_t k=npos) const |
Minimum temperature. | |
virtual double | maxTemp (size_t k=npos) const |
Maximum temperature. | |
virtual double | refPressure () const |
The reference-state pressure (Pa) for all species. | |
virtual int | reportType (size_t index) const |
This utility function reports the type of parameterization used for the species with index number index. | |
virtual void | reportParams (size_t index, int &type, double *const c, double &minTemp, double &maxTemp, double &refPressure) const |
This utility function reports back the type of parameterization and all of the parameters for the species with index number index. | |
virtual double | reportOneHf298 (const size_t k) const |
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) | |
virtual void | modifyOneHf298 (const size_t k, const double Hf298New) |
Modify the value of the 298 K Heat of Formation of the standard state of one species in the phase (J kmol-1) | |
virtual void | resetHf298 (const size_t k) |
Restore the original heat of formation of one or more species. | |
bool | ready (size_t nSpecies) |
Check if data for all species (0 through nSpecies-1) has been installed. | |
Protected Types | |
typedef pair< size_t, shared_ptr< SpeciesThermoInterpType > > | index_STIT |
typedef map< int, vector< index_STIT > > | STIT_map |
typedef map< int, vector< double > > | tpoly_map |
Protected Member Functions | |
void | markInstalled (size_t k) |
Mark species k as having its thermodynamic data installed. | |
Protected Attributes | |
STIT_map | m_sp |
This is the main data structure, which contains the SpeciesThermoInterpType objects, sorted by the parameterization type. | |
tpoly_map | m_tpoly |
Temperature polynomials for each thermo parameterization. | |
map< size_t, pair< int, size_t > > | m_speciesLoc |
Map from species index to location within m_sp, such that m_sp[m_speciesLoc[k].first][m_speciesLoc[k].second] is the SpeciesThermoInterpType object for species k . | |
double | m_tlow_max = 0.0 |
Maximum value of the lowest temperature. | |
double | m_thigh_min = 1e+30 |
Minimum value of the highest temperature. | |
double | m_p0 = 0.0 |
reference pressure (Pa) | |
vector< bool > | m_installed |
indicates if data for species has been installed | |
Private Member Functions | |
SpeciesThermoInterpType * | provideSTIT (size_t k) |
Provide the SpeciesThermoInterpType object. | |
const SpeciesThermoInterpType * | provideSTIT (size_t k) const |
|
protected |
Definition at line 193 of file MultiSpeciesThermo.h.
|
protected |
Definition at line 194 of file MultiSpeciesThermo.h.
|
protected |
Definition at line 195 of file MultiSpeciesThermo.h.
|
default |
Constructor.
|
virtual |
Install a new species thermodynamic property parameterization for one species.
index | Index of the species being installed |
stit | Pointer to the SpeciesThermoInterpType object This will set up the thermo for one species |
Definition at line 21 of file MultiSpeciesThermo.cpp.
|
virtual |
Modify the species thermodynamic property parameterization for a species.
index | Index of the species being installed |
spec | Pointer to the SpeciesThermoInterpType object |
Definition at line 53 of file MultiSpeciesThermo.cpp.
|
virtual |
Get reference-state properties for a single species.
k | species index |
T | Temperature (Kelvin) |
cp_R | Dimensionless heat capacity |
h_RT | Dimensionless enthalpy |
s_R | Dimensionless entropy |
Definition at line 85 of file MultiSpeciesThermo.cpp.
|
virtual |
Compute the reference-state properties for all species.
Given temperature T in K, this method updates the values of the non- dimensional heat capacity at constant pressure, enthalpy, and entropy, at the reference pressure, Pref of each of the standard states.
T | Temperature (Kelvin) |
cp_R | Vector of Dimensionless heat capacities. (length m_kk). |
h_RT | Vector of Dimensionless enthalpies. (length m_kk). |
s_R | Vector of Dimensionless entropies. (length m_kk). |
Definition at line 94 of file MultiSpeciesThermo.cpp.
|
virtual |
Minimum temperature.
If no argument is supplied, this method returns the minimum temperature for which all parameterizations are valid. If an integer index k is supplied, then the value returned is the minimum temperature for species k in the phase.
k | Species index |
Definition at line 130 of file MultiSpeciesThermo.cpp.
|
virtual |
Maximum temperature.
If no argument is supplied, this method returns the maximum temperature for which all parameterizations are valid. If an integer index k is supplied, then the value returned is the maximum temperature for parameterization k.
k | Species Index |
Definition at line 141 of file MultiSpeciesThermo.cpp.
|
virtual |
The reference-state pressure (Pa) for all species.
Definition at line 152 of file MultiSpeciesThermo.cpp.
|
virtual |
This utility function reports the type of parameterization used for the species with index number index.
index | Species index |
Definition at line 108 of file MultiSpeciesThermo.cpp.
|
virtual |
This utility function reports back the type of parameterization and all of the parameters for the species with index number index.
index | Species index |
type | Integer type of the standard type |
c | Vector of coefficients used to set the parameters for the standard state. |
minTemp | output - Minimum temperature |
maxTemp | output - Maximum temperature |
refPressure | output - reference pressure (Pa). |
Definition at line 117 of file MultiSpeciesThermo.cpp.
|
virtual |
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1)
The 298K Heat of Formation is defined as the enthalpy change to create the standard state of the species from its constituent elements in their standard states at 298 K and 1 bar.
k | species index |
Definition at line 177 of file MultiSpeciesThermo.cpp.
|
virtual |
Modify the value of the 298 K Heat of Formation of the standard state of one species in the phase (J kmol-1)
The 298K heat of formation is defined as the enthalpy change to create the standard state of the species from its constituent elements in their standard states at 298 K and 1 bar.
k | Index of the species |
Hf298New | Specify the new value of the Heat of Formation at 298K and 1 bar. units = J/kmol. |
Definition at line 187 of file MultiSpeciesThermo.cpp.
|
virtual |
Restore the original heat of formation of one or more species.
Resets changes made by modifyOneHf298(). If the species index is not specified, the heats of formation for all species are restored.
Definition at line 195 of file MultiSpeciesThermo.cpp.
bool ready | ( | size_t | nSpecies | ) |
Check if data for all species (0 through nSpecies-1) has been installed.
Definition at line 203 of file MultiSpeciesThermo.cpp.
|
private |
Provide the SpeciesThermoInterpType object.
k | species index |
Definition at line 157 of file MultiSpeciesThermo.cpp.
|
private |
Definition at line 167 of file MultiSpeciesThermo.cpp.
|
protected |
Mark species k as having its thermodynamic data installed.
Definition at line 215 of file MultiSpeciesThermo.cpp.
|
protected |
This is the main data structure, which contains the SpeciesThermoInterpType objects, sorted by the parameterization type.
m_sp[i]
is the vector of [species index, STIT] pairs which use parameterization i
.
Definition at line 201 of file MultiSpeciesThermo.h.
|
mutableprotected |
Temperature polynomials for each thermo parameterization.
Definition at line 204 of file MultiSpeciesThermo.h.
|
protected |
Map from species index to location within m_sp, such that m_sp[m_speciesLoc[k].first][m_speciesLoc[k].second]
is the SpeciesThermoInterpType object for species k
.
Definition at line 209 of file MultiSpeciesThermo.h.
|
protected |
Maximum value of the lowest temperature.
Definition at line 212 of file MultiSpeciesThermo.h.
|
protected |
Minimum value of the highest temperature.
Definition at line 215 of file MultiSpeciesThermo.h.
|
protected |
reference pressure (Pa)
Definition at line 218 of file MultiSpeciesThermo.h.
|
protected |
indicates if data for species has been installed
Definition at line 221 of file MultiSpeciesThermo.h.