53 for (
size_t k = 0; k <
m_kk; k++) {
62 for (
size_t k = 0; k <
m_kk; k++) {
72 for (
size_t k = 0; k <
m_kk; k++) {
74 mu[k] +=
RT() * log(xx);
81 scale(_h.begin(), _h.end(), hbar,
RT());
89 for (
size_t k = 0; k <
m_kk; k++) {
98 for (
size_t k = 0; k <
m_kk; k++) {
99 ubar[k] =
RT() * (_h[k] - 1.0);
105 const vector<double>& _cp =
cp_R_ref();
112 for (
size_t k = 0; k <
m_kk; k++) {
122 copy(_h.begin(), _h.end(), hrt);
128 copy(_s.begin(), _s.end(), sr);
130 for (
size_t k = 0; k <
m_kk; k++) {
138 copy(gibbsrt.begin(), gibbsrt.end(), grt);
140 for (
size_t k = 0; k <
m_kk; k++) {
148 scale(gibbsrt.begin(), gibbsrt.end(), gpure,
RT());
150 for (
size_t k = 0; k <
m_kk; k++) {
162 const vector<double>& _cpr =
cp_R_ref();
163 copy(_cpr.begin(), _cpr.end(), cpr);
169 for (
size_t k = 0; k <
m_kk; k++) {
179 copy(_h.begin(), _h.end(), hrt);
185 copy(gibbsrt.begin(), gibbsrt.end(), grt);
191 scale(gibbsrt.begin(), gibbsrt.end(), g,
RT());
197 copy(_s.begin(), _s.end(), er);
203 for (
size_t k = 0; k <
m_kk; k++) {
204 urt[k] = _h[k] - 1.0;
210 const vector<double>& _cpr =
cp_R_ref();
211 copy(_cpr.begin(), _cpr.end(), cprt);
217 for (
size_t k = 0; k <
m_kk; k++) {
231 m_expg0_RT.push_back(0.0);
249 for (
size_t k = 0; k <
m_kk; k++) {
250 double tmp = -grt[k] + mu_RT[k];
253 }
else if (tmp > 300.0) {
254 double tmp2 = tmp / 300.;
275 if (cached.
state1 != tnow) {
280 for (
size_t k = 0; k <
m_kk; k++) {
ThermoPhase object for the ideal gas equation of state - workhorse for Cantera (see Thermodynamic Pro...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
void getChemPotentials(double *mu) const override
Get the species chemical potentials. Units: J/kmol.
double m_p0
Reference state pressure.
double soundSpeed() const override
Return the speed of sound. Units: m/s.
double pressure() const override
Pressure.
vector< double > m_g0_RT
Temporary storage for dimensionless reference state Gibbs energies.
const vector< double > & cp_R_ref() const
Returns a reference to the dimensionless reference state Heat Capacity vector.
const vector< double > & gibbs_RT_ref() const
Returns a reference to the dimensionless reference state Gibbs free energy vector.
void getEntropy_R(double *sr) const override
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
vector< double > m_h0_RT
Temporary storage for dimensionless reference state enthalpies.
void getGibbs_ref(double *g) const override
Returns the vector of the Gibbs function of the reference state at the current temperature of the sol...
vector< double > m_pp
Temporary array containing internally calculated partial pressures.
void getStandardChemPotentials(double *mu) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
void getCp_R(double *cpr) const override
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
void setPressure(double p) override
Set the pressure at constant temperature and composition.
void getStandardVolumes_ref(double *vol) const override
Get the molar volumes of the species reference states at the current T and P_ref of the solution.
void getPartialMolarVolumes(double *vbar) const override
Return an array of partial molar volumes for the species in the mixture.
double cv_mole() const override
Molar heat capacity at constant volume.
virtual void updateThermo() const
Update the species reference state thermodynamic functions.
void getPureGibbs(double *gpure) const override
Get the Gibbs functions for the standard state of the species at the current T and P of the solution.
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...
void getEntropy_R_ref(double *er) const override
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
vector< double > m_s0_R
Temporary storage for dimensionless reference state entropies.
void getGibbs_RT(double *grt) const override
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
double entropy_mole() const override
Molar entropy.
const vector< double > & enthalpy_RT_ref() const
Returns a reference to the dimensionless reference state enthalpy vector.
void getCp_R_ref(double *cprt) const override
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
void getStandardVolumes(double *vol) const override
Get the molar volumes of the species standard states at the current T and P of the solution.
void getPartialMolarIntEnergies(double *ubar) const override
Return an array of partial molar internal energies for the species in the mixture.
double cp_mole() const override
Molar heat capacity at constant pressure.
void getIntEnergy_RT(double *urt) const override
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
void getPartialMolarCp(double *cpbar) const override
Return an array of partial molar heat capacities for the species in the mixture.
double standardConcentration(size_t k=0) const override
Returns the standard concentration , which is used to normalize the generalized concentration.
vector< double > m_cp0_R
Temporary storage for dimensionless reference state heat capacities.
const vector< double > & entropy_R_ref() const
Returns a reference to the dimensionless reference state Entropy vector.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
void setToEquilState(const double *mu_RT) override
This method is used by the ChemEquil equilibrium solver.
void getGibbs_RT_ref(double *grt) const override
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
void getActivityCoefficients(double *ac) const override
Get the array of non-dimensional activity coefficients at the current solution temperature,...
IdealGasPhase(const string &inputFile="", const string &id="")
Construct and initialize an IdealGasPhase ThermoPhase object directly from an input file.
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
void getEnthalpy_RT_ref(double *hrt) const override
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
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 molarDensity() const
Molar density (kmol/m^3).
virtual void setMoleFractions(const double *const x)
Set the mole fractions to the specified values.
ValueCache m_cache
Cached for saved calculations within each ThermoPhase.
size_t m_kk
Number of species in the phase.
double temperature() const
Temperature (K).
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
double sum_xlogx() const
Evaluate .
double moleFraction(size_t k) const
Return the mole fraction of a single species.
double mean_X(const double *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
double RT() const
Return the Gas Constant multiplied by the current temperature.
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
virtual double refPressure() const
Returns the reference pressure in Pa.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
CachedScalar getScalar(int id)
Get a reference to a CachedValue object representing a scalar (double) with the given id.
int getId()
Get a unique id for a cached value.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
const double GasConstant
Universal Gas Constant [J/kmol/K].
Namespace for the Cantera kernel.
const double SmallNumber
smallest number to compare to zero.
A cached property value and the state at which it was evaluated.
double state1
Value of the first state variable for the state at which value was evaluated, for example temperature...
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...