MolalityVPSSTP.cpp Source File#
MolalityVPSSTP.cpp
Go to the documentation of this file.
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.
Definition AnyMap.h:427
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
Definition AnyMap.cpp:1423
A wrapper for a variable whose type is determined at runtime.
Definition AnyMap.h:86
map< string, T > asMap() const
Return the held AnyMap as a map where all of the values have the specified type.
Definition AnyMap.inl.h:162
Base class for exceptions thrown by Cantera classes.
Definition ctexceptions.h:66
int activityConvention() const override
We set the convention to molality here.
Definition MolalityVPSSTP.cpp:181
void setState(const AnyMap &state) override
Set the state using an AnyMap containing any combination of properties supported by the thermodynamic...
Definition MolalityVPSSTP.cpp:252
void setMolalitiesByName(const Composition &xMap)
Set the molalities of a phase.
Definition MolalityVPSSTP.cpp:105
double m_Mnaught
This is the multiplication factor that goes inside log expressions involving the molalities of specie...
Definition MolalityVPSSTP.h:612
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
Definition MolalityVPSSTP.cpp:269
void getActivityConcentrations(double *c) const override
This method returns an array of generalized concentrations.
Definition MolalityVPSSTP.cpp:186
int pHScale() const
Reports the pH scale, which determines the scale for single-ion activity coefficients.
Definition MolalityVPSSTP.cpp:40
virtual void getMolalityActivityCoefficients(double *acMolality) const
Get the array of non-dimensional molality based activity coefficients at the current solution tempera...
Definition MolalityVPSSTP.cpp:210
void setpHScale(const int pHscaleType)
Set the pH scale, which determines the scale for single-ion activity coefficients.
Definition MolalityVPSSTP.cpp:31
double m_xmolSolventMIN
In any molality implementation, it makes sense to have a minimum solvent mole fraction requirement,...
Definition MolalityVPSSTP.h:607
vector< double > m_molalities
Current value of the molalities of the species in the phase.
Definition MolalityVPSSTP.h:616
virtual void applyphScale(double *acMolality) const
Apply the current phScale to a set of activity Coefficients or activities.
Definition MolalityVPSSTP.cpp:282
int m_pHScalingType
Scaling to be used for output of single-ion species activity coefficients.
Definition MolalityVPSSTP.h:588
void setMolalities(const double *const molal)
Set the molalities of the solutes in a phase.
Definition MolalityVPSSTP.cpp:78
void getMolalities(double *const molal) const
This function will return the molalities of the species.
Definition MolalityVPSSTP.cpp:70
void setMoleFSolventMin(double xmolSolventMIN)
Sets the minimum mole fraction in the molality formulation.
Definition MolalityVPSSTP.cpp:45
virtual double osmoticCoefficient() const
Calculate the osmotic coefficient.
Definition MolalityVPSSTP.cpp:216
double moleFSolventMin() const
Returns the minimum mole fraction in the molality formulation.
Definition MolalityVPSSTP.cpp:55
void setState_TPM(double t, double p, const double *const molalities)
Set the temperature (K), pressure (Pa), and molalities (gmol kg-1) of the solutes.
Definition MolalityVPSSTP.cpp:234
void getActivities(double *ac) const override
Get the array of non-dimensional activities (molality based for this class and classes that derive fr...
Definition MolalityVPSSTP.cpp:196
virtual void getUnscaledMolalityActivityCoefficients(double *acMolality) const
Get the array of unscaled non-dimensional molality based activity coefficients at the current solutio...
Definition MolalityVPSSTP.cpp:277
void calcMolalities() const
Calculates the molality of all species and stores the result internally.
Definition MolalityVPSSTP.cpp:60
double standardConcentration(size_t k=0) const override
Return the standard concentration for the kth species.
Definition MolalityVPSSTP.cpp:191
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Definition MolalityVPSSTP.cpp:343
void getActivityCoefficients(double *ac) const override
Get the array of non-dimensional activity coefficients at the current solution temperature,...
Definition MolalityVPSSTP.cpp:201
string report(bool show_thermo=true, double threshold=1e-14) const override
returns a summary of the state of the phase as a string
Definition MolalityVPSSTP.cpp:357
An error indicating that an unimplemented function has been called.
Definition ctexceptions.h:195
virtual void setMoleFractions(const double *const x)
Set the mole fractions to the specified values.
Definition Phase.cpp:289
void getMoleFractions(double *const x) const
Get the species mole fraction vector.
Definition Phase.cpp:434
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
Definition Phase.cpp:129
double moleFraction(size_t k) const
Return the mole fraction of a single species.
Definition Phase.cpp:439
double nAtoms(size_t k, size_t m) const
Number of atoms of element m in species k.
Definition Phase.cpp:103
const vector< string > & speciesNames() const
Return a const reference to the vector of species names.
Definition Phase.cpp:148
double charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
Definition Phase.h:538
double electricPotential() const
Returns the electric potential of this phase (V).
Definition ThermoPhase.h:621
virtual double cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
Definition ThermoPhase.h:545
virtual void setState(const AnyMap &state)
Set the state using an AnyMap containing any combination of properties supported by the thermodynamic...
Definition ThermoPhase.cpp:145
bool m_chargeNeutralityNecessary
Boolean indicating whether a charge neutrality condition is a necessity.
Definition ThermoPhase.h:1979
virtual void getChemPotentials(double *mu) const
Get the species chemical potentials. Units: J/kmol.
Definition ThermoPhase.h:775
double cp_mass() const
Specific heat at constant pressure. Units: J/kg/K.
Definition ThermoPhase.h:1048
virtual double cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
Definition ThermoPhase.h:550
virtual double intEnergy_mole() const
Molar internal energy. Units: J/kmol.
Definition ThermoPhase.h:530
double pressure() const override
Returns the current pressure of the phase.
Definition VPStandardStateTP.h:118
void getStandardChemPotentials(double *mu) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Definition VPStandardStateTP.cpp:38
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
Definition VPStandardStateTP.cpp:142
void setState_TP(double T, double pres) override
Set the temperature and pressure at the same time.
Definition VPStandardStateTP.cpp:205
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Definition VPStandardStateTP.cpp:164
void fmt_append(fmt::memory_buffer &b, Args... args)
Versions 6.2.0 and 6.2.1 of fmtlib do not include this define before they include windows....
Definition fmt.h:29
Composition parseCompString(const string &ss, const vector< string > &names)
Parse a composition string into a map consisting of individual key:composition pairs.
Definition stringUtils.cpp:58
const int PHSCALE_PITZER
Scale to be used for the output of single-ion activity coefficients is that used by Pitzer.
Definition MolalityVPSSTP.h:44
const int PHSCALE_NBS
Scale to be used for evaluation of single-ion activity coefficients is that used by the NBS standard ...
Definition MolalityVPSSTP.h:69
const U & getValue(const map< T, U > &m, const T &key, const U &default_val)
Const accessor for a value in a map.
Definition utilities.h:190
const int cAC_CONVENTION_MOLALITY
Standard state uses the molality convention.
Definition ThermoPhase.h:137
Contains declarations for string manipulation functions within Cantera.
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...
Generated by