81 hrt[0] += presCorrect /
RT();
122 "stoichiometric substances may only contain one species.");
126 auto& eos =
species(0)->input[
"equation-of-state"].getMapWhere(
127 "model",
"constant-volume");
128 if (eos.hasKey(
"density")) {
130 }
else if (eos.hasKey(
"molar-density")) {
132 eos.convert(
"molar-density",
"kmol/m^3"));
133 }
else if (eos.hasKey(
"molar-volume")) {
135 eos.convert(
"molar-volume",
"m^3/kmol"));
138 "equation-of-state entry for species '{}' is missing 'density',"
139 " 'molar-volume' or 'molar-density' specification",
154 AnyMap& speciesNode)
const
159 auto& eosNode = speciesNode[
"equation-of-state"].getMapWhere(
160 "model",
"constant-volume",
true);
162 if (S->input.hasKey(
"equation-of-state")) {
163 auto& eosIn = S->input[
"equation-of-state"];
164 if (eosIn.hasKey(
"density")) {
165 eosNode[
"density"].setQuantity(
density(),
"kg/m^3");
166 }
else if (eosIn.hasKey(
"molar-density")) {
Declaration for class Cantera::Species.
Header file for the StoichSubstance class, which represents a fixed-composition incompressible substa...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
A map of string keys to values whose type can vary at runtime.
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
double convert(const string &key, const string &units) const
Convert the item stored by the given key to the units specified in units.
Base class for exceptions thrown by Cantera classes.
virtual double molarDensity() const
Molar density (kmol/m^3).
void assignDensity(const double density_)
Set the internally stored constant density (kg/m^3) of the phase.
size_t m_kk
Number of species in the phase.
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
string speciesName(size_t k) const
Name of the species with index k.
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
virtual double density() const
Density (kg/m^3).
shared_ptr< Species > species(const string &name) const
Return the Species object for the named species.
string name() const
Return the name of the phase.
double m_h0_RT
Dimensionless enthalpy at the (mtlast, m_p0)
double m_press
The current pressure of the solution (Pa). It gets initialized to 1 atm.
double m_s0_R
Dimensionless entropy at the (mtlast, m_p0)
void getEntropy_R_ref(double *er) const override
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
double m_cp0_R
Dimensionless heat capacity at the (mtlast, m_p0)
void _updateThermo() const
This internal routine calculates new species Cp0, H0, and S0 whenever the temperature has changed.
void getEnthalpy_RT_ref(double *hrt) const override
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
void getStandardChemPotentials(double *mu0) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
double logStandardConc(size_t k=0) const override
Natural logarithm of the standard concentration of the kth species.
double thermalExpansionCoeff() const override
Return the volumetric thermal expansion coefficient. Units: 1/K.
double pressure() const override
Report the Pressure. Units: Pa.
void getSpeciesParameters(const string &name, AnyMap &speciesNode) const override
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
void getEntropy_R(double *sr) const override
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
void getCp_R(double *cpr) const override
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
void getActivityConcentrations(double *c) const override
This method returns an array of generalized concentrations.
void setPressure(double p) override
Set the pressure at constant temperature. Units: Pa.
void getIntEnergy_RT_ref(double *urt) const override
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
void getEnthalpy_RT(double *hrt) const override
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
double isothermalCompressibility() const override
Returns the isothermal compressibility. Units: 1/Pa.
void getGibbs_RT(double *grt) const override
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
void getIntEnergy_RT(double *urt) const override
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
Units standardConcentrationUnits() const override
Returns the units of the "standard concentration" for this phase.
StoichSubstance(const string &infile="", const string &id="")
Construct and initialize a StoichSubstance ThermoPhase object directly from an input file.
double standardConcentration(size_t k=0) const override
Return the standard concentration for the kth species.
double RT() const
Return the Gas Constant multiplied by the current temperature.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
virtual void getSpeciesParameters(const string &name, AnyMap &speciesNode) const
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
virtual double refPressure() const
Returns the reference pressure in Pa.
AnyMap m_input
Data supplied via setParameters.
const AnyMap & input() const
Access input data associated with the phase description.
A representation of the units associated with a dimensional quantity.
Namespace for the Cantera kernel.