Cantera 2.6.0

IdealSolnGasVPSS.h
Go to the documentation of this file.
1/**
2 * @file IdealSolnGasVPSS.h
3 * Definition file for a derived class of ThermoPhase that assumes
4 * an ideal solution approximation and handles
5 * variable pressure standard state methods for calculating
6 * thermodynamic properties (see \ref thermoprops and
7 * class \link Cantera::IdealSolnGasVPSS IdealSolnGasVPSS\endlink).
8 */
9
10// This file is part of Cantera. See License.txt in the top-level directory or
11// at https://cantera.org/license.txt for license and copyright information.
12
13#ifndef CT_IDEALSOLNGASVPSS_H
14#define CT_IDEALSOLNGASVPSS_H
15
16#include "VPStandardStateTP.h"
17
18 namespace Cantera
19{
20
21/**
22 * @ingroup thermoprops
23 *
24 * An ideal solution approximation of a phase. Uses variable
25 * pressure standard state methods for calculating thermodynamic properties.
26 */
27 class IdealSolnGasVPSS : public VPStandardStateTP
28{
29 public:
30 /// Create an object from an input file
31 explicit IdealSolnGasVPSS(const std::string& infile="", std::string id="");
32
33 //! @name Utilities (IdealSolnGasVPSS)
34 //! @{
35
36 virtual std::string type() const {
37 return "ideal-solution-VPSS";
38 }
39
40 virtual bool isIdeal() const {
41 return true;
42 }
43
44 //! Set the standard concentration model
45 /*
46 * Must be one of 'unity', 'species-molar-volume', or 'solvent-molar-volume'.
47 */
48 void setStandardConcentrationModel(const std::string& model);
49
50 //! @}
51 //! @name Molar Thermodynamic Properties
52 //! @{
53
54 virtual doublereal enthalpy_mole() const;
55 virtual doublereal entropy_mole() const;
56 virtual doublereal cp_mole() const;
57 virtual doublereal cv_mole() const;
58
59 //! @}
60 //! @name Mechanical Properties
61 //! @{
62
63 void setPressure(doublereal p);
64
65 protected:
66 /**
67 * Calculate the density of the mixture using the partial molar volumes and
68 * mole fractions as input. The formula for this is
69 *
70 * \f[
71 * \rho = \frac{\sum_k{X_k W_k}}{\sum_k{X_k V_k}}
72 * \f]
73 *
74 * where \f$X_k\f$ are the mole fractions, \f$W_k\f$ are the molecular
75 * weights, and \f$V_k\f$ are the pure species molar volumes.
76 *
77 * Note, the basis behind this formula is that in an ideal solution the
78 * partial molar volumes are equal to the species standard state molar
79 * volumes. The species molar volumes may be functions of temperature and
80 * pressure.
81 */
82 virtual void calcDensity();
83 //! @}
84
85 public:
86 virtual Units standardConcentrationUnits() const;
87 virtual void getActivityConcentrations(doublereal* c) const;
88
89 //! Returns the standard concentration \f$ C^0_k \f$, which is used to
90 //! normalize the generalized concentration.
91 /*!
92 * This is defined as the concentration by which the generalized
93 * concentration is normalized to produce the activity. In many cases, this
94 * quantity will be the same for all species in a phase.
95 *
96 * @param k Optional parameter indicating the species. The default
97 * is to assume this refers to species 0.
98 * @return
99 * Returns the standard Concentration in units of m3 kmol-1.
100 */
101 virtual doublereal standardConcentration(size_t k=0) const;
102
103 //! Get the array of non-dimensional activity coefficients at the current
104 //! solution temperature, pressure, and solution concentration.
105 /*!
106 * For ideal gases, the activity coefficients are all equal to one.
107 *
108 * @param ac Output vector of activity coefficients. Length: m_kk.
109 */
110 virtual void getActivityCoefficients(doublereal* ac) const;
111
112
113 //! @name Partial Molar Properties of the Solution
114 //! @{
115
116 virtual void getChemPotentials(doublereal* mu) const;
117 virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
118 virtual void getPartialMolarEntropies(doublereal* sbar) const;
119 virtual void getPartialMolarIntEnergies(doublereal* ubar) const;
120 virtual void getPartialMolarCp(doublereal* cpbar) const;
121 virtual void getPartialMolarVolumes(doublereal* vbar) const;
122 //! @}
123
124 public:
125 //! @name Initialization Methods - For Internal use
126 /*!
127 * The following methods are used in the process of constructing the phase
128 * and setting its parameters from a specification in an input file. They
129 * are not normally used in application programs. To see how they are used,
130 * see importPhase().
131 */
132 //! @{
133
134 virtual bool addSpecies(shared_ptr<Species> spec);
135 virtual void initThermo();
136 virtual void getParameters(AnyMap& phaseNode) const;
137 virtual void setToEquilState(const doublereal* lambda_RT);
138 virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
139
140 //! @}
141
142 protected:
143 //! form of the generalized concentrations
144 /*!
145 * - 0 unity (default)
146 * - 1 1/V_k
147 * - 2 1/V_0
148 */
149 int m_formGC;
150
151 //! Temporary storage - length = m_kk.
152 vector_fp m_pp;
153};
154}
155
156#endif
VPStandardStateTP.h
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
Cantera::IdealSolnGasVPSS
An ideal solution approximation of a phase.
Definition: IdealSolnGasVPSS.h:28
Cantera::IdealSolnGasVPSS::setToEquilState
virtual void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
Definition: IdealSolnGasVPSS.cpp:184
Cantera::IdealSolnGasVPSS::addSpecies
virtual bool addSpecies(shared_ptr< Species > spec)
Definition: IdealSolnGasVPSS.cpp:212
Cantera::IdealSolnGasVPSS::getParameters
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition: IdealSolnGasVPSS.cpp:229
Cantera::IdealSolnGasVPSS::getActivityCoefficients
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature,...
Definition: IdealSolnGasVPSS.cpp:133
Cantera::IdealSolnGasVPSS::getPartialMolarIntEnergies
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
Definition: IdealSolnGasVPSS.cpp:167
Cantera::IdealSolnGasVPSS::cp_mole
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
Definition: IdealSolnGasVPSS.cpp:60
Cantera::IdealSolnGasVPSS::getPartialMolarEnthalpies
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
Definition: IdealSolnGasVPSS.cpp:151
Cantera::IdealSolnGasVPSS::getPartialMolarEntropies
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
Definition: IdealSolnGasVPSS.cpp:157
Cantera::IdealSolnGasVPSS::initThermoXML
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
Definition: IdealSolnGasVPSS.cpp:240
Cantera::IdealSolnGasVPSS::enthalpy_mole
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
Definition: IdealSolnGasVPSS.cpp:48
Cantera::IdealSolnGasVPSS::getPartialMolarVolumes
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
Definition: IdealSolnGasVPSS.cpp:179
Cantera::IdealSolnGasVPSS::m_pp
vector_fp m_pp
Temporary storage - length = m_kk.
Definition: IdealSolnGasVPSS.h:152
Cantera::IdealSolnGasVPSS::cv_mole
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
Definition: IdealSolnGasVPSS.cpp:66
Cantera::IdealSolnGasVPSS::getActivityConcentrations
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
Definition: IdealSolnGasVPSS.cpp:97
Cantera::IdealSolnGasVPSS::getPartialMolarCp
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
Definition: IdealSolnGasVPSS.cpp:173
Cantera::IdealSolnGasVPSS::setPressure
void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
Definition: IdealSolnGasVPSS.cpp:71
Cantera::IdealSolnGasVPSS::entropy_mole
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
Definition: IdealSolnGasVPSS.cpp:54
Cantera::IdealSolnGasVPSS::initThermo
virtual void initThermo()
Definition: IdealSolnGasVPSS.cpp:221
Cantera::IdealSolnGasVPSS::m_formGC
int m_formGC
form of the generalized concentrations
Definition: IdealSolnGasVPSS.h:149
Cantera::IdealSolnGasVPSS::type
virtual std::string type() const
String indicating the thermodynamic model implemented.
Definition: IdealSolnGasVPSS.h:36
Cantera::IdealSolnGasVPSS::standardConcentrationUnits
virtual Units standardConcentrationUnits() const
Returns the units of the "standard concentration" for this phase.
Definition: IdealSolnGasVPSS.cpp:88
Cantera::IdealSolnGasVPSS::isIdeal
virtual bool isIdeal() const
Boolean indicating whether phase is ideal.
Definition: IdealSolnGasVPSS.h:40
Cantera::IdealSolnGasVPSS::setStandardConcentrationModel
void setStandardConcentrationModel(const std::string &model)
Set the standard concentration model.
Definition: IdealSolnGasVPSS.cpp:30
Cantera::IdealSolnGasVPSS::IdealSolnGasVPSS
IdealSolnGasVPSS(const std::string &infile="", std::string id="")
Create an object from an input file.
Definition: IdealSolnGasVPSS.cpp:24
Cantera::IdealSolnGasVPSS::getChemPotentials
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
Definition: IdealSolnGasVPSS.cpp:142
Cantera::IdealSolnGasVPSS::calcDensity
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
Definition: IdealSolnGasVPSS.cpp:78
Cantera::IdealSolnGasVPSS::standardConcentration
virtual doublereal standardConcentration(size_t k=0) const
Returns the standard concentration , which is used to normalize the generalized concentration.
Definition: IdealSolnGasVPSS.cpp:119
Cantera::Units
A representation of the units associated with a dimensional quantity.
Definition: Units.h:30
Cantera::VPStandardStateTP
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
Definition: VPStandardStateTP.h:44
Cantera::XML_Node
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:103
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::vector_fp
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:184