24 void GibbsExcessVPSSTP::compositionChanged()
26 Phase::compositionChanged();
27 getMoleFractions(moleFractions_.data());
32 void GibbsExcessVPSSTP::calcDensity()
34 vector_fp vbar = getPartialMolarVolumesVector();
35 doublereal vtotal = 0.0;
36 for (
size_t i = 0; i < m_kk; i++) {
37 vtotal += vbar[i] * moleFractions_[i];
39 doublereal dd = meanMolecularWeight() / vtotal;
40 Phase::assignDensity(dd);
45 Units GibbsExcessVPSSTP::standardConcentrationUnits()
const
50 void GibbsExcessVPSSTP::getActivityConcentrations(doublereal* c)
const
55 doublereal GibbsExcessVPSSTP::standardConcentration(
size_t k)
const
60 doublereal GibbsExcessVPSSTP::logStandardConc(
size_t k)
const
65 void GibbsExcessVPSSTP::getActivities(doublereal* ac)
const
67 getActivityCoefficients(ac);
68 getMoleFractions(moleFractions_.data());
69 for (
size_t k = 0; k < m_kk; k++) {
70 ac[k] *= moleFractions_[k];
74 void GibbsExcessVPSSTP::getActivityCoefficients(doublereal*
const ac)
const
76 getLnActivityCoefficients(ac);
77 for (
size_t k = 0; k < m_kk; k++) {
80 }
else if (ac[k] < -700.) {
90 void GibbsExcessVPSSTP::getPartialMolarVolumes(doublereal* vbar)
const
93 getStandardVolumes(vbar);
96 const vector_fp& GibbsExcessVPSSTP::getPartialMolarVolumesVector()
const
98 return getStandardVolumes();
101 double GibbsExcessVPSSTP::checkMFSum(
const doublereal*
const x)
const
103 doublereal norm = std::accumulate(x, x + m_kk, 0.0);
104 if (fabs(norm - 1.0) > 1.0E-9) {
106 "(MF sum - 1) exceeded tolerance of 1.0E-9: {}", norm);
111 bool GibbsExcessVPSSTP::addSpecies(shared_ptr<Species> spec)
113 bool added = VPStandardStateTP::addSpecies(spec);
116 moleFractions_.push_back(1.0);
118 moleFractions_.push_back(0.0);
120 lnActCoeff_Scaled_.push_back(0.0);
121 dlnActCoeffdT_Scaled_.push_back(0.0);
122 d2lnActCoeffdT2_Scaled_.push_back(0.0);
123 dlnActCoeffdlnX_diag_.push_back(0.0);
124 dlnActCoeffdlnN_diag_.push_back(0.0);
125 dlnActCoeffdlnN_.resize(m_kk, m_kk);
Header for intermediate ThermoPhase object for phases which employ Gibbs excess free energy based for...
Base class for exceptions thrown by Cantera classes.
A representation of the units associated with a dimensional quantity.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Namespace for the Cantera kernel.
Contains declarations for string manipulation functions within Cantera.