Cantera 2.6.0
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
17namespace Cantera
18{
19class 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 * @ingroup pdssthermo
34 */
36{
37public:
38 //! Default constructor
40
41 //! @name Molar Thermodynamic Properties of the Species Standard State in the Solution
42 //! @{
43
44 // See PDSS.h for documentation of functions overridden from Class PDSS
45
46 virtual doublereal enthalpy_RT() const;
47 virtual doublereal intEnergy_mole() const;
48 virtual doublereal entropy_R() const;
49
50 /*!
51 * @copydoc PDSS::gibbs_RT()
52 *
53 * \f[
54 * \frac{\mu^o_k}{RT} = \sum_{m}{ \alpha_{m , k} \frac{\mu^o_{m}}{RT}} + ( 1 - \delta_{k,sp}) 2.0 \ln{2.0}
55 * \f]
56 *
57 * *m* is the neutral molecule species index. \f$ \alpha_{m , k} \f$ is the
58 * stoiciometric coefficient for the neutral molecule, *m*, that creates the
59 * thermodynamics for the ionic species *k*. A factor \f$ 2.0 \ln{2.0} \f$
60 * is added to all ions except for the species ionic species, which in this
61 * case is the single anion species, with species index *sp*.
62 */
63 virtual doublereal gibbs_RT() const;
64 virtual doublereal cp_R() const;
65 virtual doublereal molarVolume() const;
66 virtual doublereal density() const;
67
68 //! @}
69 //! @name Properties of the Reference State of the Species in the Solution
70 //! @{
71
72 virtual doublereal gibbs_RT_ref() const;
73 virtual doublereal enthalpy_RT_ref() const;
74 virtual doublereal entropy_R_ref() const;
75 virtual doublereal cp_R_ref() const;
76 virtual doublereal molarVolume_ref() const;
77
78 //! @}
79 //! @name Mechanical Equation of State Properties
80 //! @{
81
82 virtual void setState_TP(doublereal temp, doublereal pres);
83
84 //! @}
85 //! @name Initialization of the Object
86 //! @{
87
88 void setParent(VPStandardStateTP* phase, size_t k);
89
90 void setNeutralSpeciesMultiplier(const std::string& species, double mult);
91 void setSpecialSpecies(bool special=true);
92 void setParametersFromXML(const XML_Node& speciesNode);
93 virtual void getParameters(AnyMap& eosNode) const;
94 virtual void initThermo();
95 //! @}
96
97protected:
98 //! Pointer to the Neutral Molecule ThermoPhase object
99 shared_ptr<ThermoPhase> neutralMoleculePhase_;
100
101 std::map<std::string, double> neutralSpeciesMultipliers_;
102
103 //! Number of neutral molecule species that make up the stoichiometric
104 //! vector for this species, in terms of calculating thermodynamic functions
105 size_t numMult_;
106
107 //! Vector of species indices in the neutral molecule ThermoPhase
108 std::vector<size_t> idNeutralMoleculeVec;
109
110 //! Stoichiometric coefficient for this species using the Neutral Molecule
111 //! Species in the vector idNeutralMoleculeVec
113
114 //! Add 2RTln2 to the entropy and Gibbs free energies for this species
115 /*!
116 * This is true if this species is not the special species
117 */
119
120 //! Vector of length equal to the number of species in the neutral molecule phase
122};
123}
124
125#endif
Declarations for the virtual base class PDSS (pressure dependent standard state) which handles calcul...
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
Derived class for pressure dependent standard states of an ideal gas species.
std::vector< size_t > idNeutralMoleculeVec
Vector of species indices in the neutral molecule ThermoPhase.
virtual void getParameters(AnyMap &eosNode) const
Store the parameters needed to reconstruct a copy of this PDSS object.
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
virtual doublereal entropy_R() const
Return the standard state entropy divided by RT.
PDSS_IonsFromNeutral()
Default constructor.
vector_fp factorVec
Stoichiometric coefficient for this species using the Neutral Molecule Species in the vector idNeutra...
size_t numMult_
Number of neutral molecule species that make up the stoichiometric vector for this species,...
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
virtual doublereal enthalpy_RT() const
Return the standard state molar enthalpy divided by RT.
virtual doublereal gibbs_RT() const
Return the molar Gibbs free energy divided by RT.
virtual doublereal cp_R() const
Return the molar const pressure heat capacity divided by RT.
virtual doublereal molarVolume_ref() const
Return the molar volume at reference pressure.
virtual void initThermo()
Initialization routine.
shared_ptr< ThermoPhase > neutralMoleculePhase_
Pointer to the Neutral Molecule ThermoPhase object.
virtual doublereal molarVolume() const
Return the molar volume at standard state.
void setParametersFromXML(const XML_Node &speciesNode)
Initialization routine for the PDSS object based on the speciesNode.
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
void setParent(VPStandardStateTP *phase, size_t k)
Set the parent VPStandardStateTP object of this PDSS object.
virtual doublereal density() const
Return the standard state density at standard state.
vector_fp tmpNM
Vector of length equal to the number of species in the neutral molecule phase.
virtual doublereal entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
virtual doublereal gibbs_RT_ref() const
Return the molar Gibbs free energy divided by RT at reference pressure.
bool add2RTln2_
Add 2RTln2 to the entropy and Gibbs free energies for this species.
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
Base class for PDSS classes which compute nondimensional properties directly.
Definition: PDSS.h:493
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