Added getStandardVolumes_ref() to ThermoPhase.h
I had started to put similar routines in in child routines, but it deserves to be here to fill out the suite. Added DebyeHuckel to doxygen - unfinished. took out getSpeciesMolarVolume() from DebyeHuckel.
This commit is contained in:
parent
4f8d4268bf
commit
a4f1ab3d74
5 changed files with 246 additions and 98 deletions
|
|
@ -701,17 +701,17 @@ namespace Cantera {
|
|||
err("getCp_R");
|
||||
}
|
||||
|
||||
//! Get the molar volumes of the species standard states at the current
|
||||
//! <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* units = m^3 / kmol
|
||||
*
|
||||
* @param vol Output vector containing the standard state volumes.
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getStandardVolumes(doublereal *vol) const {
|
||||
err("getStandardVolumes");
|
||||
}
|
||||
//! Get the molar volumes of the species standard states at the current
|
||||
//! <I>T</I> and <I>P</I> of the solution.
|
||||
/*!
|
||||
* units = m^3 / kmol
|
||||
*
|
||||
* @param vol Output vector containing the standard state volumes.
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getStandardVolumes(doublereal *vol) const {
|
||||
err("getStandardVolumes");
|
||||
}
|
||||
|
||||
//@}
|
||||
/// @name Thermodynamic Values for the Species Reference States
|
||||
|
|
@ -793,62 +793,73 @@ namespace Cantera {
|
|||
err("getCp_R_ref()");
|
||||
}
|
||||
|
||||
//! Get the molar volumes of the species reference states at the current
|
||||
//! <I>T</I> and <I>P_ref</I> of the solution.
|
||||
/*!
|
||||
* units = m^3 / kmol
|
||||
*
|
||||
* @param vol Output vector containing the standard state volumes.
|
||||
* Length: m_kk.
|
||||
*/
|
||||
virtual void getStandardVolumes_ref(doublereal *vol) const {
|
||||
err("getStandardVolumes_ref");
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
//
|
||||
// The methods below are not virtual, and should not
|
||||
// be overloaded.
|
||||
//
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @name Specific Properties
|
||||
* @{
|
||||
*/
|
||||
///////////////////////////////////////////////////////
|
||||
//
|
||||
// The methods below are not virtual, and should not
|
||||
// be overloaded.
|
||||
//
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @name Specific Properties
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Specific enthalpy. Units: J/kg.
|
||||
*/
|
||||
doublereal enthalpy_mass() const {
|
||||
return enthalpy_mole()/meanMolecularWeight();
|
||||
}
|
||||
/**
|
||||
* Specific enthalpy. Units: J/kg.
|
||||
*/
|
||||
doublereal enthalpy_mass() const {
|
||||
return enthalpy_mole()/meanMolecularWeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specific internal energy. Units: J/kg.
|
||||
*/
|
||||
doublereal intEnergy_mass() const {
|
||||
return intEnergy_mole()/meanMolecularWeight();
|
||||
}
|
||||
/**
|
||||
* Specific internal energy. Units: J/kg.
|
||||
*/
|
||||
doublereal intEnergy_mass() const {
|
||||
return intEnergy_mole()/meanMolecularWeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specific entropy. Units: J/kg/K.
|
||||
*/
|
||||
doublereal entropy_mass() const {
|
||||
return entropy_mole()/meanMolecularWeight();
|
||||
}
|
||||
/**
|
||||
* Specific entropy. Units: J/kg/K.
|
||||
*/
|
||||
doublereal entropy_mass() const {
|
||||
return entropy_mole()/meanMolecularWeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specific Gibbs function. Units: J/kg.
|
||||
*/
|
||||
doublereal gibbs_mass() const {
|
||||
return gibbs_mole()/meanMolecularWeight();
|
||||
}
|
||||
/**
|
||||
* Specific Gibbs function. Units: J/kg.
|
||||
*/
|
||||
doublereal gibbs_mass() const {
|
||||
return gibbs_mole()/meanMolecularWeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specific heat at constant pressure. Units: J/kg/K.
|
||||
*/
|
||||
doublereal cp_mass() const {
|
||||
return cp_mole()/meanMolecularWeight();
|
||||
}
|
||||
/**
|
||||
* Specific heat at constant pressure. Units: J/kg/K.
|
||||
*/
|
||||
doublereal cp_mass() const {
|
||||
return cp_mole()/meanMolecularWeight();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specific heat at constant volume. Units: J/kg/K.
|
||||
*/
|
||||
doublereal cv_mass() const {
|
||||
return cv_mole()/meanMolecularWeight();
|
||||
}
|
||||
//@}
|
||||
/**
|
||||
* Specific heat at constant volume. Units: J/kg/K.
|
||||
*/
|
||||
doublereal cv_mass() const {
|
||||
return cv_mole()/meanMolecularWeight();
|
||||
}
|
||||
//@}
|
||||
|
||||
//! Return the Gas Constant multiplied by the current temperature
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
/**
|
||||
* @file DebyeHuckel.cpp
|
||||
*
|
||||
* Definitions of the DebyeHuckel object.
|
||||
*/
|
||||
/*
|
||||
* Copywrite (2006) Sandia Corporation. Under the terms of
|
||||
|
|
@ -23,7 +25,7 @@ using namespace std;
|
|||
|
||||
namespace Cantera {
|
||||
|
||||
/**
|
||||
/*
|
||||
* Default constructor
|
||||
*/
|
||||
DebyeHuckel::DebyeHuckel() :
|
||||
|
|
@ -47,7 +49,8 @@ namespace Cantera {
|
|||
m_npActCoeff[1] = -0.01049;
|
||||
m_npActCoeff[2] = 1.545E-3;
|
||||
}
|
||||
/**
|
||||
|
||||
/*
|
||||
* Working constructors
|
||||
*
|
||||
* The two constructors below are the normal way
|
||||
|
|
@ -101,7 +104,7 @@ namespace Cantera {
|
|||
constructPhaseXML(phaseRoot, id);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Copy Constructor:
|
||||
*
|
||||
* Note this stuff will not work until the underlying phase
|
||||
|
|
@ -391,7 +394,7 @@ namespace Cantera {
|
|||
return 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Overwritten setDensity() function is necessary because the
|
||||
* density is not an indendent variable.
|
||||
*
|
||||
|
|
@ -432,7 +435,7 @@ namespace Cantera {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Overwritten setTemperature(double) from State.h. This
|
||||
* function sets the temperature, and makes sure that
|
||||
* the value propagates to underlying objects.
|
||||
|
|
@ -1734,9 +1737,9 @@ namespace Cantera {
|
|||
*
|
||||
* units - \f$ m^3 kmol^-1 \f$
|
||||
*/
|
||||
double DebyeHuckel::speciesMolarVolume(int k) const {
|
||||
return m_speciesSize[k];
|
||||
}
|
||||
// double DebyeHuckel::speciesMolarVolume(int k) const {
|
||||
// return m_speciesSize[k];
|
||||
//}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**
|
||||
* @file DebyeHuckel.h
|
||||
*
|
||||
* Declarations for the DebyeHuckel phase
|
||||
*/
|
||||
/*
|
||||
* Copywrite (2006) Sandia Corporation. Under the terms of
|
||||
|
|
@ -20,14 +21,9 @@
|
|||
|
||||
namespace Cantera {
|
||||
|
||||
/**
|
||||
* @defgroup thermoprops Thermodynamic Properties
|
||||
*
|
||||
* These classes are used to compute thermodynamic properties.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DebyeHuckel.h
|
||||
/*!
|
||||
|
||||
*
|
||||
* Major Parameters:
|
||||
*
|
||||
|
|
@ -100,7 +96,140 @@ namespace Cantera {
|
|||
class WaterPDSS;
|
||||
|
||||
/**
|
||||
* Definition of the DebyeHuckel object
|
||||
* @ingroup thermoprops
|
||||
*
|
||||
* Class %DebyeHuckel represents a dilute liquid electrolyte phase which
|
||||
* obeys the Debye Huckel formulation for nonideality.
|
||||
*
|
||||
*
|
||||
*
|
||||
* <b> Specification of Species Standard %State Properties </b>
|
||||
*
|
||||
*
|
||||
* It is assumed that the reference state thermodynamics may be
|
||||
* obtained by a pointer to a populated species thermodynamic property
|
||||
* manager class (see ThermoPhase::m_spthermo). How to relate pressure
|
||||
* changes to the reference state thermodynamics is resolved at this level.
|
||||
*
|
||||
* For an incompressible,
|
||||
* stoichiometric substance, the molar internal energy is
|
||||
* independent of pressure. Since the thermodynamic properties
|
||||
* are specified by giving the standard-state enthalpy, the
|
||||
* term \f$ P_0 \hat v\f$ is subtracted from the specified molar
|
||||
* enthalpy to compute the molar internal energy. The entropy is
|
||||
* assumed to be independent of the pressure.
|
||||
*
|
||||
* The enthalpy function is given by the following relation.
|
||||
*
|
||||
* \f[
|
||||
* \raggedright h^o_k(T,P) = h^{ref}_k(T) + \tilde v \left( P - P_{ref} \right)
|
||||
* \f]
|
||||
*
|
||||
* For an incompressible,
|
||||
* stoichiometric substance, the molar internal energy is
|
||||
* independent of pressure. Since the thermodynamic properties
|
||||
* are specified by giving the standard-state enthalpy, the
|
||||
* term \f$ P_{ref} \tilde v\f$ is subtracted from the specified reference molar
|
||||
* enthalpy to compute the molar internal energy.
|
||||
*
|
||||
* \f[
|
||||
* u^o_k(T,P) = h^{ref}_k(T) - P_{ref} \tilde v
|
||||
* \f]
|
||||
*
|
||||
* The standard state heat capacity and entropy are independent
|
||||
* of pressure. The standard state gibbs free energy is obtained
|
||||
* from the enthalpy and entropy functions.
|
||||
*
|
||||
*
|
||||
* <b> Specification of Solution Thermodynamic Properties </b>
|
||||
*
|
||||
* All solution properties are obtained from the standard state
|
||||
* species functions, since there is only one species in the phase.
|
||||
*
|
||||
* <b> Application within %Kinetics Managers </b>
|
||||
*
|
||||
* The standard concentration is equal to 1.0. This means that the
|
||||
* kinetics operator works on an (activities basis). Since this
|
||||
* is a stoichiometric substance, this means that the concentration
|
||||
* of this phase drops out of kinetics expressions.
|
||||
*
|
||||
* An example of a reaction using this is a sticking coefficient
|
||||
* reaction of a substance in an ideal gas phase on a surface with a bulk phase
|
||||
* species in this phase. In this case, the rate of progress for this
|
||||
* reaction, \f$ R_s \f$, may be expressed via the following equation:
|
||||
* \f[
|
||||
* R_s = k_s C_{gas}
|
||||
* \f]
|
||||
* where the units for \f$ R_s \f$ are kmol m-2 s-1. \f$ C_{gas} \f$ has units
|
||||
* of kmol m-3. Therefore, the kinetic rate constant, \f$ k_s \f$, has
|
||||
* units of m s-1. Nowhere does the concentration of the bulk phase
|
||||
* appear in the rate constant expression, since it's a stoichiometric
|
||||
* phase and the activity is always equal to 1.0.
|
||||
*
|
||||
* <b> Instanteation of the Class </b>
|
||||
*
|
||||
* The constructor for this phase is NOT located in the default ThermoFactory
|
||||
* for %Cantera. However, a new %StoichSubstanceSSTP may be created by
|
||||
* the following code snippets:
|
||||
*
|
||||
* @code
|
||||
* sprintf(file_ID,"%s#NaCl(S)", iFile);
|
||||
* XML_Node *xm = get_XML_NameID("phase", file_ID, 0);
|
||||
* StoichSubstanceSSTP *solid = new StoichSubstanceSSTP(*xm);
|
||||
* @endcode
|
||||
*
|
||||
* or by the following call to importPhase():
|
||||
*
|
||||
* @code
|
||||
* sprintf(file_ID,"%s#NaCl(S)", iFile);
|
||||
* XML_Node *xm = get_XML_NameID("phase", file_ID, 0);
|
||||
* StoichSubstanceSSTP solid;
|
||||
* importPhase(*xm, &solid);
|
||||
* @endcode
|
||||
*
|
||||
* <b> XML Example </b>
|
||||
*
|
||||
* The phase model name for this is called StoichSubstance. It must be supplied
|
||||
* as the model attribute of the thermo XML element entry.
|
||||
* Within the phase XML block,
|
||||
* the density of the phase must be specified. An example of an XML file
|
||||
* this phase is given below.
|
||||
*
|
||||
* @verbatim
|
||||
<!-- phase NaCl(S) -->
|
||||
<phase dim="3" id="NaCl(S)">
|
||||
<elementArray datasrc="elements.xml">
|
||||
Na Cl
|
||||
</elementArray>
|
||||
<speciesArray datasrc="#species_NaCl(S)"> NaCl(S) </speciesArray>
|
||||
<thermo model="StoichSubstanceSSTP">
|
||||
<density units="g/cm3">2.165</density>
|
||||
</thermo>
|
||||
<transport model="None"/>
|
||||
<kinetics model="none"/>
|
||||
</phase>
|
||||
|
||||
<!-- species definitions -->
|
||||
<speciesData id="species_NaCl(S)">
|
||||
<!-- species NaCl(S) -->
|
||||
<species name="NaCl(S)">
|
||||
<atomArray> Na:1 Cl:1 </atomArray>
|
||||
<thermo>
|
||||
<Shomate Pref="1 bar" Tmax="1075.0" Tmin="250.0">
|
||||
<floatArray size="7">
|
||||
50.72389, 6.672267, -2.517167,
|
||||
10.15934, -0.200675, -427.2115,
|
||||
130.3973
|
||||
</floatArray>
|
||||
</Shomate>
|
||||
</thermo>
|
||||
<density units="g/cm3">2.165</density>
|
||||
</species>
|
||||
</speciesData> @endverbatim
|
||||
*
|
||||
* The model attribute, "StoichSubstanceSSTP", on the thermo element identifies the phase as being
|
||||
* a StoichSubstanceSSTP object.
|
||||
*
|
||||
*/
|
||||
class DebyeHuckel : public MolalityVPSSTP {
|
||||
|
||||
|
|
@ -243,7 +372,8 @@ namespace Cantera {
|
|||
*/
|
||||
void calcDensity();
|
||||
|
||||
/**
|
||||
//! Set the internally storred molar density (kmol/m^3) of the phase.
|
||||
/*!
|
||||
* Overwritten setDensity() function is necessary because the
|
||||
* density is not an indendent variable.
|
||||
*
|
||||
|
|
@ -254,28 +384,44 @@ namespace Cantera {
|
|||
* to create a condition where the density is a function of
|
||||
* the pressure.
|
||||
*
|
||||
* This function will now throw an error condition.
|
||||
* This function will now throw an error condition if the
|
||||
* input isn't exactly equal to the current density.
|
||||
*
|
||||
*
|
||||
* @todo Now have a compressible ss equation for liquid water.
|
||||
* Therefore, this phase is compressible. May still
|
||||
* want to change the independent variable however.
|
||||
*
|
||||
* NOTE: This is an overwritten function from the State.h
|
||||
* class
|
||||
*
|
||||
* @param density Input density (kg/m^3).
|
||||
*/
|
||||
void setDensity(doublereal rho);
|
||||
|
||||
//! Set the internally storred molar density (kmol/m^3) of the phase.
|
||||
/**
|
||||
* Overwritten setMolarDensity() function is necessary because the
|
||||
* density is not an indendent variable.
|
||||
*
|
||||
* This function will now throw an error condition.
|
||||
* This function will now throw an error condition if the input
|
||||
* isn't exactly equal to the current molar density.
|
||||
*
|
||||
* NOTE: This is a virtual function overwritten from the State.h
|
||||
* class
|
||||
*
|
||||
* @param conc Input molar density (kmol/m^3).
|
||||
*/
|
||||
virtual void setMolarDensity(doublereal conc);
|
||||
|
||||
/**
|
||||
//! Set the temperature (K)
|
||||
/*!
|
||||
* Overwritten setTemperature(double) from State.h. This
|
||||
* function sets the temperature, and makes sure that
|
||||
* the value propagates to underlying objects.
|
||||
* the value propagates to underlying objects, such as
|
||||
* the water standard state model.
|
||||
*
|
||||
* @param temp Temperature in kelvin
|
||||
*/
|
||||
virtual void setTemperature(doublereal temp);
|
||||
|
||||
|
|
@ -711,20 +857,7 @@ namespace Cantera {
|
|||
|
||||
//@{
|
||||
|
||||
/// Critical temperature (K).
|
||||
virtual doublereal critTemperature() const {
|
||||
err("critTemperature"); return -1.0;
|
||||
}
|
||||
|
||||
/// Critical pressure (Pa).
|
||||
virtual doublereal critPressure() const {
|
||||
err("critPressure"); return -1.0;
|
||||
}
|
||||
|
||||
/// Critical density (kg/m3).
|
||||
virtual doublereal critDensity() const {
|
||||
err("critDensity"); return -1.0;
|
||||
}
|
||||
|
||||
|
||||
//@}
|
||||
|
||||
|
|
@ -843,7 +976,7 @@ namespace Cantera {
|
|||
*
|
||||
* units - \f$ m^3 kmol^-1 \f$
|
||||
*/
|
||||
double speciesMolarVolume(int k) const;
|
||||
//double speciesMolarVolume(int k) const;
|
||||
|
||||
/**
|
||||
* Fill in a return vector containing the species molar volumes
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ namespace Cantera {
|
|||
* The enthalpy function is given by the following relation.
|
||||
*
|
||||
* \f[
|
||||
* h^o_k(T,P) = h^{ref}_k(T) + \tilde v \left( P - P_{ref} \right)
|
||||
* \raggedright h^o_k(T,P) = h^{ref}_k(T) + \tilde v \left( P - P_{ref} \right)
|
||||
* \f]
|
||||
*
|
||||
* For an incompressible,
|
||||
|
|
|
|||
|
|
@ -115,7 +115,8 @@ FILE_PATTERNS = Kinetics.h Kinetics.cpp \
|
|||
MolalityVPSSTP.h MolalityVPSSTP.cpp \
|
||||
IdealMolalSoln.h IdealMolalSoln.cpp \
|
||||
IdealSolidSolnPhase.h IdealSolidSolnPhase.cpp \
|
||||
StoichSubstanceSSTP.h StoichSubstanceSSTP.cpp
|
||||
StoichSubstanceSSTP.h StoichSubstanceSSTP.cpp \
|
||||
DebyeHuckel.h DebyeHuckel.cpp
|
||||
RECURSIVE = NO
|
||||
EXCLUDE = CVS examples converters zeroD
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue