| Cantera 3.0.0

Loading...
Searching...
No Matches
PDSS_IonsFromNeutral.h
Go to the documentation of this file.
1/**
2 * @file PDSS_IonsFromNeutral.h
3 * Declarations for the class PDSS_IonsFromNeutral (
4 * which handles calculations for a single ion in a fluid, whose properties
5 * are calculated from another neutral molecule.
6 * (see @ref pdssthermo and class @link Cantera::PDSS_IonsFromNeutral PDSS_IonsFromNeutral@endlink).
7 */
8
9// This file is part of Cantera. See License.txt in the top-level directory or
10// at https://cantera.org/license.txt for license and copyright information.
11
12#ifndef CT_PDSS_IONSFROMNEUTRAL_H
13#define CT_PDSS_IONSFROMNEUTRAL_H
14
15#include "PDSS.h"
16
17 namespace Cantera
18{
19 class ThermoPhase;
20
21//! Derived class for pressure dependent standard states of an ideal gas species
22/*!
23 * @attention This class currently does not have any test cases or examples. Its
24 * implementation may be incomplete, and future changes to %Cantera may
25 * unexpectedly cause this class to stop working. If you use this class,
26 * please consider contributing examples or test cases. In the absence of
27 * new tests or examples, this class may be deprecated and removed in a
28 * future version of %Cantera. See
29 * https://github.com/Cantera/cantera/issues/267 for additional information.
30 *
31 * This class is for a single Ideal Gas species.
32 *
33 * @deprecated To be removed after %Cantera 3.0
34 *
35 * @ingroup pdssthermo
36 */
37 class PDSS_IonsFromNeutral : public PDSS_Nondimensional
38{
39 public:
40 //! Default constructor
41 PDSS_IonsFromNeutral();
42
43 //! @name Molar Thermodynamic Properties of the Species Standard State
44 //! @{
45
46 // See PDSS.h for documentation of functions overridden from Class PDSS
47
48 double enthalpy_RT() const override;
49 double intEnergy_mole() const override;
50 double entropy_R() const override;
51
52 /**
53 * @copydoc PDSS::gibbs_RT()
54 *
55 * @f[
56 * \frac{\mu^o_k}{RT} = \sum_{m}{ \alpha_{m , k} \frac{\mu^o_{m}}{RT}} + ( 1 - \delta_{k,sp}) 2.0 \ln{2.0}
57 * @f]
58 *
59 * *m* is the neutral molecule species index. @f$ \alpha_{m , k} @f$ is the
60 * stoichiometric coefficient for the neutral molecule, *m*, that creates the
61 * thermodynamics for the ionic species *k*. A factor @f$ 2.0 \ln{2.0} @f$
62 * is added to all ions except for the species ionic species, which in this
63 * case is the single anion species, with species index *sp*.
64 */
65 double gibbs_RT() const override;
66 double cp_R() const override;
67 double molarVolume() const override;
68 double density() const override;
69
70 //! @}
71 //! @name Properties of the Reference State of the Species in the Solution
72 //! @{
73
74 double gibbs_RT_ref() const override;
75 double enthalpy_RT_ref() const override;
76 double entropy_R_ref() const override;
77 double cp_R_ref() const override;
78 double molarVolume_ref() const override;
79
80 //! @}
81 //! @name Mechanical Equation of State Properties
82 //! @{
83
84 void setState_TP(double temp, double pres) override;
85
86 //! @}
87 //! @name Initialization of the Object
88 //! @{
89
90 void setParent(VPStandardStateTP* phase, size_t k) override;
91
92 void setNeutralSpeciesMultiplier(const string& species, double mult);
93 void setSpecialSpecies(bool special=true);
94 void getParameters(AnyMap& eosNode) const override;
95 void initThermo() override;
96 //! @}
97
98 protected:
99 //! Pointer to the Neutral Molecule ThermoPhase object
100 shared_ptr<ThermoPhase> neutralMoleculePhase_;
101
102 map<string, double> neutralSpeciesMultipliers_;
103
104 //! Number of neutral molecule species that make up the stoichiometric
105 //! vector for this species, in terms of calculating thermodynamic functions
106 size_t numMult_ = 0;
107
108 //! Vector of species indices in the neutral molecule ThermoPhase
109 vector<size_t> idNeutralMoleculeVec;
110
111 //! Stoichiometric coefficient for this species using the Neutral Molecule
112 //! Species in the vector idNeutralMoleculeVec
113 vector<double> factorVec;
114
115 //! Add 2RTln2 to the entropy and Gibbs free energies for this species
116 /*!
117 * This is true if this species is not the special species
118 */
119 bool add2RTln2_ = true;
120
121 //! Vector of length equal to the number of species in the neutral molecule phase
122 mutable vector<double> tmpNM;
123};
124}
125
126#endif
PDSS.h
Declarations for the virtual base class PDSS (pressure dependent standard state) which handles calcul...
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
Cantera::PDSS_IonsFromNeutral
Derived class for pressure dependent standard states of an ideal gas species.
Definition PDSS_IonsFromNeutral.h:38
Cantera::PDSS_IonsFromNeutral::molarVolume
double molarVolume() const override
Return the molar volume at standard state.
Definition PDSS_IonsFromNeutral.cpp:127
Cantera::PDSS_IonsFromNeutral::setParent
void setParent(VPStandardStateTP *phase, size_t k) override
Set the parent VPStandardStateTP object of this PDSS object.
Definition PDSS_IonsFromNeutral.cpp:23
Cantera::PDSS_IonsFromNeutral::PDSS_IonsFromNeutral
PDSS_IonsFromNeutral()
Default constructor.
Definition PDSS_IonsFromNeutral.cpp:18
Cantera::PDSS_IonsFromNeutral::gibbs_RT_ref
double gibbs_RT_ref() const override
Return the molar Gibbs free energy divided by RT at reference pressure.
Definition PDSS_IonsFromNeutral.cpp:143
Cantera::PDSS_IonsFromNeutral::numMult_
size_t numMult_
Number of neutral molecule species that make up the stoichiometric vector for this species,...
Definition PDSS_IonsFromNeutral.h:106
Cantera::PDSS_IonsFromNeutral::cp_R
double cp_R() const override
Return the molar const pressure heat capacity divided by RT.
Definition PDSS_IonsFromNeutral.cpp:116
Cantera::PDSS_IonsFromNeutral::initThermo
void initThermo() override
Initialization routine.
Definition PDSS_IonsFromNeutral.cpp:50
Cantera::PDSS_IonsFromNeutral::tmpNM
vector< double > tmpNM
Vector of length equal to the number of species in the neutral molecule phase.
Definition PDSS_IonsFromNeutral.h:122
Cantera::PDSS_IonsFromNeutral::idNeutralMoleculeVec
vector< size_t > idNeutralMoleculeVec
Vector of species indices in the neutral molecule ThermoPhase.
Definition PDSS_IonsFromNeutral.h:109
Cantera::PDSS_IonsFromNeutral::entropy_R_ref
double entropy_R_ref() const override
Return the molar entropy divided by R at reference pressure.
Definition PDSS_IonsFromNeutral.cpp:168
Cantera::PDSS_IonsFromNeutral::enthalpy_RT_ref
double enthalpy_RT_ref() const override
Return the molar enthalpy divided by RT at reference pressure.
Definition PDSS_IonsFromNeutral.cpp:157
Cantera::PDSS_IonsFromNeutral::getParameters
void getParameters(AnyMap &eosNode) const override
Store the parameters needed to reconstruct a copy of this PDSS object.
Definition PDSS_IonsFromNeutral.cpp:38
Cantera::PDSS_IonsFromNeutral::intEnergy_mole
double intEnergy_mole() const override
Return the molar internal Energy in units of J kmol-1.
Definition PDSS_IonsFromNeutral.cpp:83
Cantera::PDSS_IonsFromNeutral::neutralMoleculePhase_
shared_ptr< ThermoPhase > neutralMoleculePhase_
Pointer to the Neutral Molecule ThermoPhase object.
Definition PDSS_IonsFromNeutral.h:100
Cantera::PDSS_IonsFromNeutral::setState_TP
void setState_TP(double temp, double pres) override
Set the internal temperature and pressure.
Definition PDSS_IonsFromNeutral.cpp:204
Cantera::PDSS_IonsFromNeutral::entropy_R
double entropy_R() const override
Return the standard state entropy divided by RT.
Definition PDSS_IonsFromNeutral.cpp:88
Cantera::PDSS_IonsFromNeutral::enthalpy_RT
double enthalpy_RT() const override
Return the standard state molar enthalpy divided by RT.
Definition PDSS_IonsFromNeutral.cpp:72
Cantera::PDSS_IonsFromNeutral::density
double density() const override
Return the standard state density at standard state.
Definition PDSS_IonsFromNeutral.cpp:138
Cantera::PDSS_IonsFromNeutral::add2RTln2_
bool add2RTln2_
Add 2RTln2 to the entropy and Gibbs free energies for this species.
Definition PDSS_IonsFromNeutral.h:119
Cantera::PDSS_IonsFromNeutral::molarVolume_ref
double molarVolume_ref() const override
Return the molar volume at reference pressure.
Definition PDSS_IonsFromNeutral.cpp:193
Cantera::PDSS_IonsFromNeutral::gibbs_RT
double gibbs_RT() const override
Return the molar Gibbs free energy divided by RT.
Definition PDSS_IonsFromNeutral.cpp:102
Cantera::PDSS_IonsFromNeutral::factorVec
vector< double > factorVec
Stoichiometric coefficient for this species using the Neutral Molecule Species in the vector idNeutra...
Definition PDSS_IonsFromNeutral.h:113
Cantera::PDSS_IonsFromNeutral::cp_R_ref
double cp_R_ref() const override
Return the molar heat capacity divided by R at reference pressure.
Definition PDSS_IonsFromNeutral.cpp:182
Cantera::PDSS_Nondimensional
Base class for PDSS classes which compute nondimensional properties directly.
Definition PDSS.h:487
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