Cantera  3.1.0b1
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 double cv_mole() const override;
58
59 //! @}
60 //! @name Mechanical Properties
61 //! @{
62
63 void setPressure(double p) override;
64
65protected:
66 void calcDensity() override;
67 //! @}
68
69public:
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
101public:
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
117protected:
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
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.
bool isIdeal() const override
Boolean indicating whether phase is ideal.
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
void getChemPotentials(double *mu) const override
Get the species chemical potentials. Units: J/kmol.
vector< double > m_pp
Temporary storage - length = m_kk.
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 getActivityConcentrations(double *c) const override
This method returns an array of generalized concentrations.
void setPressure(double p) override
Set the internally stored pressure (Pa) at constant temperature and composition.
void getPartialMolarVolumes(double *vbar) const override
Return an array of partial molar volumes for the species in the mixture.
double cv_mole() const override
Molar heat capacity at constant volume. Units: J/kmol/K.
void setStandardConcentrationModel(const string &model)
Set the standard concentration model.
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
void setToEquilState(const double *lambda_RT) override
This method is used by the ChemEquil equilibrium solver.
void getPartialMolarIntEnergies(double *ubar) const override
Return an array of partial molar internal energies for the species in the mixture.
double cp_mole() const override
Molar heat capacity at constant pressure. Units: J/kmol/K.
Units standardConcentrationUnits() const override
Returns the units of the "standard concentration" for this phase.
void getPartialMolarCp(double *cpbar) const override
Return an array of partial molar heat capacities for the species in the mixture.
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 getActivityCoefficients(double *ac) const override
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
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