11#ifndef CT_IONSFROMNEUTRALVPSSTP_H
12#define CT_IONSFROMNEUTRALVPSSTP_H
26 cIonSolnType_PASSTHROUGH = 2000 ,
27 cIonSolnType_SINGLEANION ,
28 cIonSolnType_SINGLECATION ,
29 cIonSolnType_MULTICATIONANION
88 string type()
const override {
89 return "IonsFromNeutral";
104 double cp_mole()
const override;
105 double cv_mole()
const override;
164 double* dlnActCoeffds)
const override;
182 vector<double>& charges, vector<size_t>& neutMolIndex)
const;
255 bool addSpecies(shared_ptr<Species> spec)
override;
256 void setNeutralMoleculePhase(shared_ptr<ThermoPhase> neutral);
257 shared_ptr<ThermoPhase> getNeutralMoleculePhase();
395 mutable vector<double> y_;
396 mutable vector<double> dlnActCoeff_NeutralMolecule_;
397 mutable vector<double> dX_NeutralMolecule_;
398 mutable vector<double> m_work;
Header for intermediate ThermoPhase object for phases which employ Gibbs excess free energy based for...
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.
GibbsExcessVPSSTP is a derived class of ThermoPhase that handles variable pressure standard state met...
The IonsFromNeutralVPSSTP is a derived class of ThermoPhase that handles the specification of the che...
vector< double > lnActCoeff_NeutralMolecule_
Storage vector for the neutral molecule ln activity coefficients.
vector< size_t > anionList_
List of the species in this ThermoPhase which are anion species.
void getdlnActCoeffds(const double dTds, const double *const dXds, double *dlnActCoeffds) const override
Get the change in activity coefficients wrt changes in state (temp, mole fraction,...
double enthalpy_mole() const override
Return the Molar enthalpy. Units: J/kmol.
AnyMap m_rootNode
Root node of the AnyMap which contains this phase definition.
vector< double > dlnActCoeffdlnX_diag_NeutralMolecule_
Storage vector for the neutral molecule d ln activity coefficients dX - diagonal component.
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
void getChemPotentials(double *mu) const override
Get the species chemical potentials. Units: J/kmol.
void getDissociationCoeffs(vector< double > &fm_neutralMolec_ions, vector< double > &charges, vector< size_t > &neutMolIndex) const
Get the Salt Dissociation Coefficients.
virtual void calcNeutralMoleculeMoleFractions() const
Calculate neutral molecule mole fractions.
void getCationList(vector< size_t > &cation) const
Get the list of cations in this object.
virtual void calcIonMoleFractions(double *const mf) const
Calculate ion mole fractions from neutral molecule mole fractions.
vector< size_t > fm_invert_ionForNeutral
Mapping between ion species and neutral molecule for quick invert.
vector< double > muNeutralMolecule_
Storage vector for the neutral molecule chemical potentials.
void s_update_dlnActCoeff_dlnN_diag() const
Update the derivative of the log of the activity coefficients wrt log(number of moles) - diagonal com...
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 getNeutralMolecMoleFractions(vector< double > &neutralMoleculeMoleFractions) const
Return the current value of the neutral mole fraction vector.
vector< double > fm_neutralMolec_ions_
Formula Matrix for composition of neutral molecules in terms of the molecules in this ThermoPhase.
size_t indexSpecialSpecies_
Index of special species.
double cv_mole() const override
Molar heat capacity at constant volume. Units: J/kmol/K.
vector< double > dlnActCoeffdlnN_diag_NeutralMolecule_
Storage vector for the neutral molecule d ln activity coefficients dlnN.
vector< size_t > cationList_
List of the species in this ThermoPhase which are cation species.
Array2D dlnActCoeffdlnN_NeutralMolecule_
Storage vector for the neutral molecule d ln activity coefficients dlnN.
void s_update_dlnActCoeff_dlnN() const
Update the derivative of the log of the activity coefficients wrt log(number of moles) - diagonal com...
void getAnionList(vector< size_t > &anion) const
Get the list of anions in this object.
double entropy_mole() const override
Molar entropy. Units: J/kmol/K.
void calcDensity() override
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
shared_ptr< ThermoPhase > neutralMoleculePhase_
This is a pointer to the neutral Molecule Phase.
vector< double > dlnActCoeffdT_NeutralMolecule_
Storage vector for the neutral molecule d ln activity coefficients dT.
size_t numNeutralMoleculeSpecies_
Number of neutral molecule species.
double cp_mole() const override
Molar heat capacity at constant pressure. Units: J/kmol/K.
void compositionChanged() override
Apply changes to the state which are needed after the composition changes.
vector< double > moleFractionsTmp_
Temporary mole fraction vector.
void s_update_dlnActCoeff_dlnX_diag() const
Update the derivative of the log of the activity coefficients wrt log(mole fraction)
void s_update_lnActCoeff() const
Update the activity coefficients.
double gibbs_mole() const override
Molar Gibbs function. Units: J/kmol.
vector< size_t > passThroughList_
List of the species in this ThermoPhase which are passed through to the neutralMoleculePhase ThermoPh...
void getdlnActCoeffdlnX_diag(double *dlnActCoeffdlnX_diag) const override
Get the array of ln mole fraction derivatives of the log activity coefficients - diagonal component o...
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
void getdlnActCoeffdlnN_diag(double *dlnActCoeffdlnN_diag) const override
Get the array of log species mole number derivatives of the log activity coefficients.
void getActivityCoefficients(double *ac) const override
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
void s_update_dlnActCoeffdT() const
Update the temperature derivative of the ln activity coefficients.
void setParameters(const AnyMap &phaseNode, const AnyMap &rootNode=AnyMap()) override
Set equation of state parameters from an AnyMap phase description.
vector< double > NeutralMolecMoleFractions_
Mole fractions using the Neutral Molecule Mole fraction basis.
void getNeutralMoleculeMoleGrads(const double *const dx, double *const dy) const
Calculate neutral molecule mole fractions.
IonSolnType_enumType ionSolnType_
Ion solution type.
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies for the species in the mixture.
void s_update_dlnActCoeff() const
Update the change in the ln activity coefficients.
void getdlnActCoeffdlnN(const size_t ld, double *const dlnActCoeffdlnN) override
Get the array of derivatives of the log activity coefficients with respect to the log of the species ...
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
IonSolnType_enumType
enums for molten salt ion solution types