Cantera  2.5.1
MaskellSolidSolnPhase.h
Go to the documentation of this file.
1 /**
2  * @file MaskellSolidSolnPhase.h Header file for a solid solution model
3  * following Maskell, Shaw, and Tye. Electrochimica Acta 1982
4  *
5  * This class inherits from the Cantera class ThermoPhase and implements a
6  * non-ideal solid solution model with incompressible thermodynamics.
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_MASKELLSOLIDSOLNPHASE_H
13 #define CT_MASKELLSOLIDSOLNPHASE_H
14 
15 #include "VPStandardStateTP.h"
16 
17 namespace Cantera
18 {
19 /**
20  * Class MaskellSolidSolnPhase represents a condensed phase non-ideal solution
21  * with 2 species following the thermodynamic model described in Maskell, Shaw,
22  * and Tye, Manganese Dioxide Electrode -- IX, Electrochimica Acta 28(2) pp
23  * 231-235, 1983.
24  *
25  * @ingroup thermoprops
26  */
28 {
29 public:
31 
32  virtual std::string type() const {
33  return "MaskellSolidsoln";
34  }
35 
36  virtual Units standardConcentrationUnits() const { return Units(1.0); }
37  virtual void getActivityConcentrations(doublereal* c) const;
38  virtual doublereal standardConcentration(size_t k=0) const { return 1.0; }
39  virtual doublereal logStandardConc(size_t k=0) const { return 0.0; }
40 
41  //! @name Molar Thermodynamic Properties of the Solution
42  //! @{
43 
44  virtual doublereal enthalpy_mole() const;
45  virtual doublereal entropy_mole() const;
46 
47  //@}
48  /** @name Mechanical Equation of State Properties
49  *
50  * In this equation of state implementation, the density is a function only
51  * of the mole fractions. Therefore, it can't be an independent variable.
52  * Instead, the pressure is used as the independent variable. Functions
53  * which try to set the thermodynamic state by calling setDensity() will
54  * cause an exception to be thrown.
55  */
56  //@{
57 
58  /**
59  * Pressure. Units: Pa.
60  * For this incompressible system, we return the internally stored
61  * independent value of the pressure.
62  */
63  virtual doublereal pressure() const {
64  return m_Pcurrent;
65  }
66 
67  /**
68  * Set the pressure at constant temperature. Units: Pa. This method sets a
69  * constant within the object. The mass density is not a function of
70  * pressure.
71  *
72  * @param p Input Pressure (Pa)
73  */
74  virtual void setPressure(doublereal p);
75 
76  /**
77  * Overridden setDensity() function is necessary because the density is not
78  * an independent variable.
79  *
80  * This function will now throw an error condition
81  *
82  * @param rho Input density
83  * @deprecated Functionality merged with base function after Cantera 2.5.
84  * (superseded by isCompressible check in Phase::setDensity)
85  */
86  virtual void setDensity(const doublereal rho);
87 
88  virtual void calcDensity();
89 
90  /**
91  * Overridden setMolarDensity() function is necessary because the density
92  * is not an independent variable.
93  *
94  * This function will now throw an error condition.
95  *
96  * @param rho Input Density
97  * @deprecated Functionality merged with base function after Cantera 2.5.
98  * (superseded by isCompressible check in Phase::setDensity)
99  */
100  virtual void setMolarDensity(const doublereal rho);
101 
102  //@}
103 
104  /**
105  * @name Chemical Potentials and Activities
106  * @{
107  */
108 
109  virtual void getActivityCoefficients(doublereal* ac) const;
110  virtual void getChemPotentials(doublereal* mu) const;
111  virtual void getChemPotentials_RT(doublereal* mu) const;
112 
113  //@}
114  /// @name Partial Molar Properties of the Solution
115  //@{
116 
117  virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
118  virtual void getPartialMolarEntropies(doublereal* sbar) const;
119  virtual void getPartialMolarCp(doublereal* cpbar) const;
120  virtual void getPartialMolarVolumes(doublereal* vbar) const;
121  virtual void getPureGibbs(doublereal* gpure) const;
122  virtual void getStandardChemPotentials(doublereal* mu) const;
123 
124  //@}
125  /// @name Utility Functions
126  //@{
127 
128  virtual void initThermo();
129  virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
130 
131  void set_h_mix(const doublereal hmix) { h_mixing = hmix; }
132 
133  //! Set the product Species. Must be called after species have been added.
134  void setProductSpecies(const std::string& name);
135  //@}
136 
137 private:
138  /**
139  * m_Pcurrent = The current pressure. Since the density isn't a function of
140  * pressure, but only of the mole fractions, we need to independently
141  * specify the pressure.
142  */
143  doublereal m_Pcurrent;
144 
145  //! Value of the enthalpy change on mixing due to protons changing from type
146  //! B to type A configurations.
147  doublereal h_mixing;
148 
149  //! Index of the species whose mole fraction defines the extent of reduction r
151  int reactant_species_index;
152 
153  // Functions to calculate some of the pieces of the mixing terms.
154  doublereal s() const;
155  doublereal fm(const doublereal r) const;
156  doublereal p(const doublereal r) const;
157 };
158 }
159 
160 #endif
Cantera::MaskellSolidSolnPhase::type
virtual std::string type() const
String indicating the thermodynamic model implemented.
Definition: MaskellSolidSolnPhase.h:32
Cantera::MaskellSolidSolnPhase::getStandardChemPotentials
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Definition: MaskellSolidSolnPhase.cpp:175
Cantera::MaskellSolidSolnPhase::getActivityCoefficients
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
Definition: MaskellSolidSolnPhase.cpp:106
Cantera::MaskellSolidSolnPhase::logStandardConc
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
Definition: MaskellSolidSolnPhase.h:39
Cantera::MaskellSolidSolnPhase::getPartialMolarEnthalpies
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
Definition: MaskellSolidSolnPhase.cpp:148
Cantera::Phase::name
std::string name() const
Return the name of the phase.
Definition: Phase.cpp:84
Cantera::MaskellSolidSolnPhase::getChemPotentials_RT
virtual void getChemPotentials_RT(doublereal *mu) const
Get the array of non-dimensional species chemical potentials.
Definition: MaskellSolidSolnPhase.cpp:138
Cantera::MaskellSolidSolnPhase::getPureGibbs
virtual void getPureGibbs(doublereal *gpure) const
Get the Gibbs functions for the standard state of the species at the current T and P of the solution.
Definition: MaskellSolidSolnPhase.cpp:168
Cantera::MaskellSolidSolnPhase::m_Pcurrent
doublereal m_Pcurrent
m_Pcurrent = The current pressure.
Definition: MaskellSolidSolnPhase.h:143
Cantera::MaskellSolidSolnPhase
Class MaskellSolidSolnPhase represents a condensed phase non-ideal solution with 2 species following ...
Definition: MaskellSolidSolnPhase.h:27
Cantera::MaskellSolidSolnPhase::entropy_mole
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
Definition: MaskellSolidSolnPhase.cpp:51
Cantera::MaskellSolidSolnPhase::enthalpy_mole
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
Definition: MaskellSolidSolnPhase.cpp:38
Cantera::MaskellSolidSolnPhase::standardConcentrationUnits
virtual Units standardConcentrationUnits() const
Returns the units of the "standard concentration" for this phase.
Definition: MaskellSolidSolnPhase.h:36
Cantera::MaskellSolidSolnPhase::getPartialMolarEntropies
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
Definition: MaskellSolidSolnPhase.cpp:153
Cantera::MaskellSolidSolnPhase::initThermo
virtual void initThermo()
Definition: MaskellSolidSolnPhase.cpp:184
Cantera::MaskellSolidSolnPhase::initThermoXML
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
Definition: MaskellSolidSolnPhase.cpp:196
Cantera::XML_Node
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:103
Cantera::MaskellSolidSolnPhase::setPressure
virtual void setPressure(doublereal p)
Set the pressure at constant temperature.
Definition: MaskellSolidSolnPhase.cpp:90
Cantera::MaskellSolidSolnPhase::standardConcentration
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
Definition: MaskellSolidSolnPhase.h:38
Cantera::MaskellSolidSolnPhase::setDensity
virtual void setDensity(const doublereal rho)
Overridden setDensity() function is necessary because the density is not an independent variable.
Definition: MaskellSolidSolnPhase.cpp:62
Cantera::MaskellSolidSolnPhase::pressure
virtual doublereal pressure() const
Pressure.
Definition: MaskellSolidSolnPhase.h:63
Cantera::MaskellSolidSolnPhase::setMolarDensity
virtual void setMolarDensity(const doublereal rho)
Overridden setMolarDensity() function is necessary because the density is not an independent variable...
Definition: MaskellSolidSolnPhase.cpp:95
Cantera::MaskellSolidSolnPhase::product_species_index
int product_species_index
Index of the species whose mole fraction defines the extent of reduction r.
Definition: MaskellSolidSolnPhase.h:150
VPStandardStateTP.h
Cantera::Units
A representation of the units associated with a dimensional quantity.
Definition: Units.h:29
Cantera::MaskellSolidSolnPhase::calcDensity
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
Definition: MaskellSolidSolnPhase.cpp:77
Cantera::MaskellSolidSolnPhase::getPartialMolarVolumes
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
Definition: MaskellSolidSolnPhase.cpp:163
Cantera::MaskellSolidSolnPhase::getChemPotentials
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
Definition: MaskellSolidSolnPhase.cpp:125
Cantera::MaskellSolidSolnPhase::h_mixing
doublereal h_mixing
Value of the enthalpy change on mixing due to protons changing from type B to type A configurations.
Definition: MaskellSolidSolnPhase.h:147
Cantera::MaskellSolidSolnPhase::setProductSpecies
void setProductSpecies(const std::string &name)
Set the product Species. Must be called after species have been added.
Definition: MaskellSolidSolnPhase.cpp:240
Cantera::MaskellSolidSolnPhase::getActivityConcentrations
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
Definition: MaskellSolidSolnPhase.cpp:28
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:263
Cantera::VPStandardStateTP
Definition: VPStandardStateTP.h:41
Cantera::MaskellSolidSolnPhase::getPartialMolarCp
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
Definition: MaskellSolidSolnPhase.cpp:158