47 #define PITZER_TEMP_CONSTANT 0 48 #define PITZER_TEMP_LINEAR 1 49 #define PITZER_TEMP_COMPLEX1 2 58 #define A_DEBYE_CONST 0 59 #define A_DEBYE_WATER 1 1056 HMWSoln(
const std::string& inputFile,
const std::string&
id =
"");
1127 virtual doublereal
cp_mole()
const;
1133 virtual doublereal
cv_mole()
const;
1191 virtual void setDensity(
const doublereal rho);
1473 void setBinarySalt(
const std::string& sp1,
const std::string& sp2,
1474 size_t nParams,
double* beta0,
double* beta1,
double* beta2,
1475 double* Cphi,
double alpha1,
double alpha2);
1476 void setTheta(
const std::string& sp1,
const std::string& sp2,
1477 size_t nParams,
double* theta);
1478 void setPsi(
const std::string& sp1,
const std::string& sp2,
1479 const std::string& sp3,
size_t nParams,
double* psi);
1480 void setLambda(
const std::string& sp1,
const std::string& sp2,
1481 size_t nParams,
double* lambda);
1482 void setMunnn(
const std::string& sp,
size_t nParams,
double* munnn);
1483 void setZeta(
const std::string& sp1,
const std::string& sp2,
1484 const std::string& sp3,
size_t nParams,
double* psi);
1486 void setPitzerTempModel(
const std::string& model);
1487 void setPitzerRefTemperature(
double Tref) {
1495 void setMaxIonicStrength(
double Imax) {
1499 void setCroppingCoefficients(
double ln_gamma_k_min,
double ln_gamma_k_max,
1500 double ln_gamma_o_min,
double ln_gamma_o_max);
1518 virtual void initThermoXML(XML_Node& phaseNode,
const std::string&
id);
2244 doublereal IMS_dfCut_;
2245 doublereal IMS_efCut_;
2246 doublereal IMS_afCut_;
2247 doublereal IMS_bfCut_;
2248 doublereal IMS_dgCut_;
2249 doublereal IMS_egCut_;
2250 doublereal IMS_agCut_;
2251 doublereal IMS_bgCut_;
2260 doublereal MC_dpCut_;
2261 doublereal MC_epCut_;
2262 doublereal MC_apCut_;
2263 doublereal MC_bpCut_;
2264 doublereal MC_cpCut_;
2265 doublereal CROP_ln_gamma_o_min;
2266 doublereal CROP_ln_gamma_o_max;
2267 doublereal CROP_ln_gamma_k_min;
2268 doublereal CROP_ln_gamma_k_max;
2293 virtual void applyphScale(doublereal* acMolality)
const;
2300 void s_update_lnMolalityActCoeff()
const;
2390 mutable doublereal m_last_is;
2410 double* etheta,
double* etheta_prime)
const;
vector_fp m_Theta_ij_P
Derivative of Theta_ij[i][j] wrt P. Vector index is counterIJ.
vector_fp m_BMX_IJ_L
Derivative of BMX_IJ wrt T. Vector index is counterIJ.
vector_fp m_PhiPhi_IJ_P
Derivative of m_PhiPhi_IJ wrt P. Vector index is counterIJ.
void calcMolalitiesCropped() const
Calculate the cropped molalities.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
void s_updateScaling_pHScaling() const
Apply the current phScale to a set of activity Coefficients.
vector_fp m_CphiMX_ij_LL
Derivative of Cphi_ij[i][j] wrt TT. Vector index is counterIJ.
void s_update_dlnMolalityActCoeff_dT() const
This function calculates the temperature derivative of the natural logarithm of the molality activity...
vector_fp m_Theta_ij_L
Derivative of Theta_ij[i][j] wrt T. Vector index is counterIJ.
void readXMLBinarySalt(XML_Node &BinSalt)
Process an XML node called "binarySaltParameters".
vector_fp m_CMX_IJ_P
Derivative of m_CMX_IJ wrt P. Vector index is counterIJ.
vector_fp m_gfunc_IJ
Various temporary arrays used in the calculation of the Pitzer activity coefficients.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
vector_fp m_Beta2MX_ij_L
Derivative of Beta2_ij[i][j] wrt T. Vector index is counterIJ.
vector_fp m_d2lnActCoeffMolaldT2_Unscaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt TT...
doublereal MC_X_o_cutoff_
value of the solvent mole fraction that centers the cutoff polynomials for the cutoff =1 process; ...
virtual void applyphScale(doublereal *acMolality) const
Apply the current phScale to a set of activity Coefficients or activities.
vector_fp IMS_lnActCoeffMolal_
Logarithm of the molal activity coefficients.
doublereal temperature() const
Temperature (K).
Array2D m_Lambda_nj_coeff
Array of coefficients for Lambda_nj[i][j] in the Pitzer/HMW formulation.
double m_maxIionicStrength
Maximum value of the ionic strength allowed in the calculation of the activity coefficients.
void readXMLLambdaNeutral(XML_Node &BinSalt)
Process an XML node called "lambdaNeutral".
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
vector_fp m_Beta1MX_ij_LL
Derivative of Beta1_ij[i][j] wrt TT. Vector index is counterIJ.
doublereal s_NBS_CLM_dlnMolalityActCoeff_dP() const
Calculate the pressure derivative of the Chlorine activity coefficient.
vector_fp m_Mu_nnn_L
Mu coefficient temperature derivative for the self-ternary neutral coefficient.
vector_fp m_dlnActCoeffMolaldP_Unscaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt P...
Array2D m_Beta0MX_ij_coeff
Array of coefficients for Beta0, a variable in Pitzer's papers.
vector_fp m_Beta2MX_ij_P
Derivative of Beta2_ij[i][j] wrt P. Vector index is counterIJ.
vector_fp m_Beta2MX_ij
Array of 2D data used in the Pitzer/HMW formulation.
Array2D m_Lambda_nj_P
Derivative of Lambda_nj[i][j] wrt P.
void readXMLMunnnNeutral(XML_Node &BinSalt)
Process an XML node called "MunnnNeutral".
vector_fp m_PhiPhi_IJ
Intermediate variable called PhiPhi in Pitzer's paper.
vector_fp m_Phi_IJ_L
Derivative of m_Phi_IJ wrt T. Vector index is counterIJ.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
vector_fp m_dlnActCoeffMolaldT_Scaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt T...
virtual void setMolarDensity(const doublereal conc)
Set the internally stored molar density (kmol/m^3) for the phase.
void counterIJ_setup() const
Set up a counter variable for keeping track of symmetric binary interactions amongst the solute speci...
vector_fp m_BMX_IJ_P
Derivative of BMX_IJ wrt P. Vector index is counterIJ.
void s_updateIMS_lnMolalityActCoeff() const
This function will be called to update the internally stored natural logarithm of the molality activi...
vector_fp m_Beta0MX_ij_L
Derivative of Beta0_ij[i][j] wrt T. Vector index is counterIJ.
double elambda[17]
This is elambda, MEC.
Class XML_Node is a tree-based representation of the contents of an XML file.
vector_fp m_dlnActCoeffMolaldP_Scaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt P...
vector_fp m_Mu_nnn_P
Mu coefficient pressure derivative for the self-ternary neutral coefficient.
doublereal s_NBS_CLM_dlnMolalityActCoeff_dT() const
Calculate the temperature derivative of the Chlorine activity coefficient on the NBS scale...
Array2D m_Lambda_nj_L
Derivative of Lambda_nj[i][j] wrt T. see m_Lambda_ij.
virtual void setDensity(const doublereal rho)
Set the internally stored density (kg/m^3) of the phase.
vector_fp m_BprimeMX_IJ_P
Derivative of BprimeMX wrt P. Vector index is counterIJ.
void calcMCCutoffParams_()
Calculate molality cut-off parameters.
vector_fp m_CphiMX_ij_P
Derivative of Cphi_ij[i][j] wrt P. Vector index is counterIJ.
void calcIMSCutoffParams_()
Precalculate the IMS Cutoff parameters for typeCutoff = 2.
vector_fp m_Psi_ijk_L
Derivative of Psi_ijk[n] wrt T.
void readXMLZetaCation(const XML_Node &BinSalt)
Process an XML node called "zetaCation".
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Initialize the phase parameters from an XML file.
vector_fp m_lnActCoeffMolal_Unscaled
Logarithm of the activity coefficients on the molality scale.
void s_updatePitzer_d2lnMolalityActCoeff_dT2() const
This function calculates the temperature second derivative of the natural logarithm of the molality a...
vector_fp m_Theta_ij
Array of 2D data for Theta_ij[i][j] in the Pitzer/HMW formulation.
vector_fp m_hfunc_IJ
hfunc, was called gprime in Pitzer's paper.
double elambda1[17]
This is elambda1, MEC.
vector_fp m_Beta1MX_ij_P
Derivative of Beta1_ij[i][j] wrt P. Vector index is counterIJ.
vector_fp m_BprimeMX_IJ_LL
Derivative of BprimeMX wrt TT. Vector index is counterIJ.
double ADebye_V(double temperature=-1.0, double pressure=-1.0) const
Return Pitzer's definition of A_V.
vector_fp m_PhiPhi_IJ_LL
Derivative of m_PhiPhi_IJ wrt TT. Vector index is counterIJ.
doublereal IMS_cCut_
Parameter in the polyExp cutoff treatment having to do with rate of exp decay.
vector_fp m_Psi_ijk_LL
Derivative of Psi_ijk[n] wrt TT.
double m_IionicMolality
Current value of the ionic strength on the molality scale Associated Salts, if present in the mechani...
vector_fp m_Phi_IJ
Intermediate variable called Phi in Pitzer's paper.
vector_fp m_BphiMX_IJ
Intermediate variable called BphiMX in Pitzer's paper.
void setA_Debye(double A)
Set the A_Debye parameter.
Array2D m_CphiMX_ij_coeff
Array of coefficients for CphiMX, a parameter in the activity coefficient formulation.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
void s_updateScaling_pHScaling_dP() const
Apply the current phScale to a set of derivatives of the activity Coefficients wrt pressure...
vector_fp m_Beta1MX_ij
Array of 2D data used in the Pitzer/HMW formulation.
vector_fp m_tmpV
vector of size m_kk, used as a temporary holding area.
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...
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
HMWSoln()
Default Constructor.
vector_fp m_lnActCoeffMolal_Scaled
Logarithm of the activity coefficients on the molality scale.
Header file for class Cantera::Array2D.
std::vector< int > vector_int
Vector of ints.
vector_fp m_Phi_IJ_P
Derivative of m_Phi_IJ wrt P. Vector index is counterIJ.
PDSS * m_waterSS
Water standard state calculator.
void readXMLTheta(XML_Node &BinSalt)
Process an XML node called "thetaAnion" or "thetaCation".
vector_fp m_Phiprime_IJ
Intermediate variable called Phiprime in Pitzer's paper.
vector_fp m_h2func_IJ
hfunc2, was called gprime in Pitzer's paper.
void printCoeffs() const
Print out all of the input Pitzer coefficients.
vector_fp m_Psi_ijk_P
Derivative of Psi_ijk[n] wrt P.
vector_fp m_CMX_IJ_L
Derivative of m_CMX_IJ wrt T. Vector index is counterIJ.
bool m_molalitiesAreCropped
Boolean indicating whether the molalities are cropped or are modified.
vector_fp m_dlnActCoeffMolaldT_Unscaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt T...
Array2D m_Psi_ijk_coeff
Array of coefficients for Psi_ijk[n] in the Pitzer/HMW formulation.
doublereal s_NBS_CLM_lnMolalityActCoeff() const
Calculate the Chlorine activity coefficient on the NBS scale.
std::unique_ptr< WaterProps > m_waterProps
Pointer to the water property calculator.
virtual doublereal relative_enthalpy() const
Excess molar enthalpy of the solution from the mixing process.
void calc_thetas(int z1, int z2, double *etheta, double *etheta_prime) const
Calculate etheta and etheta_prime.
virtual void initThermo()
vector_fp m_Mu_nnn
Mu coefficient for the self-ternary neutral coefficient.
vector_fp m_molalitiesCropped
Cropped and modified values of the molalities used in activity coefficient calculations.
vector_fp m_Beta2MX_ij_LL
Derivative of Beta2_ij[i][j] wrt TT. Vector index is counterIJ.
void s_updatePitzer_dlnMolalityActCoeff_dT() const
Calculates the temperature derivative of the natural logarithm of the molality activity coefficients...
vector_int CROP_speciesCropped_
This is a boolean-type vector indicating whether a species's activity coefficient is in the cropped r...
vector_fp m_CMX_IJ_LL
Derivative of m_CMX_IJ wrt TT. Vector index is counterIJ.
Array2D m_Beta2MX_ij_coeff
Array of coefficients for Beta2, a variable in Pitzer's papers.
Array2D m_Lambda_nj_LL
Derivative of Lambda_nj[i][j] wrt TT.
void getUnscaledMolalityActivityCoefficients(doublereal *acMolality) const
Get the array of unscaled non-dimensional molality based activity coefficients at the current solutio...
doublereal IMS_slopegCut_
Parameter in the polyExp cutoff treatment.
vector_fp m_Beta0MX_ij_LL
Derivative of Beta0_ij[i][j] wrt TT. Vector index is counterIJ.
void s_updatePitzer_CoeffWRTemp(int doDerivs=2) const
Calculates the Pitzer coefficients' dependence on the temperature.
int m_form_A_Debye
Form of the constant outside the Debye-Huckel term called A.
doublereal s_NBS_CLM_d2lnMolalityActCoeff_dT2() const
Calculate the second temperature derivative of the Chlorine activity coefficient on the NBS scale...
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
vector_int m_CounterIJ
a counter variable for keeping track of symmetric binary interactions amongst the solute species...
vector_fp m_CMX_IJ
Intermediate variable called CMX in Pitzer's paper.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
double m_TempPitzerRef
Reference Temperature for the Pitzer formulations.
vector_fp m_CphiMX_ij_L
Derivative of Cphi_ij[i][j] wrt T. Vector index is counterIJ.
void readXMLPsi(XML_Node &BinSalt)
Process an XML node called "psiCommonAnion" or "psiCommonCation".
vector_fp m_BphiMX_IJ_L
Derivative of BphiMX_IJ wrt T. Vector index is counterIJ.
vector_fp m_g2func_IJ
This is the value of g2(x2) in Pitzer's papers. Vector index is counterIJ.
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...
Array2D m_Lambda_nj
Lambda coefficient for the ij interaction.
void s_update_d2lnMolalityActCoeff_dT2() const
This function calculates the temperature second derivative of the natural logarithm of the molality a...
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
vector_fp m_Phi_IJ_LL
Derivative of m_Phi_IJ wrt TT. Vector index is counterIJ.
virtual doublereal pressure() const
Returns the current pressure of the phase.
virtual std::string type() const
String indicating the thermodynamic model implemented.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized activity concentrations.
vector_fp m_Alpha2MX_ij
Array of 2D data used in the Pitzer/HMW formulation.
vector_fp m_Beta0MX_ij
Array of 2D data used in the Pitzer/HMW formulation.
vector_fp m_BprimeMX_IJ_L
Derivative of BprimeMX wrt T. Vector index is counterIJ.
vector_fp m_BMX_IJ_LL
Derivative of BMX_IJ wrt TT. Vector index is counterIJ.
double m_A_Debye
A_Debye: this expression appears on the top of the ln actCoeff term in the general Debye-Huckel expre...
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
void initLengths()
Initialize all of the species-dependent lengths in the object.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Virtual base class for a species with a pressure dependent standard state.
virtual doublereal relative_molal_enthalpy() const
Excess molar enthalpy of the solution from the mixing process on a molality basis.
void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input...
vector_fp m_gamma_tmp
Intermediate storage of the activity coefficient itself.
void s_update_dlnMolalityActCoeff_dP() const
This function calculates the pressure derivative of the natural logarithm of the molality activity co...
virtual void getActivities(doublereal *ac) const
Get the array of non-dimensional activities at the current solution temperature, pressure, and solution concentration.
doublereal IMS_X_o_cutoff_
value of the solute mole fraction that centers the cutoff polynomials for the cutoff =1 process; ...
vector_fp m_Psi_ijk
Array of 3D data used in the Pitzer/HMW formulation.
Class HMWSoln represents a dilute or concentrated liquid electrolyte phase which obeys the Pitzer for...
void s_updatePitzer_dlnMolalityActCoeff_dP() const
Calculates the Pressure derivative of the natural logarithm of the molality activity coefficients...
vector_fp m_BMX_IJ
Intermediate variable called BMX in Pitzer's paper.
void s_updateScaling_pHScaling_dT() const
Apply the current phScale to a set of derivatives of the activity Coefficients wrt temperature...
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 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...
void s_updateScaling_pHScaling_dT2() const
Apply the current phScale to a set of 2nd derivatives of the activity Coefficients wrt temperature...
vector_fp m_BprimeMX_IJ
Intermediate variable called BprimeMX in Pitzer's paper.
vector_fp m_d2lnActCoeffMolaldT2_Scaled
Derivative of the Logarithm of the activity coefficients on the molality scale wrt TT...
Namespace for the Cantera kernel.
vector_fp m_CphiMX_ij
Array of 2D data used in the Pitzer/HMW formulation.
int m_formPitzerTemp
This is the form of the temperature dependence of Pitzer parameterization used in the model...
void calc_lambdas(double is) const
Calculate the lambda interactions.
vector_fp m_Beta1MX_ij_L
Derivative of Beta1_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.
vector_fp m_Theta_ij_LL
Derivative of Theta_ij[i][j] wrt TT. Vector index is counterIJ.
Array2D m_Theta_ij_coeff
Array of coefficients for Theta_ij[i][j] in the Pitzer/HMW formulation.
virtual doublereal satPressure(doublereal T)
Get the saturation pressure for a given temperature.
Array2D m_Mu_nnn_coeff
Array of coefficients form_Mu_nnn term.
vector_fp m_Mu_nnn_LL
Mu coefficient 2nd temperature derivative for the self-ternary neutral coefficient.
void s_updatePitzer_lnMolalityActCoeff() const
Calculate the Pitzer portion of the activity coefficients.
vector_fp m_BphiMX_IJ_P
Derivative of BphiMX_IJ wrt P. Vector index is counterIJ.
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.
Array2D m_Beta1MX_ij_coeff
Array of coefficients for Beta1, a variable in Pitzer's papers.
vector_fp m_PhiPhi_IJ_L
Derivative of m_PhiPhi_IJ wrt T. Vector index is counterIJ.
double ADebye_L(double temperature=-1.0, double pressure=-1.0) const
Return Pitzer's definition of A_L.
vector_fp m_Beta0MX_ij_P
Derivative of Beta0_ij[i][j] wrt P. Vector index is counterIJ.
vector_fp m_BphiMX_IJ_LL
Derivative of BphiMX_IJ wrt TT. Vector index is counterIJ.
virtual doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.