56 checkArraySize(
"StoichSubstance::getActivityConcentrations", c.size(), 1);
82 hrt[0] += presCorrect /
RT();
105 checkArraySize(
"StoichSubstance::getIntEnergy_RT", urt.size(), 1);
114 checkArraySize(
"StoichSubstance::getIntEnergy_RT_ref", urt.size(), 1);
126 "stoichiometric substances may only contain one species.");
130 auto& eos =
species(0)->input[
"equation-of-state"].getMapWhere(
131 "model",
"constant-volume");
132 if (eos.hasKey(
"density")) {
134 }
else if (eos.hasKey(
"molar-density")) {
136 eos.convert(
"molar-density",
"kmol/m^3"));
137 }
else if (eos.hasKey(
"molar-volume")) {
139 eos.convert(
"molar-volume",
"m^3/kmol"));
142 "equation-of-state entry for species '{}' is missing 'density',"
143 " 'molar-volume' or 'molar-density' specification",
158 AnyMap& speciesNode)
const
163 auto& eosNode = speciesNode[
"equation-of-state"].getMapWhere(
164 "model",
"constant-volume",
true);
166 if (S->input.hasKey(
"equation-of-state")) {
167 auto& eosIn = S->input[
"equation-of-state"];
168 if (eosIn.hasKey(
"density")) {
169 eosNode[
"density"].setQuantity(
density(),
"kg/m^3");
170 }
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.
size_t speciesIndex(const string &name, bool raise=true) const
Returns the index of a species named 'name' within the Phase object.
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
string speciesName(size_t k) const
Name of the species with index k.
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.
void getEntropy_R_ref(span< double > er) const override
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
void getEnthalpy_RT_ref(span< double > hrt) const override
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
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)
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.
double logStandardConc(size_t k=0) const override
Natural logarithm of the standard concentration of the kth species.
void getCp_R(span< double > cpr) const override
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
double thermalExpansionCoeff() const override
Return the volumetric thermal expansion coefficient. Units: 1/K.
void getStandardChemPotentials(span< double > mu0) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
double pressure() const override
Report the Pressure. Units: Pa.
void getIntEnergy_RT(span< double > urt) const override
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
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 getGibbs_RT(span< double > grt) const override
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
void setPressure(double p) override
Set the pressure at constant temperature. Units: Pa.
void getIntEnergy_RT_ref(span< double > urt) const override
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
void getEnthalpy_RT(span< double > hrt) const override
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
void getEntropy_R(span< double > sr) const override
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
double isothermalCompressibility() const override
Returns the isothermal compressibility. Units: 1/Pa.
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.
void getActivityConcentrations(span< double > c) const override
This method returns an array of generalized concentrations.
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.
void checkArraySize(const char *procedure, size_t available, size_t required)
Wrapper for throwing ArraySizeError.