[Thermo] Implement missing SurfPhase functions
Adding the entropy_mole, cp_mole, and cv_mole functions fixes the silent failure of the report() function for surface phases.
This commit is contained in:
parent
6ffbaa5f77
commit
01987b4438
2 changed files with 34 additions and 0 deletions
|
|
@ -228,6 +228,18 @@ public:
|
|||
*/
|
||||
virtual doublereal intEnergy_mole() const;
|
||||
|
||||
//! Return the Molar Entropy. Units: J/kmol-K
|
||||
/**
|
||||
* \f[
|
||||
* \hat s(T,P) = \sum_k X_k (\hat s^0_k(T) - R \log(\theta_k))
|
||||
* \f]
|
||||
*/
|
||||
virtual doublereal entropy_mole() const;
|
||||
|
||||
virtual doublereal cp_mole() const;
|
||||
|
||||
virtual doublereal cv_mole() const;
|
||||
|
||||
//! Get the species chemical potentials. Units: J/kmol.
|
||||
/*!
|
||||
* This function returns a vector of chemical potentials of the
|
||||
|
|
|
|||
|
|
@ -113,6 +113,28 @@ doublereal SurfPhase::intEnergy_mole() const
|
|||
return enthalpy_mole();
|
||||
}
|
||||
|
||||
doublereal SurfPhase::entropy_mole() const
|
||||
{
|
||||
_updateThermo();
|
||||
doublereal s = 0.0;
|
||||
for (size_t k = 0; k < m_kk; k++) {
|
||||
s += moleFraction(k) * (m_s0[k] -
|
||||
GasConstant * log(std::max(concentration(k) * size(k)/m_n0, SmallNumber)));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
doublereal SurfPhase::cp_mole() const
|
||||
{
|
||||
_updateThermo();
|
||||
return mean_X(&m_cp0[0]);
|
||||
}
|
||||
|
||||
doublereal SurfPhase::cv_mole() const
|
||||
{
|
||||
return cp_mole();
|
||||
}
|
||||
|
||||
void SurfPhase::getPartialMolarEnthalpies(doublereal* hbar) const
|
||||
{
|
||||
getEnthalpy_RT(hbar);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue