46#define PITZER_TEMP_CONSTANT 0
47#define PITZER_TEMP_LINEAR 1
48#define PITZER_TEMP_COMPLEX1 2
56#define A_DEBYE_CONST 0
57#define A_DEBYE_WATER 1
794 explicit HMWSoln(
const string& inputFile=
"",
const string&
id=
"");
800 return "HMW-electrolyte";
847 double cp_mole()
const override;
849 double cv_mole()
const override;
1129 void setBinarySalt(
const string& sp1,
const string& sp2,
1130 size_t nParams,
double* beta0,
double* beta1,
double* beta2,
1131 double* Cphi,
double alpha1,
double alpha2);
1132 void setTheta(
const string& sp1,
const string& sp2,
1133 size_t nParams,
double* theta);
1134 void setPsi(
const string& sp1,
const string& sp2,
1135 const string& sp3,
size_t nParams,
double* psi);
1136 void setLambda(
const string& sp1,
const string& sp2,
1137 size_t nParams,
double* lambda);
1138 void setMunnn(
const string& sp,
size_t nParams,
double* munnn);
1139 void setZeta(
const string& sp1,
const string& sp2,
1140 const string& sp3,
size_t nParams,
double* psi);
1142 void setPitzerTempModel(
const string& model);
1143 void setPitzerRefTemperature(
double Tref) {
1151 void setMaxIonicStrength(
double Imax) {
1155 void setCroppingCoefficients(
double ln_gamma_k_min,
double ln_gamma_k_max,
1156 double ln_gamma_o_min,
double ln_gamma_o_max);
1509 vector<double> m_Alpha1MX_ij;
1880 double IMS_dfCut_ = 0.0;
1881 double IMS_efCut_ = 0.0;
1882 double IMS_afCut_ = 0.0;
1883 double IMS_bfCut_ = 0.0;
1884 double IMS_dgCut_ = 0.0;
1885 double IMS_egCut_ = 0.0;
1886 double IMS_agCut_ = 0.0;
1887 double IMS_bgCut_ = 0.0;
1896 double MC_dpCut_ = 0.0;
1897 double MC_epCut_ = 0.0;
1898 double MC_apCut_ = 0.0;
1899 double MC_bpCut_ = 0.0;
1900 double MC_cpCut_ = 0.0;
1901 double CROP_ln_gamma_o_min;
1902 double CROP_ln_gamma_o_max;
1903 double CROP_ln_gamma_k_min;
1904 double CROP_ln_gamma_k_max;
2026 mutable double m_last_is = -1.0;
2046 double* etheta,
double* etheta_prime)
const;
Header file for class Cantera::Array2D.
Header for intermediate ThermoPhase object for phases which employ molality based activity coefficien...
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Class HMWSoln represents a dilute or concentrated liquid electrolyte phase which obeys the Pitzer for...
void calcIMSCutoffParams_()
Precalculate the IMS Cutoff parameters for typeCutoff = 2.
vector< double > m_d2lnActCoeffMolaldT2_Unscaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt TT.
Array2D m_Theta_ij_coeff
Array of coefficients for Theta_ij[i][j] in the Pitzer/HMW formulation.
vector< double > m_Mu_nnn_L
Mu coefficient temperature derivative for the self-ternary neutral coefficient.
vector< double > m_Beta1MX_ij
Array of 2D data used in the Pitzer/HMW formulation.
double enthalpy_mole() const override
Molar enthalpy. Units: J/kmol.
void applyphScale(double *acMolality) const override
Apply the current phScale to a set of activity Coefficients or activities.
unique_ptr< WaterProps > m_waterProps
Pointer to the water property calculator.
Array2D m_Beta0MX_ij_coeff
Array of coefficients for Beta0, a variable in Pitzer's papers.
double m_A_Debye
A_Debye: this expression appears on the top of the ln actCoeff term in the general Debye-Huckel expre...
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...
vector< double > m_h2func_IJ
hfunc2, was called gprime in Pitzer's paper.
vector< double > m_Phi_IJ_LL
Derivative of m_Phi_IJ wrt TT. Vector index is counterIJ.
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
vector< double > m_Beta0MX_ij
Array of 2D data used in the Pitzer/HMW formulation.
void getChemPotentials(double *mu) const override
Get the species chemical potentials. Units: J/kmol.
double IMS_slopegCut_
Parameter in the polyExp cutoff treatment.
Array2D m_Lambda_nj_P
Derivative of Lambda_nj[i][j] wrt P.
void s_updateScaling_pHScaling_dT() const
Apply the current phScale to a set of derivatives of the activity Coefficients wrt temperature.
vector< double > m_gfunc_IJ
Various temporary arrays used in the calculation of the Pitzer activity coefficients.
double m_IionicMolality
Current value of the ionic strength on the molality scale Associated Salts, if present in the mechani...
void calcMCCutoffParams_()
Calculate molality cut-off parameters.
Array2D m_Beta2MX_ij_coeff
Array of coefficients for Beta2, a variable in Pitzer's papers.
void s_update_d2lnMolalityActCoeff_dT2() const
This function calculates the temperature second derivative of the natural logarithm of the molality a...
vector< double > m_Beta2MX_ij_P
Derivative of Beta2_ij[i][j] wrt P. Vector index is counterIJ.
vector< double > m_Beta0MX_ij_LL
Derivative of Beta0_ij[i][j] wrt TT. Vector index is counterIJ.
int m_form_A_Debye
Form of the constant outside the Debye-Huckel term called A.
vector< double > m_molalitiesCropped
Cropped and modified values of the molalities used in activity coefficient calculations.
vector< double > m_lnActCoeffMolal_Scaled
Logarithm of the activity coefficients on the molality scale.
vector< double > m_CphiMX_ij_P
Derivative of Cphi_ij[i][j] wrt P. Vector index is counterIJ.
vector< double > m_PhiPhi_IJ_L
Derivative of m_PhiPhi_IJ wrt T. Vector index is counterIJ.
vector< double > m_Theta_ij_LL
Derivative of Theta_ij[i][j] wrt TT. Vector index is counterIJ.
vector< double > m_Theta_ij_L
Derivative of Theta_ij[i][j] wrt T. Vector index is counterIJ.
vector< double > m_CphiMX_ij_LL
Derivative of Cphi_ij[i][j] wrt TT. Vector index is counterIJ.
vector< double > m_PhiPhi_IJ_LL
Derivative of m_PhiPhi_IJ wrt TT. Vector index is counterIJ.
Array2D m_Lambda_nj_L
Derivative of Lambda_nj[i][j] wrt T. see m_Lambda_ij.
double s_NBS_CLM_dlnMolalityActCoeff_dT() const
Calculate the temperature derivative of the Chlorine activity coefficient on the NBS scale.
vector< double > m_Psi_ijk_L
Derivative of Psi_ijk[n] wrt T.
void getParameters(AnyMap &phaseNode) const override
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
string type() const override
String indicating the thermodynamic model implemented.
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
void s_updateScaling_pHScaling_dP() const
Apply the current phScale to a set of derivatives of the activity Coefficients wrt pressure.
vector< double > m_tmpV
vector of size m_kk, used as a temporary holding area.
void printCoeffs() const
Print out all of the input Pitzer coefficients.
void getActivityConcentrations(double *c) const override
This method returns an array of generalized activity concentrations.
vector< double > m_Psi_ijk
Array of 3D data used in the Pitzer/HMW formulation.
vector< double > m_hfunc_IJ
hfunc, was called gprime in Pitzer's paper.
void s_update_dlnMolalityActCoeff_dT() const
This function calculates the temperature derivative of the natural logarithm of the molality activity...
void s_update_lnMolalityActCoeff() const
This function will be called to update the internally stored natural logarithm of the molality activi...
vector< double > m_Beta1MX_ij_P
Derivative of Beta1_ij[i][j] wrt P. Vector index is counterIJ.
vector< int > CROP_speciesCropped_
This is a boolean-type vector indicating whether a species's activity coefficient is in the cropped r...
vector< double > m_Alpha2MX_ij
Array of 2D data used in the Pitzer/HMW formulation.
double ADebye_V(double temperature=-1.0, double pressure=-1.0) const
Return Pitzer's definition of A_V.
vector< double > m_BphiMX_IJ_L
Derivative of BphiMX_IJ wrt T. Vector index is counterIJ.
void getPartialMolarVolumes(double *vbar) const override
Return an array of partial molar volumes for the species in the mixture.
vector< double > m_Phi_IJ_P
Derivative of m_Phi_IJ wrt P. Vector index is counterIJ.
vector< double > m_BphiMX_IJ_P
Derivative of BphiMX_IJ wrt P. Vector index is counterIJ.
void counterIJ_setup() const
Set up a counter variable for keeping track of symmetric binary interactions amongst the solute speci...
vector< double > m_BMX_IJ
Intermediate variable called BMX in Pitzer's paper.
vector< double > m_dlnActCoeffMolaldP_Unscaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt P.
vector< double > m_CMX_IJ_LL
Derivative of m_CMX_IJ wrt TT. Vector index is counterIJ.
vector< double > m_BMX_IJ_P
Derivative of BMX_IJ wrt P. Vector index is counterIJ.
double cv_mole() const override
Molar heat capacity at constant volume. Units: J/kmol/K.
vector< double > m_Mu_nnn_P
Mu coefficient pressure derivative for the self-ternary neutral coefficient.
Array2D m_Psi_ijk_coeff
Array of coefficients for Psi_ijk[n] in the Pitzer/HMW formulation.
void getUnscaledMolalityActivityCoefficients(double *acMolality) const override
Get the array of unscaled non-dimensional molality based activity coefficients at the current solutio...
void setA_Debye(double A)
Set the A_Debye parameter.
vector< double > IMS_lnActCoeffMolal_
Logarithm of the molal activity coefficients.
int m_formPitzerTemp
This is the form of the temperature dependence of Pitzer parameterization used in the model.
vector< double > m_dlnActCoeffMolaldT_Unscaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt T.
vector< double > m_BMX_IJ_L
Derivative of BMX_IJ wrt T. Vector index is counterIJ.
virtual double relative_enthalpy() const
Excess molar enthalpy of the solution from the mixing process.
vector< double > m_Beta0MX_ij_L
Derivative of Beta0_ij[i][j] wrt T. Vector index is counterIJ.
vector< double > m_Beta0MX_ij_P
Derivative of Beta0_ij[i][j] wrt P. Vector index is counterIJ.
void s_updatePitzer_CoeffWRTemp(int doDerivs=2) const
Calculates the Pitzer coefficients' dependence on the temperature.
double s_NBS_CLM_lnMolalityActCoeff() const
Calculate the Chlorine activity coefficient on the NBS scale.
vector< double > m_Theta_ij
Array of 2D data for Theta_ij[i][j] in the Pitzer/HMW formulation.
vector< double > m_Beta2MX_ij_L
Derivative of Beta2_ij[i][j] wrt T. Vector index is counterIJ.
vector< double > m_Mu_nnn_LL
Mu coefficient 2nd temperature derivative for the self-ternary neutral coefficient.
void s_updatePitzer_dlnMolalityActCoeff_dP() const
Calculates the Pressure derivative of the natural logarithm of the molality activity coefficients.
vector< double > m_BphiMX_IJ
Intermediate variable called BphiMX in Pitzer's paper.
Array2D m_Lambda_nj
Lambda coefficient for the ij interaction.
vector< double > m_BprimeMX_IJ
Intermediate variable called BprimeMX in Pitzer's paper.
vector< double > m_Theta_ij_P
Derivative of Theta_ij[i][j] wrt P. Vector index is counterIJ.
vector< double > m_PhiPhi_IJ
Intermediate variable called PhiPhi in Pitzer's paper.
void calc_thetas(int z1, int z2, double *etheta, double *etheta_prime) const
Calculate etheta and etheta_prime.
vector< int > m_CounterIJ
a counter variable for keeping track of symmetric binary interactions amongst the solute species.
Array2D m_Mu_nnn_coeff
Array of coefficients form_Mu_nnn term.
virtual double relative_molal_enthalpy() const
Excess molar enthalpy of the solution from the mixing process on a molality basis.
double ADebye_L(double temperature=-1.0, double pressure=-1.0) const
Return Pitzer's definition of A_L.
double entropy_mole() const override
Molar entropy. Units: J/kmol/K.
PDSS * m_waterSS
Water standard state calculator.
void calcDensity() override
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
void calc_lambdas(double is) const
Calculate the lambda interactions.
double elambda1[17]
This is elambda1, MEC.
vector< double > m_Beta1MX_ij_LL
Derivative of Beta1_ij[i][j] wrt TT. Vector index is counterIJ.
vector< double > m_lnActCoeffMolal_Unscaled
Logarithm of the activity coefficients on the molality scale.
double s_NBS_CLM_dlnMolalityActCoeff_dP() const
Calculate the pressure derivative of the Chlorine activity coefficient.
double m_maxIionicStrength
Maximum value of the ionic strength allowed in the calculation of the activity coefficients.
vector< double > m_dlnActCoeffMolaldT_Scaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt T.
vector< double > m_Beta2MX_ij
Array of 2D data used in the Pitzer/HMW formulation.
vector< double > m_BprimeMX_IJ_LL
Derivative of BprimeMX wrt TT. Vector index is counterIJ.
vector< double > m_Phiprime_IJ
Intermediate variable called Phiprime in Pitzer's paper.
void s_updatePitzer_dlnMolalityActCoeff_dT() const
Calculates the temperature derivative of the natural logarithm of the molality activity coefficients.
void s_updatePitzer_lnMolalityActCoeff() const
Calculate the Pitzer portion of the activity coefficients.
double cp_mole() const override
Molar heat capacity at constant pressure. Units: J/kmol/K.
vector< double > m_PhiPhi_IJ_P
Derivative of m_PhiPhi_IJ wrt P. Vector index is counterIJ.
void getActivities(double *ac) const override
Get the array of non-dimensional activities at the current solution temperature, pressure,...
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 as a function of tem...
vector< double > m_BprimeMX_IJ_L
Derivative of BprimeMX wrt T. Vector index is counterIJ.
vector< double > m_Phi_IJ
Intermediate variable called Phi in Pitzer's paper.
vector< double > m_BMX_IJ_LL
Derivative of BMX_IJ wrt TT. Vector index is counterIJ.
vector< double > m_d2lnActCoeffMolaldT2_Scaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt TT.
Array2D m_Lambda_nj_LL
Derivative of Lambda_nj[i][j] wrt TT.
double IMS_X_o_cutoff_
value of the solute mole fraction that centers the cutoff polynomials for the cutoff =1 process;
double IMS_cCut_
Parameter in the polyExp cutoff treatment having to do with rate of exp decay.
vector< double > m_BphiMX_IJ_LL
Derivative of BphiMX_IJ wrt TT. Vector index is counterIJ.
void s_updatePitzer_d2lnMolalityActCoeff_dT2() const
This function calculates the temperature second derivative of the natural logarithm of the molality a...
vector< double > m_CMX_IJ_L
Derivative of m_CMX_IJ wrt T. Vector index is counterIJ.
void getPartialMolarCp(double *cpbar) const override
Return an array of partial molar heat capacities for the species in the mixture.
Array2D m_Lambda_nj_coeff
Array of coefficients for Lambda_nj[i][j] in the Pitzer/HMW formulation.
vector< double > m_Psi_ijk_LL
Derivative of Psi_ijk[n] wrt TT.
void initLengths()
Initialize all of the species-dependent lengths in the object.
vector< double > m_g2func_IJ
This is the value of g2(x2) in Pitzer's papers. Vector index is counterIJ.
double gibbs_mole() const override
Molar Gibbs function. Units: J/kmol.
double standardConcentration(size_t k=0) const override
Return the standard concentration for the kth species.
vector< double > m_CphiMX_ij
Array of 2D data used in the Pitzer/HMW formulation.
vector< double > m_BprimeMX_IJ_P
Derivative of BprimeMX wrt P. Vector index is counterIJ.
vector< double > m_CMX_IJ
Intermediate variable called CMX in Pitzer's paper.
void s_update_dlnMolalityActCoeff_dP() const
This function calculates the pressure derivative of the natural logarithm of the molality activity co...
double MC_X_o_cutoff_
value of the solvent mole fraction that centers the cutoff polynomials for the cutoff =1 process;
double satPressure(double T) override
Get the saturation pressure for a given temperature.
double m_TempPitzerRef
Reference Temperature for the Pitzer formulations.
vector< double > m_Beta2MX_ij_LL
Derivative of Beta2_ij[i][j] wrt TT. Vector index is counterIJ.
double elambda[17]
This is elambda, MEC.
vector< double > m_dlnActCoeffMolaldP_Scaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt P.
vector< double > m_Mu_nnn
Mu coefficient for the self-ternary neutral coefficient.
vector< double > m_Psi_ijk_P
Derivative of Psi_ijk[n] wrt P.
void s_updateIMS_lnMolalityActCoeff() const
This function will be called to update the internally stored natural logarithm of the molality activi...
void calcMolalitiesCropped() const
Calculate the cropped molalities.
vector< double > m_CphiMX_ij_L
Derivative of Cphi_ij[i][j] wrt T. Vector index is counterIJ.
double ADebye_J(double temperature=-1.0, double pressure=-1.0) const
Return Pitzer's definition of A_J.
void s_updateScaling_pHScaling_dT2() const
Apply the current phScale to a set of 2nd derivatives of the activity Coefficients wrt temperature.
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
Array2D m_Beta1MX_ij_coeff
Array of coefficients for Beta1, a variable in Pitzer's papers.
vector< double > m_CMX_IJ_P
Derivative of m_CMX_IJ wrt P. Vector index is counterIJ.
void s_updateScaling_pHScaling() const
Apply the current phScale to a set of activity Coefficients.
vector< double > m_Beta1MX_ij_L
Derivative of Beta1_ij[i][j] wrt T. Vector index is counterIJ.
Array2D m_CphiMX_ij_coeff
Array of coefficients for CphiMX, a parameter in the activity coefficient formulation.
virtual double A_Debye_TP(double temperature=-1.0, double pressure=-1.0) const
Value of the Debye Huckel constant as a function of temperature and pressure.
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...
bool m_molalitiesAreCropped
Boolean indicating whether the molalities are cropped or are modified.
vector< double > m_Phi_IJ_L
Derivative of m_Phi_IJ wrt T. Vector index is counterIJ.
vector< double > m_gamma_tmp
Intermediate storage of the activity coefficient itself.
double s_NBS_CLM_d2lnMolalityActCoeff_dT2() const
Calculate the second temperature derivative of the Chlorine activity coefficient on the NBS scale.
MolalityVPSSTP is a derived class of ThermoPhase that handles variable pressure standard state method...
Virtual base class for a species with a pressure dependent standard state.
double temperature() const
Temperature (K).
double pressure() const override
Returns the current pressure of the phase.
Namespace for the Cantera kernel.