| Cantera 3.0.0

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
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 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 double cv_mole() const override;
58
59 //! @}
60 //! @name Mechanical Properties
61 //! @{
62
63 void setPressure(double p) override;
64
65 protected:
66 void calcDensity() override;
67 //! @}
68
69 public:
70 Units standardConcentrationUnits() const override;
71 void getActivityConcentrations(double* c) const override;
72
73 //! Returns the standard concentration @f$ C^0_k @f$, which is used to
74 //! normalize the generalized concentration.
75 /*!
76 * This is defined as the concentration by which the generalized
77 * concentration is normalized to produce the activity. In many cases, this
78 * quantity will be the same for all species in a phase.
79 *
80 * @param k Optional parameter indicating the species. The default
81 * is to assume this refers to species 0.
82 * @return
83 * Returns the standard Concentration in units of m3 kmol-1.
84 */
85 double standardConcentration(size_t k=0) const override;
86
87 void getActivityCoefficients(double* ac) const override;
88
89
90 //! @name Partial Molar Properties of the Solution
91 //! @{
92
93 void getChemPotentials(double* mu) const override;
94 void getPartialMolarEnthalpies(double* hbar) const override;
95 void getPartialMolarEntropies(double* sbar) const override;
96 void getPartialMolarIntEnergies(double* ubar) const override;
97 void getPartialMolarCp(double* cpbar) const override;
98 void getPartialMolarVolumes(double* vbar) const override;
99 //! @}
100
101 public:
102 //! @name Initialization Methods - For Internal use
103 //!
104 //! The following methods are used in the process of constructing the phase
105 //! and setting its parameters from a specification in an input file. They
106 //! are not normally used in application programs. To see how they are used,
107 //! see importPhase().
108 //! @{
109
110 bool addSpecies(shared_ptr<Species> spec) override;
111 void initThermo() override;
112 void getParameters(AnyMap& phaseNode) const override;
113 void setToEquilState(const double* lambda_RT) override;
114
115 //! @}
116
117 protected:
118 //! form of the generalized concentrations
119 /*!
120 * - 0 unity (default)
121 * - 1 1/V_k
122 * - 2 1/V_0
123 */
124 int m_formGC = 0;
125
126 //! Temporary storage - length = m_kk.
127 vector<double> m_pp;
128};
129}
130
131#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:427
Cantera::IdealSolnGasVPSS
An ideal solution approximation of a phase.
Definition IdealSolnGasVPSS.h:28
Cantera::IdealSolnGasVPSS::enthalpy_mole
double enthalpy_mole() const override
Molar enthalpy. Units: J/kmol.
Definition IdealSolnGasVPSS.cpp:44
Cantera::IdealSolnGasVPSS::isIdeal
bool isIdeal() const override
Boolean indicating whether phase is ideal.
Definition IdealSolnGasVPSS.h:40
Cantera::IdealSolnGasVPSS::getPartialMolarEnthalpies
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
Definition IdealSolnGasVPSS.cpp:144
Cantera::IdealSolnGasVPSS::getChemPotentials
void getChemPotentials(double *mu) const override
Get the species chemical potentials. Units: J/kmol.
Definition IdealSolnGasVPSS.cpp:135
Cantera::IdealSolnGasVPSS::m_pp
vector< double > m_pp
Temporary storage - length = m_kk.
Definition IdealSolnGasVPSS.h:127
Cantera::IdealSolnGasVPSS::getParameters
void getParameters(AnyMap &phaseNode) const override
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition IdealSolnGasVPSS.cpp:223
Cantera::IdealSolnGasVPSS::type
string type() const override
String indicating the thermodynamic model implemented.
Definition IdealSolnGasVPSS.h:36
Cantera::IdealSolnGasVPSS::initThermo
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
Definition IdealSolnGasVPSS.cpp:215
Cantera::IdealSolnGasVPSS::getActivityConcentrations
void getActivityConcentrations(double *c) const override
This method returns an array of generalized concentrations.
Definition IdealSolnGasVPSS.cpp:90
Cantera::IdealSolnGasVPSS::setPressure
void setPressure(double p) override
Set the internally stored pressure (Pa) at constant temperature and composition.
Definition IdealSolnGasVPSS.cpp:67
Cantera::IdealSolnGasVPSS::getPartialMolarVolumes
void getPartialMolarVolumes(double *vbar) const override
Return an array of partial molar volumes for the species in the mixture.
Definition IdealSolnGasVPSS.cpp:172
Cantera::IdealSolnGasVPSS::cv_mole
double cv_mole() const override
Molar heat capacity at constant volume. Units: J/kmol/K.
Definition IdealSolnGasVPSS.cpp:62
Cantera::IdealSolnGasVPSS::setStandardConcentrationModel
void setStandardConcentrationModel(const string &model)
Set the standard concentration model.
Definition IdealSolnGasVPSS.cpp:26
Cantera::IdealSolnGasVPSS::entropy_mole
double entropy_mole() const override
Molar entropy. Units: J/kmol/K.
Definition IdealSolnGasVPSS.cpp:50
Cantera::IdealSolnGasVPSS::calcDensity
void calcDensity() override
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
Definition IdealSolnGasVPSS.cpp:74
Cantera::IdealSolnGasVPSS::m_formGC
int m_formGC
form of the generalized concentrations
Definition IdealSolnGasVPSS.h:124
Cantera::IdealSolnGasVPSS::setToEquilState
void setToEquilState(const double *lambda_RT) override
This method is used by the ChemEquil equilibrium solver.
Definition IdealSolnGasVPSS.cpp:177
Cantera::IdealSolnGasVPSS::getPartialMolarIntEnergies
void getPartialMolarIntEnergies(double *ubar) const override
Return an array of partial molar internal energies for the species in the mixture.
Definition IdealSolnGasVPSS.cpp:160
Cantera::IdealSolnGasVPSS::cp_mole
double cp_mole() const override
Molar heat capacity at constant pressure. Units: J/kmol/K.
Definition IdealSolnGasVPSS.cpp:56
Cantera::IdealSolnGasVPSS::standardConcentrationUnits
Units standardConcentrationUnits() const override
Returns the units of the "standard concentration" for this phase.
Definition IdealSolnGasVPSS.cpp:81
Cantera::IdealSolnGasVPSS::getPartialMolarCp
void getPartialMolarCp(double *cpbar) const override
Return an array of partial molar heat capacities for the species in the mixture.
Definition IdealSolnGasVPSS.cpp:166
Cantera::IdealSolnGasVPSS::standardConcentration
double standardConcentration(size_t k=0) const override
Returns the standard concentration , which is used to normalize the generalized concentration.
Definition IdealSolnGasVPSS.cpp:112
Cantera::IdealSolnGasVPSS::addSpecies
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Definition IdealSolnGasVPSS.cpp:206
Cantera::IdealSolnGasVPSS::getActivityCoefficients
void getActivityCoefficients(double *ac) const override
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
Definition IdealSolnGasVPSS.cpp:126
Cantera::IdealSolnGasVPSS::getPartialMolarEntropies
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
Definition IdealSolnGasVPSS.cpp:150
Cantera::Units
A representation of the units associated with a dimensional quantity.
Definition Units.h:35
Cantera::VPStandardStateTP
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
Definition VPStandardStateTP.h:44
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564