Cantera  4.0.0a1
Loading...
Searching...
No Matches
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 string& infile="", string id="");
32
33 //! @name Utilities (IdealSolnGasVPSS)
34 //! @{
35
36 string type() const override {
37 return "ideal-solution-VPSS";
38 }
39
40 bool isIdeal() const override {
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 string& model);
49
50 //! @}
51 //! @name Molar Thermodynamic Properties
52 //! @{
53
54 double enthalpy_mole() const override;
55 double entropy_mole() const override;
56 double cp_mole() const override;
57
58 //! Molar heat capacity at constant volume.
59 //!
60 //! For an ideal solution with pressure-dependent standard state volumes, the
61 //! thermodynamic identity @f$ c_v = c_p - T v \beta^2 / \kappa_T @f$ is used, where
62 //! @f$ \beta @f$ and @f$ \kappa_T @f$ are the mixture thermal expansion coefficient
63 //! and isothermal compressibility, respectively.
64 //!
65 //! If all species have pressure-independent standard state volumes
66 //! (@f$ \kappa_T = 0 @f$), then @f$ c_v = c_p @f$.
67 double cv_mole() const override;
68
69 //! @}
70 //! @name Mechanical Properties
71 //! @{
72
73 void setPressure(double p) override;
74
75 //! Isothermal compressibility of the mixture.
76 /*!
77 * Computed as
78 * @f[
79 * \kappa_T = -\frac{1}{v}
80 * \sum_k X_k \left.\frac{\partial V^\circ_k}{\partial P}\right|_T
81 * @f]
82 * using the species standard state volume derivatives from each PDSS object. For
83 * phases where all species have pressure-independent standard state volumes,
84 * returns zero.
85 */
86 double isothermalCompressibility() const override;
87
88 //! Thermal expansion coefficient of the mixture.
89 /*!
90 * Computed as
91 * @f[
92 * \beta = \frac{1}{v}
93 * \sum_k X_k \left.\frac{\partial V^\circ_k}{\partial T}\right|_P
94 * @f]
95 * using the species standard state volume derivatives from each PDSS object.
96 */
97 double thermalExpansionCoeff() const override;
98
99protected:
100 void calcDensity() override;
101 //! @}
102
103public:
104 Units standardConcentrationUnits() const override;
105 void getActivityConcentrations(span<double> c) const override;
106
107 //! Returns the standard concentration @f$ C^0_k @f$, which is used to
108 //! normalize the generalized concentration.
109 /*!
110 * This is defined as the concentration by which the generalized
111 * concentration is normalized to produce the activity. In many cases, this
112 * quantity will be the same for all species in a phase.
113 *
114 * @param k Optional parameter indicating the species. The default
115 * is to assume this refers to species 0.
116 * @return
117 * Returns the standard Concentration in units of m3 kmol-1.
118 */
119 double standardConcentration(size_t k=0) const override;
120
121 void getActivityCoefficients(span<double> ac) const override;
122
123
124 //! @name Partial Molar Properties of the Solution
125 //! @{
126
127 void getChemPotentials(span<double> mu) const override;
128 void getPartialMolarEnthalpies(span<double> hbar) const override;
129 void getPartialMolarEntropies(span<double> sbar) const override;
130 void getPartialMolarIntEnergies(span<double> ubar) const override;
131 void getPartialMolarCp(span<double> cpbar) const override;
132 void getPartialMolarVolumes(span<double> vbar) const override;
133 //! @}
134
135public:
136 //! @name Initialization Methods - For Internal use
137 //!
138 //! The following methods are used in the process of constructing the phase
139 //! and setting its parameters from a specification in an input file. They
140 //! are not normally used in application programs. To see how they are used,
141 //! see importPhase().
142 //! @{
143
144 bool addSpecies(shared_ptr<Species> spec) override;
145 void initThermo() override;
146 void getParameters(AnyMap& phaseNode) const override;
147 void setToEquilState(span<const double> lambda_RT) override;
148
149 //! @}
150
151protected:
152 //! form of the generalized concentrations
153 /*!
154 * - 0 unity (default)
155 * - 1 1/V_k
156 * - 2 1/V_0
157 */
158 int m_formGC = 0;
159
160 //! Temporary storage - length = m_kk.
161 vector<double> m_pp;
162};
163}
164
165#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:431
An ideal solution approximation of a phase.
double enthalpy_mole() const override
Molar enthalpy. Units: J/kmol.
double thermalExpansionCoeff() const override
Thermal expansion coefficient of the mixture.
bool isIdeal() const override
Boolean indicating whether phase is ideal.
void getPartialMolarEnthalpies(span< double > hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
void getPartialMolarCp(span< double > cpbar) const override
Return an array of partial molar heat capacities for the species in the mixture.
vector< double > m_pp
Temporary storage - length = m_kk.
void getActivityCoefficients(span< double > ac) const override
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
void getParameters(AnyMap &phaseNode) const override
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
string type() const override
String indicating the thermodynamic model implemented.
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
void setPressure(double p) override
Set the internally stored pressure (Pa) at constant temperature and composition.
double cv_mole() const override
Molar heat capacity at constant volume.
void setStandardConcentrationModel(const string &model)
Set the standard concentration model.
double isothermalCompressibility() const override
Isothermal compressibility of the mixture.
double entropy_mole() const override
Molar entropy. Units: J/kmol/K.
void calcDensity() override
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
int m_formGC
form of the generalized concentrations
double cp_mole() const override
Molar heat capacity at constant pressure and composition [J/kmol/K].
void setToEquilState(span< const double > lambda_RT) override
This method is used by the ChemEquil equilibrium solver.
void getPartialMolarVolumes(span< double > vbar) const override
Return an array of partial molar volumes for the species in the mixture.
Units standardConcentrationUnits() const override
Returns the units of the "standard concentration" for this phase.
void getPartialMolarEntropies(span< double > sbar) const override
Returns an array of partial molar entropies of the species in the solution.
double standardConcentration(size_t k=0) const override
Returns the standard concentration , which is used to normalize the generalized concentration.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
void getChemPotentials(span< double > mu) const override
Get the species chemical potentials. Units: J/kmol.
void getActivityConcentrations(span< double > c) const override
This method returns an array of generalized concentrations.
void getPartialMolarIntEnergies(span< double > ubar) const override
Return an array of partial molar internal energies for the species in the mixture.
A representation of the units associated with a dimensional quantity.
Definition Units.h:35
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595