From 5479bcf10bf73bec8b6c7c15e08d0dc71ecfa903 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Mon, 25 Aug 2008 03:19:59 +0000 Subject: [PATCH] Added a check to make sure the delta H formation reaction value is consistent with G and S. It's actually redundant. --- Cantera/src/thermo/PDSS_HKFT.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Cantera/src/thermo/PDSS_HKFT.cpp b/Cantera/src/thermo/PDSS_HKFT.cpp index 442f97012..2bd59bf00 100644 --- a/Cantera/src/thermo/PDSS_HKFT.cpp +++ b/Cantera/src/thermo/PDSS_HKFT.cpp @@ -429,13 +429,26 @@ namespace Cantera { m_Y_pr_tr = drelepsilondT / (relepsilon * relepsilon); //printf("m_Y_pr_tr = %20.10g\n", m_Y_pr_tr ); + m_waterProps = new WaterProps(m_waterSS); + m_presR_bar = OneAtm / 1.0E5; m_charge_j = m_tp->charge(m_spindex); convertDGFormation(); - m_waterProps = new WaterProps(m_waterSS); + //! Ok, we have mu. Let's check it against the input value + // of DH_F to see that we have some internal consistency + double Hcalc = m_Mu0_tr_pr + 298.15 * (m_Entrop_tr_pr * 1.0E3 * 4.184); + double DHjmol = m_deltaH_formation_tr_pr * 1.0E3 * 4.184; + + // If the discrepency is greater than 100 cal gmol-1, print + // an error and exit. + if (fabs(Hcalc -DHjmol) > 100.* 1.0E3 * 4.184) { + throw CanteraError(" PDSS_HKFT::initThermo()", + "DHjmol is not consistent with G and S" + fp2str(Hcalc) + " vs " + fp2str(DHjmol)); + } + } @@ -591,11 +604,6 @@ namespace Cantera { - - - - - double PDSS_HKFT::deltaG() const { double pbar = m_pres * 1.0E-5;