Fixed an error with the calculate of standard state quantities other

than the Gibbs free energy.
This commit is contained in:
Harry Moffat 2008-08-27 17:07:25 +00:00
parent 94c066d1a4
commit ceb0d1fccc
2 changed files with 21 additions and 15 deletions

View file

@ -202,8 +202,8 @@ namespace Cantera {
}
doublereal PDSS::enthalpy_RT() const {
err("enthalpy_RT()");
return (0.0);
double RT = GasConstant * m_temp;
return (enthalpy_mole()/RT);
}
// Return the molar internal Energy in units of J kmol-1
@ -231,8 +231,7 @@ namespace Cantera {
}
doublereal PDSS::entropy_R() const {
err("entropy_R()");
return (0.0);
return(entropy_mole()/GasConstant);
}
// Return the molar gibbs free energy in units of J kmol-1
@ -248,8 +247,8 @@ namespace Cantera {
}
doublereal PDSS::gibbs_RT() const {
err("gibbs_RT()");
return (0.0);
double RT = GasConstant * m_temp;
return (gibbs_mole()/RT);
}
// Return the molar const pressure heat capacity in units of J kmol-1 K-1
@ -265,8 +264,7 @@ namespace Cantera {
}
doublereal PDSS::cp_R() const {
err("cp_R()");
return (0.0);
return (cp_mole()/GasConstant);
}
doublereal PDSS::molarVolume() const {

View file

@ -163,11 +163,20 @@ namespace Cantera {
m_g0_RT[0] = (m_hss_RT[0] - m_sss_R[0]);
m_V0[0] = (m_waterSS->density()) / m_vptp_ptr->molecularWeight(0);
m_waterSS->setState_TP(m_tlast, m_plast);
for (int k = 1; k < m_kk; k++) {
PDSS_HKFT *ps = (PDSS_HKFT *) m_vptp_ptr->providePDSS(k);
ps->setState_TP(m_tlast, m_p0);
m_cpss_R[k] = ps->cp_R();
m_sss_R[k] = ps->entropy_mole();
m_gss_RT[k] = ps->gibbs_RT();;
m_hss_RT[k] = m_gss_RT[k] + m_sss_R[k];
m_Vss[k] = ps->molarVolume();
}
}
void VPSSMgr_Water_HKFT::_updateStandardStateThermo() {
doublereal RT = GasConstant * m_tlast;
doublereal del_pRT = (m_plast - m_p0) / (RT);
// Do the water
m_waterSS->setState_TP(m_tlast, m_plast);
m_hss_RT[0] = (m_waterSS->enthalpy_mole())/ RT;
@ -179,12 +188,11 @@ namespace Cantera {
for (int k = 1; k < m_kk; k++) {
PDSS_HKFT *ps = (PDSS_HKFT *) m_vptp_ptr->providePDSS(k);
ps->setState_TP(m_tlast, m_plast);
m_hss_RT[k] = m_h0_RT[k] + del_pRT * m_Vss[k];
m_cpss_R[k] = m_cp0_R[k];
m_sss_R[k] = m_s0_R[k];
m_gss_RT[k] = ps->gibbs_mole() / RT;
m_cpss_R[k] = ps->cp_R();
m_sss_R[k] = ps->entropy_R();
m_gss_RT[k] = ps->gibbs_RT();;
m_hss_RT[k] = m_gss_RT[k] + m_sss_R[k];
m_Vss[k] = ps->molarVolume();
}
}