Added documentation for the class

This commit is contained in:
Harry Moffat 2011-03-25 18:46:04 +00:00
parent 30d59b8c49
commit 0b4c221f14

View file

@ -1,19 +1,26 @@
/**
* @file
* @file PhaseCombo_Interaction.h
* Header for intermediate ThermoPhase object for phases which
* employ the Margules gibbs free energy formulation and eliminates the ideal mixing term.
* (see \ref thermoprops
* and class \link Cantera::PhaseCombo_Interaction PhaseCombo_Interaction\endlink).
*/
/*
* Copywrite (2006) Sandia Corporation. Under the terms of
* Copywrite (2011) Sandia Corporation. Under the terms of
* Contract DE-AC04-94AL85000 with Sandia Corporation, the
* U.S. Government retains certain rights in this software.
*/
/*
* $Id: MargulesVPSSTP.h 641 2010-11-12 21:37:41Z hkmoffa $
* $Author: hkmoffa $
* $Date: 2009-11-09 16:36:49 -0700 (Mon, 09 Nov 2009) $
* $Revision: 255 $
*/
#ifndef CT_LIFES_X_ONEPHASE_VPSSTP_H
#define CT_LIFES_X_ONEPHASE_VPSSTP_H
#include "PseudoBinaryVPSSTP.h"
#include "GibbsExcessVPSSTP.h"
namespace Cantera {
@ -23,9 +30,321 @@ namespace Cantera {
*/
//! MargulesVPSSTP is a derived class of GibbsExcessVPSSTP that employs
//! the Margules approximation for the excess gibbs free energy
//! PhaseCombo_Interaction is a derived class of GibbsExcessVPSSTP that employs
//! the Margules approximation for the excess gibbs free energy while eliminating
//! the entropy of mixing term.
/*!
*
* %PhaseCombo_Interaction derives from class GibbsExcessVPSSTP which is derived from VPStandardStateTP,
* and overloads the virtual methods defined there with ones that
* use expressions appropriate for the Margules Excess gibbs free energy approximation.
* The reader should refer to the MargulesVPSSTP class for information on that class.
* This class in addition adds a term to the activity coefficient that eliminates the
* ideal solution mixing term within the chemical potential. This is a very radical thing
* to do, but it is supported by experimental evidence under some conditions.
*
* The independent unknowns are pressure, temperature, and mass fraction.
*
* Several concepts are introduced. The first concept is that there are temporary
* variables for holding the species standard state values of Cp, H, S, G, and V at the
* last temperature and pressure called. These functions are not recalculated
* if a new call is made using the previous temperature and pressure. Currently,
* these variables and the calculation method are handled by the VPSSMgr class,
* for which VPStandardStateTP owns a pointer to.
*
* To support the above functionality, pressure and temperature variables,
* m_plast_ss and m_tlast_ss, are kept which store the last pressure and temperature
* used in the evaluation of standard state properties.
*
* This class is introduced to represent specific conditions observed in thermal batteries.
* HOwever, it may be physically motivated to represent conditions where there may
* be a mixture of componds that are not "mixed" at the molecular level. Therefore, there
* is no mixing term.
*
* The lack of a mixing term has profound effects. First, the mole fraction of a species
* can now be identically zero due to thermodynamic considerations. The phase behaves more
* like a series of phases. That's why we named it PhaseCombo.
*
*
*
* <HR>
* <H2> Specification of Species Standard %State Properties </H2>
* <HR>
*
* All species are defined to have standard states that depend upon both
* the temperature and the pressure. The Margules approximation assumes
* symmetric standard states, where all of the standard state assume
* that the species are in pure component states at the temperatue
* and pressure of the solution. I don't think it prevents, however,
* some species from being dilute in the solution.
*
*
* <HR>
* <H2> Specification of Solution Thermodynamic Properties </H2>
* <HR>
*
* The molar excess Gibbs free energy is given by the following formula which is a sum over interactions <I>i</I>.
* Each of the interactions are binary interactions involving two of the species in the phase, denoted, <I>Ai</I>
* and <I>Bi</I>.
* This is the generalization of the Margules formulation for a phase
* that has more than 2 species. The second term in the excess gibbs free energy is a negation of the
* ideal solution's mixing term.
*
* \f[
* G^E = \sum_i \left( H_{Ei} - T S_{Ei} \right) - \sum_i \left( n_i R T \ln{X_i} \right)
* \f]
* \f[
* H^E_i = n X_{Ai} X_{Bi} \left( h_{o,i} + h_{1,i} X_{Bi} \right)
* \f]
* \f[
* S^E_i = n X_{Ai} X_{Bi} \left( s_{o,i} + s_{1,i} X_{Bi} \right)
* \f]
*
* where n is the total moles in the solution.
*
* The activity of a species defined in the phase is given by an excess Gibbs free energy formulation.
*
* \f[
* a_k = \gamma_k X_k
* \f]
*
* where
*
* \f[
* R T \ln( \gamma_k )= \frac{d(n G^E)}{d(n_k)}\Bigg|_{n_i}
* \f]
*
* Taking the derivatives results in the following expression
*
* \f[
* R T \ln( \gamma_k )= \sum_i \left( \left( \delta_{Ai,k} X_{Bi} + \delta_{Bi,k} X_{Ai} - X_{Ai} X_{Bi} \right)
* \left( g^E_{o,i} + g^E_{1,i} X_{Bi} \right) +
* \left( \delta_{Bi,k} - X_{Bi} \right) X_{Ai} X_{Bi} g^E_{1,i} \right) - RT \ln{X_k}
* \f]
*
* where
* \f$ g^E_{o,i} = h_{o,i} - T s_{o,i} \f$ and \f$ g^E_{1,i} = h_{1,i} - T s_{1,i} \f$
* and where \f$ X_k \f$ is the mole fraction of species <I>k</I>.
*
* This object inherits from the class VPStandardStateTP. Therefore, the specification and
* calculation of all standard state and reference state values are handled at that level. Various functional
* forms for the standard state are permissible.
* The chemical potential for species <I>k</I> is equal to
*
* \f[
* \mu_k(T,P) = \mu^o_k(T, P) + R T \ln(\gamma_k X_k)
* \f]
*
* The partial molar entropy for species <I>k</I> is given by the following relation,
*
* \f[
* \tilde{s}_k(T,P) = s^o_k(T,P) - R \ln( \gamma_k X_k )
* - R T \frac{d \ln(\gamma_k) }{dT}
* \f]
*
* The partial molar enthalpy for species <I>k</I> is given by
*
* \f[
* \tilde{h}_k(T,P) = h^o_k(T,P) - R T^2 \frac{d \ln(\gamma_k)}{dT}
* \f]
*
* The partial molar volume for species <I>k</I> is
*
* \f[
* \tilde V_k(T,P) = V^o_k(T,P) + R T \frac{d \ln(\gamma_k) }{dP}
* \f]
*
* The partial molar Heat Capacity for species <I>k</I> is
*
* \f[
* \tilde{C}_{p,k}(T,P) = C^o_{p,k}(T,P) - 2 R T \frac{d \ln( \gamma_k )}{dT}
* - R T^2 \frac{d^2 \ln(\gamma_k) }{{dT}^2}
* \f]
*
*
* <HR>
* <H2> %Application within %Kinetics Managers </H2>
* <HR>
*
* \f$ C^a_k\f$ are defined such that \f$ a_k = C^a_k /
* C^s_k, \f$ where \f$ C^s_k \f$ is a standard concentration
* defined below and \f$ a_k \f$ are activities used in the
* thermodynamic functions. These activity (or generalized) concentrations are used
* by kinetics manager classes to compute the forward and reverse rates of elementary reactions.
* The activity concentration,\f$ C^a_k \f$,is given by the following expression.
*
* \f[
* C^a_k = C^s_k X_k = \frac{P}{R T} X_k
* \f]
*
* The standard concentration for species <I>k</I> is independent of <I>k</I> and equal to
*
* \f[
* C^s_k = C^s = \frac{P}{R T}
* \f]
*
* For example, a bulk-phase binary gas reaction between species j and k, producing
* a new gas species l would have the
* following equation for its rate of progress variable, \f$ R^1 \f$, which has
* units of kmol m-3 s-1.
*
* \f[
* R^1 = k^1 C_j^a C_k^a = k^1 (C^s a_j) (C^s a_k)
* \f]
*
* where
*
* \f[
* C_j^a = C^s a_j \mbox{\quad and \quad} C_k^a = C^s a_k
* \f]
*
* \f$ C_j^a \f$ is the activity concentration of species j, and
* \f$ C_k^a \f$ is the activity concentration of species k. \f$ C^s \f$
* is the standard concentration. \f$ a_j \f$ is
* the activity of species j which is equal to the mole fraction of j.
*
* The reverse rate constant can then be obtained from the law of microscopic reversibility
* and the equilibrium expression for the system.
*
* \f[
* \frac{a_j a_k}{ a_l} = K_a^{o,1} = \exp(\frac{\mu^o_l - \mu^o_j - \mu^o_k}{R T} )
* \f]
*
* \f$ K_a^{o,1} \f$ is the dimensionless form of the equilibrium constant, associated with
* the pressure dependent standard states \f$ \mu^o_l(T,P) \f$ and their associated activities,
* \f$ a_l \f$, repeated here:
*
* \f[
* \mu_l(T,P) = \mu^o_l(T, P) + R T \log(a_l)
* \f]
*
* We can switch over to expressing the equilibrium constant in terms of the reference
* state chemical potentials
*
* \f[
* K_a^{o,1} = \exp(\frac{\mu^{ref}_l - \mu^{ref}_j - \mu^{ref}_k}{R T} ) * \frac{P_{ref}}{P}
* \f]
*
* The concentration equilibrium constant, \f$ K_c \f$, may be obtained by changing over
* to activity concentrations. When this is done:
*
* \f[
* \frac{C^a_j C^a_k}{ C^a_l} = C^o K_a^{o,1} = K_c^1 =
* \exp(\frac{\mu^{ref}_l - \mu^{ref}_j - \mu^{ref}_k}{R T} ) * \frac{P_{ref}}{RT}
* \f]
*
* %Kinetics managers will calculate the concentration equilibrium constant, \f$ K_c \f$,
* using the second and third part of the above expression as a definition for the concentration
* equilibrium constant.
*
* For completeness, the pressure equilibrium constant may be obtained as well
*
* \f[
* \frac{P_j P_k}{ P_l P_{ref}} = K_p^1 = \exp(\frac{\mu^{ref}_l - \mu^{ref}_j - \mu^{ref}_k}{R T} )
* \f]
*
* \f$ K_p \f$ is the simplest form of the equilibrium constant for ideal gases. However, it isn't
* necessarily the simplest form of the equilibrium constant for other types of phases; \f$ K_c \f$ is
* used instead because it is completely general.
*
* The reverse rate of progress may be written down as
* \f[
* R^{-1} = k^{-1} C_l^a = k^{-1} (C^o a_l)
* \f]
*
* where we can use the concept of microscopic reversibility to
* write the reverse rate constant in terms of the
* forward reate constant and the concentration equilibrium
* constant, \f$ K_c \f$.
*
* \f[
* k^{-1} = k^1 K^1_c
* \f]
*
* \f$k^{-1} \f$ has units of s-1.
*
*
* <HR>
* <H2> Instantiation of the Class </H2>
* <HR>
*
*
* The constructor for this phase is located in the default ThermoFactory
* for %Cantera. A new %PhaseCombo_Interaction object may be created by the following code
* snippet:
*
* @code
* XML_Node *xc = get_XML_File("LiFeS_X_combo.xml");
* XML_Node * const xs = xc->findNameID("phase", "LiFeS_X");
* ThermoPhase *l_tp = newPhase(*xs);
* PhaseCombo_Interaction *LiFeS_X_solid = dynamic_cast <PhaseCombo_Interaction *>(l_tp);
* @endcode
*
* or by the following code
*
* @code
* std::string id = "LiFeS_X";
* Cantera::ThermoPhase *LiFeS_X_Phase = Cantera::newPhase("LiFeS_X_combo.xml", id);
* PhaseCombo_Interaction *LiFeS_X_solid = dynamic_cast <PhaseCombo_Interaction *>(l_tp);
* @endcode
*
*
* or by the following constructor:
*
* @code
* XML_Node *xc = get_XML_File("LiFeS_X_combo.xml");
* XML_Node * const xs = xc->findNameID("phase", "LiFeS_X");
* PhaseCombo_Interaction *LiFeS_X_solid = new PhaseCombo_Interaction(*xs);
* @endcode
*
*
* <HR>
* <H2> XML Example </H2>
* <HR>
* An example of an XML Element named phase setting up a PhaseCombo_Interaction
* object named LiFeS_X is given below.
*
*
* @verbatim
<phase dim="3" id="LiFeS_X">
<elementArray datasrc="elements.xml">
Li Fe S
</elementArray>
<speciesArray datasrc="#species_LiFeS">
LiTFe1S2(S) Li2Fe1S2(S)
</speciesArray>
<thermo model="PhaseCombo_Interaction">
<activityCoefficients model="Margules" TempModel="constant">
<binaryNeutralSpeciesParameters speciesA="LiTFe1S2(S)" speciesB="Li2Fe1S2(S)">
<excessEnthalpy model="poly_Xb" terms="2" units="kJ/mol">
84.67069219, -269.1959421
</excessEnthalpy>
<excessEntropy model="poly_Xb" terms="2" units="J/mol/K">
100.7511565, -361.4222659
</excessEntropy>
<excessVolume_Enthalpy model="poly_Xb" terms="2" units="ml/mol">
0, 0
</excessVolume_Enthalpy>
<excessVolume_Entropy model="poly_Xb" terms="2" units="ml/mol/K">
0, 0
</excessVolume_Entropy>
</binaryNeutralSpeciesParameters>
</activityCoefficients>
</thermo>
<transport model="none"/>
<kinetics model="none"/>
</phase>
@endverbatim
*
* The model attribute "PhaseCombo_Interaction" of the thermo XML element identifies the phase as
* being of the type handled by the PhaseCombo_Interaction object.
*
* @ingroup thermoprops
*
*/
class PhaseCombo_Interaction : public GibbsExcessVPSSTP {
public: