20 SingleSpeciesTP::SingleSpeciesTP() :
128 doublereal V = molecW/
density();
131 cvbar -= alpha * alpha * V * T / beta;
263 const std::string& x)
284 const std::string& y)
293 err(
"setStatePX -> x[0] not 1.0");
301 err(
"setStatePY -> x[0] not 1.0");
311 for (
int n = 0; n < 50; n++) {
315 }
else if (dt < -100.0) {
319 if (fabs(dt) < tol) {
335 for (
int n = 0; n < 50; n++) {
339 }
else if (dt < -100.0) {
343 if (fabs(dt) < tol) {
348 "no convergence. dt = " +
fp2str(dt)+
"\n"
357 for (
int n = 0; n < 50; n++) {
361 }
else if (dt < -100.0) {
365 if (fabs(dt) < tol) {
381 for (
int n = 0; n < 50; n++) {
385 }
else if (dt < -100.0) {
389 if (fabs(dt) < tol) {
398 throw CanteraError(
"SingleSpeciesTP",
"Base class method "
399 +msg+
" called. Equation of state type: "
411 "stoichiometric substances may only contain one species.");
std::map< std::string, doublereal > compositionMap
Map connecting a string name with a double.
doublereal molecularWeight(size_t k) const
Molecular weight of species k.
virtual doublereal density() const
Density (kg/m^3).
std::string int2str(const int n, const std::string &fmt)
Convert an int to a string using a format converter.
doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
const doublereal OneAtm
One atmosphere [Pa].
ThermoPhase * duplMyselfAsThermoPhase() const
Duplication function.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
virtual void setState_HP(doublereal h, doublereal p, doublereal tol=1.e-8)
Set the internally stored specific enthalpy (J/kg) and pressure (Pa) of the phase.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
ThermoPhase & operator=(const ThermoPhase &right)
Assignment operator.
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
doublereal err(const std::string &msg) const
Error return for unhandled cases.
virtual void setState_UV(doublereal u, doublereal v, doublereal tol=1.e-8)
Set the specific internal energy (J/kg) and specific volume (m^3/kg).
virtual void getEntropy_R_ref(doublereal *er) const
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
void setState_TPY(doublereal t, doublereal p, const doublereal *y)
Set the internally stored temperature (K), pressure (Pa), and mass fractions of the phase...
void getPartialMolarCp(doublereal *cpbar) const
Get the species partial molar Heat Capacities. Units: J/ kmol /K.
void _updateThermo() const
vector_fp m_s0_R
Dimensionless entropy at the (mtlast, m_p0)
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
doublereal intEnergy_mass() const
Specific internal energy.
Base class for a phase with thermodynamic properties.
void setState_PY(doublereal p, doublereal *y)
Set the internally stored pressure (Pa) and mass fractions.
void getChemPotentials_RT(doublereal *murt) const
Get the array of non-dimensional species chemical potentials These are partial molar Gibbs free energ...
void getPartialMolarEnthalpies(doublereal *hbar) const
Get the species partial molar enthalpies. Units: J/kmol.
virtual void getGibbs_RT_ref(doublereal *grt) const
virtual void getCp_R_ref(doublereal *cprt) const
void getPartialMolarEntropies(doublereal *sbar) const
Get the species partial molar entropy. Units: J/kmol K.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
doublereal entropy_mass() const
Specific entropy.
virtual int eosType() const
Returns the equation of state type flag.
doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
void getChemPotentials(doublereal *mu) const
Get the array of chemical potentials.
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
SingleSpeciesTP & operator=(const SingleSpeciesTP &right)
Assignment operator.
doublereal cp_mass() const
Specific heat at constant pressure.
void getElectrochemPotentials(doublereal *mu) const
Get the species electrochemical potentials. Units: J/kmol.
doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
Base class for exceptions thrown by Cantera classes.
vector_fp m_h0_RT
Dimensionless enthalpy at the (mtlast, m_p0)
doublereal cv_mass() const
Specific heat at constant volume.
Header for the SingleSpeciesTP class, which is a filter class for ThermoPhase, that eases the constru...
virtual void setMoleFractions(const doublereal *const x)
Set the mole fractions to the specified values There is no restriction on the sum of the mole fractio...
vector_fp m_cp0_R
Dimensionless heat capacity at the (mtlast, m_p0)
virtual void getGibbs_ref(doublereal *g) const
virtual void initThermo()
void getStandardVolumes(doublereal *vbar) const
Get the molar volumes of each species in their standard states at the current T and P of the solution...
virtual void setState_TP(doublereal t, doublereal p)
Set the temperature (K) and pressure (Pa)
size_t nSpecies() const
Returns the number of species in the phase.
virtual void setState_SP(doublereal s, doublereal p, doublereal tol=1.e-8)
Set the specific entropy (J/kg/K) and pressure (Pa).
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
doublereal temperature() const
Temperature (K).
doublereal intEnergy_mole() const
Molar internal energy. Units: J/kmol.
virtual void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
virtual void setState_SV(doublereal s, doublereal v, doublereal tol=1.e-8)
Set the specific entropy (J/kg/K) and specific volume (m^3/kg).
virtual void setTemperature(const doublereal temp)
Set the internally stored temperature of the phase (K).
doublereal enthalpy_mass() const
Specific enthalpy.
void setState_TPX(doublereal t, doublereal p, const doublereal *x)
Set the temperature (K), pressure (Pa), and mole fractions.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Contains declarations for string manipulation functions within Cantera.
#define DATA_PTR(vec)
Creates a pointer to the start of the raw data for a vector.
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Get the species partial molar internal energies. Units: J/kmol.
doublereal m_press
The current pressure of the solution (Pa)
doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
doublereal m_tlast
Last temperature used to evaluate the thermodynamic polynomial.
void getPartialMolarVolumes(doublereal *vbar) const
Get the species partial molar volumes. Units: m^3/kmol.
void getPureGibbs(doublereal *gpure) const
Get the dimensional Gibbs functions for the standard state of the species at the current T and P...
SingleSpeciesTP()
Base empty constructor.
virtual void update(doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const =0
Compute the reference-state properties for all species.
SpeciesThermo * m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
void setState_PX(doublereal p, doublereal *x)
Set the pressure (Pa) and mole fractions.
The SingleSpeciesTP class is a filter class for ThermoPhase.
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
virtual void setDensity(const doublereal density_)
Set the internally stored density (kg/m^3) of the phase Note the density of a phase is an independent...