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
18namespace 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 */
28{
29public:
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
65protected:
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
85public:
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
124public:
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
142protected:
143 //! form of the generalized concentrations
144 /*!
145 * - 0 unity (default)
146 * - 1 1/V_k
147 * - 2 1/V_0
148 */
150
151 //! Temporary storage - length = m_kk.
153};
154}
155
156#endif
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
An ideal solution approximation of a phase.
virtual void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature,...
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
vector_fp m_pp
Temporary storage - length = m_kk.
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
int m_formGC
form of the generalized concentrations
virtual std::string type() const
String indicating the thermodynamic model implemented.
virtual Units standardConcentrationUnits() const
Returns the units of the "standard concentration" for this phase.
virtual bool isIdeal() const
Boolean indicating whether phase is ideal.
void setStandardConcentrationModel(const std::string &model)
Set the standard concentration model.
IdealSolnGasVPSS(const std::string &infile="", std::string id="")
Create an object from an input file.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
virtual doublereal standardConcentration(size_t k=0) const
Returns the standard concentration , which is used to normalize the generalized concentration.
A representation of the units associated with a dimensional quantity.
Definition: Units.h:30
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:103
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
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