Protect against inf in SurfPhase::getChemPotentials

Fixes #1314
This commit is contained in:
Ray Speth 2023-02-27 23:20:29 -05:00 committed by Ray Speth
parent c3eb05c844
commit 03b7e6b5d4
2 changed files with 1 additions and 3 deletions

View File

@ -108,7 +108,7 @@ void SurfPhase::getChemPotentials(doublereal* mu) const
copy(m_mu0.begin(), m_mu0.end(), mu);
getActivityConcentrations(m_work.data());
for (size_t k = 0; k < m_kk; k++) {
mu[k] += RT() * (log(m_work[k]) - logStandardConc(k));
mu[k] += RT() * (log(std::max(m_work[k], SmallNumber)) - logStandardConc(k));
}
}

View File

@ -267,8 +267,6 @@ ideal-surface:
"Implementation of s_k is incorrect. See GitHub Issue #1313"
s_eq_sum_sk_Xk:
"Implementation of s_k is incorrect. See GitHub Issue #1313"
g_eq_sum_gk_Xk:
"chemPotentials does not protect against inf. See GitHub Issue #1314"
states:
- {T: 800, P: 1 atm, coverages: {Pt(s): 0.5, H(s): 0.4, O(s): 0.1}}
- {T: 800, P: 5 atm, coverages: {H(s): 1.0}}