16 #ifndef CT_DEBYEHUCKEL_H
17 #define CT_DEBYEHUCKEL_H
32 #define DHFORM_DILUTE_LIMIT 0
33 #define DHFORM_BDOT_AK 1
34 #define DHFORM_BDOT_ACOMMON 2
35 #define DHFORM_BETAIJ 3
36 #define DHFORM_PITZER_BETAIJ 4
42 #define A_DEBYE_CONST 0
43 #define A_DEBYE_WATER 1
617 DebyeHuckel(
const std::string& inputFile,
const std::string&
id =
"");
681 virtual doublereal
cp_mole()
const;
687 virtual doublereal
cv_mole()
const;
693 * In this equation of state implementation, the density is a
694 * function only of the mole fractions. Therefore, it can't be
695 * an independent variable. Instead, the pressure is used as the
696 * independent variable. Functions which try to set the thermodynamic
697 * state by calling setDensity() may cause an exception to be
706 virtual doublereal
pressure()
const;
796 virtual void setState_TP(doublereal t, doublereal p);
910 int sizeUA = 6)
const;
1065 err(
"setToEquilState");
1090 virtual void getParameters(
int& n, doublereal*
const c)
const;
1115 err(
"satTemperature");
1140 err(
"vaprFraction");
1145 err(
"setState_sat");
1149 err(
"setState_sat");
1242 double pressure = -1.0)
const;
1259 double pressure = -1.0)
const;
1276 double pressure = -1.0)
const;
1293 double pressure = -1.0)
const;
1568 doublereal
err(
const std::string& msg)
const;
double m_IionicMolalityStoich
Stoichiometric ionic strength on the molality scale.
void s_update_d2lnMolalityActCoeff_dT2() const
Calculate the temperature 2nd derivative of the activity coefficient.
double _lnactivityWaterHelgesonFixedForm() const
Formula for the log of the water activity that occurs in the GWB.
int m_form_A_Debye
Form of the constant outside the Debye-Huckel term called A.
virtual double A_Debye_TP(double temperature=-1.0, double pressure=-1.0) const
Return the Debye Huckel constant as a function of temperature and pressure (Units = sqrt(kg/gmol)) ...
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
virtual doublereal satPressure(doublereal T)
Get the saturation pressure for a given temperature.
virtual doublereal vaporFraction() const
Return the fraction of vapor at the current conditions.
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
vector_fp m_dlnActCoeffMolaldT
Derivative of log act coeff wrt T.
virtual doublereal isothermalCompressibility() const
The isothermal compressibility.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
ThermoPhase * duplMyselfAsThermoPhase() const
Duplicator from the ThermoPhase parent class.
Header file for a common definitions used in electrolytes thermodynamics.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
Class XML_Node is a tree-based representation of the contents of an XML file.
virtual void initThermo()
Initialize the object's internal lengths after species are set.
virtual void setParameters(int n, doublereal *const c)
Set the equation of state parameters.
virtual double d2A_DebyedT2_TP(double temperature=-1.0, double pressure=-1.0) const
Value of the 2nd derivative of the Debye Huckel constant with respect to temperature as a function of...
bool m_useHelgesonFixedForm
If true, then the fixed for of Helgeson's activity for water is used instead of the rigorous form obt...
virtual double dA_DebyedP_TP(double temperature=-1.0, double pressure=-1.0) const
Value of the derivative of the Debye Huckel constant with respect to pressure, as a function of tempe...
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
doublereal err(const std::string &msg) const
Bail out of functions with an error exit if they are not implemented.
int formDH() const
Returns the form of the Debye-Huckel parameterization used.
virtual doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
void setDensity(const doublereal rho)
Set the internally stored density (gm/m^3) of the phase.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
virtual void setState_TP(doublereal t, doublereal p)
Set the temperature (K) and pressure (Pa)
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Header for intermediate ThermoPhase object for phases which employ molality based activity coefficien...
DebyeHuckel()
Default Constructor.
virtual int eosType() const
Equation of state type flag.
Class DebyeHuckel represents a dilute liquid electrolyte phase which obeys the Debye Huckel formulati...
Base class for a phase with thermodynamic properties.
virtual void setTemperature(const doublereal temp)
Set the temperature (K)
Header file for class Cantera::Array2D.
std::vector< int > vector_int
Vector of ints.
virtual double dA_DebyedT_TP(double temperature=-1.0, double pressure=-1.0) const
Value of the derivative of the Debye Huckel constant with respect to temperature. ...
virtual void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
virtual void getParameters(int &n, doublereal *const c) const
Get the equation of state parameters in a vector.
The WaterProps class is used to house several approximation routines for properties of water...
virtual void setState_Tsat(doublereal t, doublereal x)
Set the state to a saturated system at a particular temperature.
Array2D m_Beta_ij
Array of 2D data used in the DHFORM_BETAIJ formulation Beta_ij.value(i,j) is the coefficient of the j...
void s_update_lnMolalityActCoeff() const
Calculate the log activity coefficients.
vector_fp m_Aionic
a_k = Size of the ionic species in the DH formulation units = meters
Class for the liquid water pressure dependent standard state.
double _nonpolarActCoeff(double IionicMolality) const
Static function that implements the non-polar species salt-out modifications.
double m_maxIionicStrength
Maximum value of the ionic strength allowed in the calculation of the activity coefficients.
int m_formDH
form of the Debye-Huckel parameterization used in the model.
double m_A_Debye
Current value of the Debye Constant, A_Debye.
vector_fp m_lnActCoeffMolal
Logarithm of the activity coefficients on the molality scale.
virtual void setState_Psat(doublereal p, doublereal x)
Set the state to a saturated system at a particular pressure.
PDSS_Water * m_waterSS
Pointer to the Water standard state object.
vector_fp m_B_Dot
Array of B_Dot values.
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
Array2D & get_Beta_ij()
Returns a reference to M_Beta_ij.
int m_formGC
Format for the generalized concentration:
double _osmoticCoeffHelgesonFixedForm() const
Formula for the osmotic coefficient that occurs in the GWB.
virtual doublereal enthalpy_mole() const
Molar enthalpy of the solution. Units: J/kmol.
void initLengths()
Initialize the internal lengths.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input...
DebyeHuckel & operator=(const DebyeHuckel &)
Assignment operator.
vector_int m_electrolyteSpeciesType
Vector containing the electrolyte species type.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
void s_update_dlnMolalityActCoeff_dT() const
Calculation of temperature derivative of activity coefficient.
vector_fp m_speciesCharge_Stoich
Stoichiometric species charge -> This is for calculations of the ionic strength which ignore ion-ion ...
virtual doublereal intEnergy_mole() const
Molar internal energy of the solution. Units: J/kmol.
double m_IionicMolality
Current value of the ionic strength on the molality scale.
doublereal temperature() const
Temperature (K).
double AionicRadius(int k=0) const
Reports the ionic radius of the kth species.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
vector_fp m_npActCoeff
These are coefficients to describe the increase in activity coeff for non-polar molecules due to the ...
vector_fp m_d2lnActCoeffMolaldT2
2nd Derivative of log act coeff wrt T
vector_fp m_tmpV
vector of size m_kk, used as a temporary holding area.
vector_fp m_pp
Temporary array used in equilibrium calculations.
double m_B_Debye
Current value of the constant that appears in the denominator.
void s_update_dlnMolalityActCoeff_dP() const
Calculate the pressure derivative of the activity coefficient.
WaterProps * m_waterProps
Pointer to the water property calculator.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Process the XML file after species are set up.
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
virtual void getActivities(doublereal *ac) const
Get the array of non-dimensional activities at the current solution temperature, pressure, and solution concentration.
vector_fp m_dlnActCoeffMolaldP
Derivative of log act coeff wrt P.
virtual void getMolalityActivityCoefficients(doublereal *acMolality) const
Get the array of non-dimensional molality-based activity coefficients at the current solution tempera...
virtual void getUnitsStandardConc(double *uA, int k=0, int sizeUA=6) const
Returns the units of the standard and generalized concentrations.
virtual ~DebyeHuckel()
Destructor.
virtual doublereal thermalExpansionCoeff() const
The thermal expansion coefficient.
virtual doublereal satTemperature(doublereal p) const
Return the saturation temperature given the pressure.
virtual void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
double m_densWaterSS
Storage for the density of water's standard state.
virtual void setMolarDensity(const doublereal conc)
Set the internally stored molar density (kmol/m^3) of the phase.