| Cantera 3.0.0

Loading...
Searching...
No Matches
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 *
27 * @deprecated To be removed after %Cantera 3.0. This class has numerous thermodynamic
28 * inconsistencies. See https://github.com/Cantera/cantera/issues/1321.
29 */
30 class MaskellSolidSolnPhase : public VPStandardStateTP
31{
32 public:
33 MaskellSolidSolnPhase();
34
35 string type() const override {
36 return "MaskellSolidsoln";
37 }
38
39 Units standardConcentrationUnits() const override { return Units(1.0); }
40 void getActivityConcentrations(double* c) const override;
41 double standardConcentration(size_t k=0) const override { return 1.0; }
42 double logStandardConc(size_t k=0) const override { return 0.0; }
43
44 //! @name Molar Thermodynamic Properties of the Solution
45 //! @{
46
47 double enthalpy_mole() const override;
48 double entropy_mole() const override;
49
50 //! @}
51 //! @name Mechanical Equation of State Properties
52 //!
53 //! In this equation of state implementation, the density is a function only
54 //! of the mole fractions. Therefore, it can't be an independent variable.
55 //! Instead, the pressure is used as the independent variable. Functions
56 //! which try to set the thermodynamic state by calling setDensity() will
57 //! cause an exception to be thrown.
58 //! @{
59
60 /**
61 * Pressure. Units: Pa.
62 * For this incompressible system, we return the internally stored
63 * independent value of the pressure.
64 */
65 double pressure() const override {
66 return m_Pcurrent;
67 }
68
69 /**
70 * Set the pressure at constant temperature. Units: Pa. This method sets a
71 * constant within the object. The mass density is not a function of
72 * pressure.
73 *
74 * @param p Input Pressure (Pa)
75 */
76 void setPressure(double p) override;
77
78 void calcDensity() override;
79
80 //! @}
81 //! @name Chemical Potentials and Activities
82 //! @{
83
84 void getActivityCoefficients(double* ac) const override;
85 void getChemPotentials(double* mu) const override;
86 //! @deprecated To be removed after %Cantera 3.0. Use getChemPotentials() instead.
87 void getChemPotentials_RT(double* mu) const override;
88
89 //! @}
90 //! @name Partial Molar Properties of the Solution
91 //! @{
92
93 void getPartialMolarEnthalpies(double* hbar) const override;
94 void getPartialMolarEntropies(double* sbar) const override;
95 void getPartialMolarCp(double* cpbar) const override;
96 void getPartialMolarVolumes(double* vbar) const override;
97 void getPureGibbs(double* gpure) const override;
98 void getStandardChemPotentials(double* mu) const override;
99
100 //! @}
101 //! @name Utility Functions
102 //! @{
103
104 void initThermo() override;
105 void getParameters(AnyMap& phaseNode) const override;
106
107 void set_h_mix(const double hmix) { h_mixing = hmix; }
108
109 //! Set the product Species. Must be called after species have been added.
110 void setProductSpecies(const string& name);
111 //! @}
112
113 private:
114 /**
115 * m_Pcurrent = The current pressure. Since the density isn't a function of
116 * pressure, but only of the mole fractions, we need to independently
117 * specify the pressure.
118 */
119 double m_Pcurrent = OneAtm;
120
121 //! Value of the enthalpy change on mixing due to protons changing from type
122 //! B to type A configurations.
123 double h_mixing = 0.0;
124
125 //! Index of the species whose mole fraction defines the extent of reduction r
126 int product_species_index = -1;
127 int reactant_species_index = -1;
128
129 // Functions to calculate some of the pieces of the mixing terms.
130 double s() const;
131 double fm(const double r) const;
132 double p(const double r) const;
133};
134}
135
136#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::MaskellSolidSolnPhase
Class MaskellSolidSolnPhase represents a condensed phase non-ideal solution with 2 species following ...
Definition MaskellSolidSolnPhase.h:31
Cantera::MaskellSolidSolnPhase::enthalpy_mole
double enthalpy_mole() const override
Molar enthalpy. Units: J/kmol.
Definition MaskellSolidSolnPhase.cpp:35
Cantera::MaskellSolidSolnPhase::logStandardConc
double logStandardConc(size_t k=0) const override
Natural logarithm of the standard concentration of the kth species.
Definition MaskellSolidSolnPhase.h:42
Cantera::MaskellSolidSolnPhase::getPartialMolarEnthalpies
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
Definition MaskellSolidSolnPhase.cpp:123
Cantera::MaskellSolidSolnPhase::getChemPotentials
void getChemPotentials(double *mu) const override
Get the species chemical potentials. Units: J/kmol.
Definition MaskellSolidSolnPhase.cpp:98
Cantera::MaskellSolidSolnPhase::pressure
double pressure() const override
Pressure.
Definition MaskellSolidSolnPhase.h:65
Cantera::MaskellSolidSolnPhase::h_mixing
double h_mixing
Value of the enthalpy change on mixing due to protons changing from type B to type A configurations.
Definition MaskellSolidSolnPhase.h:123
Cantera::MaskellSolidSolnPhase::getStandardChemPotentials
void getStandardChemPotentials(double *mu) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Definition MaskellSolidSolnPhase.cpp:150
Cantera::MaskellSolidSolnPhase::getParameters
void getParameters(AnyMap &phaseNode) const override
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition MaskellSolidSolnPhase.cpp:168
Cantera::MaskellSolidSolnPhase::type
string type() const override
String indicating the thermodynamic model implemented.
Definition MaskellSolidSolnPhase.h:35
Cantera::MaskellSolidSolnPhase::initThermo
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
Definition MaskellSolidSolnPhase.cpp:159
Cantera::MaskellSolidSolnPhase::getActivityConcentrations
void getActivityConcentrations(double *c) const override
This method returns an array of generalized concentrations.
Definition MaskellSolidSolnPhase.cpp:25
Cantera::MaskellSolidSolnPhase::setPressure
void setPressure(double p) override
Set the pressure at constant temperature.
Definition MaskellSolidSolnPhase.cpp:72
Cantera::MaskellSolidSolnPhase::getPartialMolarVolumes
void getPartialMolarVolumes(double *vbar) const override
Return an array of partial molar volumes for the species in the mixture.
Definition MaskellSolidSolnPhase.cpp:138
Cantera::MaskellSolidSolnPhase::getPureGibbs
void getPureGibbs(double *gpure) const override
Get the Gibbs functions for the standard state of the species at the current T and P of the solution.
Definition MaskellSolidSolnPhase.cpp:143
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:126
Cantera::MaskellSolidSolnPhase::entropy_mole
double entropy_mole() const override
Molar entropy. Units: J/kmol/K.
Definition MaskellSolidSolnPhase.cpp:48
Cantera::MaskellSolidSolnPhase::calcDensity
void calcDensity() override
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
Definition MaskellSolidSolnPhase.cpp:59
Cantera::MaskellSolidSolnPhase::standardConcentrationUnits
Units standardConcentrationUnits() const override
Returns the units of the "standard concentration" for this phase.
Definition MaskellSolidSolnPhase.h:39
Cantera::MaskellSolidSolnPhase::getPartialMolarCp
void getPartialMolarCp(double *cpbar) const override
Return an array of partial molar heat capacities for the species in the mixture.
Definition MaskellSolidSolnPhase.cpp:133
Cantera::MaskellSolidSolnPhase::setProductSpecies
void setProductSpecies(const string &name)
Set the product Species. Must be called after species have been added.
Definition MaskellSolidSolnPhase.cpp:175
Cantera::MaskellSolidSolnPhase::standardConcentration
double standardConcentration(size_t k=0) const override
Return the standard concentration for the kth species.
Definition MaskellSolidSolnPhase.h:41
Cantera::MaskellSolidSolnPhase::getChemPotentials_RT
void getChemPotentials_RT(double *mu) const override
Definition MaskellSolidSolnPhase.cpp:111
Cantera::MaskellSolidSolnPhase::getActivityCoefficients
void getActivityCoefficients(double *ac) const override
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
Definition MaskellSolidSolnPhase.cpp:79
Cantera::MaskellSolidSolnPhase::getPartialMolarEntropies
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
Definition MaskellSolidSolnPhase.cpp:128
Cantera::MaskellSolidSolnPhase::m_Pcurrent
double m_Pcurrent
m_Pcurrent = The current pressure.
Definition MaskellSolidSolnPhase.h:119
Cantera::Phase::name
string name() const
Return the name of the phase.
Definition Phase.cpp:20
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::OneAtm
const double OneAtm
One atmosphere [Pa].
Definition ct_defs.h:96
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564