14#ifndef CT_DEBYEHUCKEL_H
15#define CT_DEBYEHUCKEL_H
29#define DHFORM_DILUTE_LIMIT 0
30#define DHFORM_BDOT_AK 1
31#define DHFORM_BDOT_ACOMMON 2
32#define DHFORM_BETAIJ 3
33#define DHFORM_PITZER_BETAIJ 4
39#define A_DEBYE_CONST 0
40#define A_DEBYE_WATER 1
555 explicit DebyeHuckel(
const std::string& inputFile=
"",
556 const std::string&
id=
"");
571 virtual std::string
type()
const {
572 return "DebyeHuckel";
599 virtual doublereal
cp_mole()
const;
765 virtual bool addSpecies(shared_ptr<Species> spec);
769 AnyMap& speciesNode)
const;
886 void setB_Debye(
double B) {
m_B_Debye = B; }
887 void setB_dot(
double bdot);
895 void setBeta(
const std::string& sp1,
const std::string& sp2,
double value);
Header file for class Cantera::Array2D.
Header for intermediate ThermoPhase object for phases which employ molality based activity coefficien...
A map of string keys to values whose type can vary at runtime.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Class DebyeHuckel represents a dilute liquid electrolyte phase which obeys the Debye Huckel formulati...
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...
Array2D & get_Beta_ij()
Returns a reference to M_Beta_ij.
int m_formDH
form of the Debye-Huckel parameterization used in the model.
virtual bool addSpecies(shared_ptr< Species > spec)
double m_A_Debye
Current value of the Debye Constant, A_Debye.
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...
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
vector_fp m_d2lnActCoeffMolaldT2
2nd Derivative of log act coeff wrt T
double m_IionicMolality
Current value of the ionic strength on the molality scale.
double _osmoticCoeffHelgesonFixedForm() const
Formula for the osmotic coefficient that occurs in the GWB.
double m_densWaterSS
Storage for the density of water's standard state.
void s_update_d2lnMolalityActCoeff_dT2() const
Calculate the temperature 2nd derivative of the activity coefficient.
vector_fp m_speciesCharge_Stoich
Stoichiometric species charge -> This is for calculations of the ionic strength which ignore ion-ion ...
int m_form_A_Debye
Form of the constant outside the Debye-Huckel term called A.
bool m_useHelgesonFixedForm
If true, then the fixed for of Helgeson's activity for water is used instead of the rigorous form obt...
static double _nonpolarActCoeff(double IionicMolality)
Static function that implements the non-polar species salt-out modifications.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
virtual void getMolalityActivityCoefficients(doublereal *acMolality) const
Get the array of non-dimensional molality-based activity coefficients at the current solution tempera...
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
int formDH() const
Returns the form of the Debye-Huckel parameterization used.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
double m_B_Debye
Current value of the constant that appears in the denominator.
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
double AionicRadius(int k=0) const
Reports the ionic radius of the kth species.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
void s_update_dlnMolalityActCoeff_dT() const
Calculation of temperature derivative of activity coefficient.
void s_update_lnMolalityActCoeff() const
Calculate the log activity coefficients.
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
void setBeta(const std::string &sp1, const std::string &sp2, double value)
Set the value for the beta interaction between species sp1 and sp2.
vector_fp m_dlnActCoeffMolaldP
Derivative of log act coeff wrt P.
void setDebyeHuckelModel(const std::string &form)
Set the DebyeHuckel parameterization form.
void setA_Debye(double A)
Set the A_Debye parameter.
vector_fp m_dlnActCoeffMolaldT
Derivative of log act coeff wrt T.
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
vector_int m_electrolyteSpeciesType
Vector containing the electrolyte species type.
virtual void initThermo()
double m_Aionic_default
Default ionic radius for species where it is not specified.
vector_fp m_B_Dot
Array of B_Dot values.
virtual std::string type() const
String indicating the thermodynamic model implemented.
double m_maxIionicStrength
Maximum value of the ionic strength allowed in the calculation of the activity coefficients.
virtual doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
DebyeHuckel(const std::string &inputFile="", const std::string &id="")
Full constructor for creating the phase.
double _lnactivityWaterHelgesonFixedForm() const
Formula for the log of the water activity that occurs in the GWB.
vector_fp m_Aionic
a_k = Size of the ionic species in the DH formulation. units = meters
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 getSpeciesParameters(const std::string &name, AnyMap &speciesNode) const
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
void setDefaultIonicRadius(double value)
Set the default ionic radius [m] for each species.
void s_update_dlnMolalityActCoeff_dP() const
Calculate the pressure derivative of the activity coefficient.
PDSS_Water * m_waterSS
Pointer to the Water standard state object.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
double m_IionicMolalityStoich
Stoichiometric ionic strength on the molality scale.
std::unique_ptr< WaterProps > m_waterProps
Pointer to the water property calculator.
virtual void getActivities(doublereal *ac) const
Get the array of non-dimensional activities at the current solution temperature, pressure,...
vector_fp m_tmpV
vector of size m_kk, used as a temporary holding area.
vector_fp m_lnActCoeffMolal
Logarithm of the activity coefficients on the molality scale.
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 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 void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
Class for the liquid water pressure dependent standard state.
std::string name() const
Return the name of the phase.
doublereal temperature() const
Temperature (K).
virtual doublereal pressure() const
Returns the current pressure of the phase.
Class XML_Node is a tree-based representation of the contents of an XML file.
Namespace for the Cantera kernel.
std::vector< int > vector_int
Vector of ints.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.