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::setDensity(dd);
44 void GibbsExcessVPSSTP::getActivityConcentrations(doublereal* c)
const 49 doublereal GibbsExcessVPSSTP::standardConcentration(
size_t k)
const 54 doublereal GibbsExcessVPSSTP::logStandardConc(
size_t k)
const 59 void GibbsExcessVPSSTP::getActivities(doublereal* ac)
const 61 getActivityCoefficients(ac);
62 getMoleFractions(moleFractions_.data());
63 for (
size_t k = 0; k < m_kk; k++) {
64 ac[k] *= moleFractions_[k];
68 void GibbsExcessVPSSTP::getActivityCoefficients(doublereal*
const ac)
const 70 getLnActivityCoefficients(ac);
71 for (
size_t k = 0; k < m_kk; k++) {
74 }
else if (ac[k] < -700.) {
84 void GibbsExcessVPSSTP::getPartialMolarVolumes(doublereal* vbar)
const 87 getStandardVolumes(vbar);
90 const vector_fp& GibbsExcessVPSSTP::getPartialMolarVolumesVector()
const 92 return getStandardVolumes();
95 double GibbsExcessVPSSTP::checkMFSum(
const doublereal*
const x)
const 97 doublereal norm = std::accumulate(x, x + m_kk, 0.0);
98 if (fabs(norm - 1.0) > 1.0E-9) {
100 "(MF sum - 1) exceeded tolerance of 1.0E-9: {}", norm);
105 bool GibbsExcessVPSSTP::addSpecies(shared_ptr<Species> spec)
107 bool added = VPStandardStateTP::addSpecies(spec);
110 moleFractions_.push_back(1.0);
112 moleFractions_.push_back(0.0);
114 lnActCoeff_Scaled_.push_back(0.0);
115 dlnActCoeffdT_Scaled_.push_back(0.0);
116 d2lnActCoeffdT2_Scaled_.push_back(0.0);
117 dlnActCoeffdlnX_diag_.push_back(0.0);
118 dlnActCoeffdlnN_diag_.push_back(0.0);
119 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.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Contains declarations for string manipulation functions within Cantera.
Namespace for the Cantera kernel.