diff --git a/Cantera/src/EdgePhase.h b/Cantera/src/EdgePhase.h index 4aab9310e..221dd46e7 100644 --- a/Cantera/src/EdgePhase.h +++ b/Cantera/src/EdgePhase.h @@ -1,7 +1,7 @@ /** * * @file EdgePhase.h - * + * Declarations for the EdgePhase thermodynamic object. */ /* $Author$ @@ -12,7 +12,6 @@ * */ - #ifndef CT_EDGEPHASE_H #define CT_EDGEPHASE_H @@ -22,15 +21,58 @@ namespace Cantera { - class EdgePhase : public SurfPhase { + //! A thermodynamic %Phase representing a one dimensional edge between two surfaces + /*! + * This thermodynamic function is largely a wrapper around the SurfPhase + * thermodynamic object. + * + * All of the equations and formulations carry through from SurfPhase to this + * EdgePhase object. + * It should be noted however, that dimensional object with length dimensions, + * have their dimensions reduced by one. + * + * @ingroup thermoprops + */ + class EdgePhase : public SurfPhase { + + public: + + //! Constructor + /*! + * @param n0 Surface site density (kmol m-1). + */ + EdgePhase(doublereal n0 = 0.0); - public: + //! Destructor + virtual ~EdgePhase() {} - EdgePhase(doublereal n0 = 0.0); - virtual ~EdgePhase() {} - virtual int eosType() const { return cEdge; } - virtual void setParametersFromXML(const XML_Node& eosdata); - }; + //! returns the equation of state type + virtual int eosType() const { return cEdge; } + + + //! Set the Equation-of-State parameters by reading an XML Node Input + /*! + * + * The Equation-of-State data consists of one item, the site density. + * + * @param thermoData Reference to an XML_Node named thermo + * containing the equation-of-state data. The + * XML_Node is within the phase XML_Node describing + * the %EdgePhase object. + * + * An example of the contents of the thermoData XML_Node is provided + * below. The units attribute is used to supply the units of the + * site density in any convenient form. Internally it is changed + * into MKS form. + * + * @code + * + * 3e-15 + * + * @endcode + */ + virtual void setParametersFromXML(const XML_Node& thermoData); + }; } #endif diff --git a/Cantera/src/ThermoPhase.h b/Cantera/src/ThermoPhase.h index 8f872d478..a395a2d4d 100755 --- a/Cantera/src/ThermoPhase.h +++ b/Cantera/src/ThermoPhase.h @@ -89,6 +89,7 @@ namespace Cantera { * - IdealGasPhase in IdealGasPhase.h * - StoichSubstance in StoichSubstance.h * - SurfPhase in SurfPhase.h + * - EdgePhase in EdgePhase.h * - LatticePhase in LatticePhase.h * - LatticeSolidPhase in LatticeSolidPhase.h * - ConstDensityThermo in ConstDensityThermo.h diff --git a/Cantera/src/thermo/HMWSoln.cpp b/Cantera/src/thermo/HMWSoln.cpp index 6b9a2ed0c..1af0b911e 100644 --- a/Cantera/src/thermo/HMWSoln.cpp +++ b/Cantera/src/thermo/HMWSoln.cpp @@ -5252,6 +5252,13 @@ namespace Cantera { } } + int HMWSoln::debugPrinting() { +#ifdef DEBUG_MODE + return m_debugCalc; +#else + return 0; +#endif + } /*****************************************************************************/ } diff --git a/Cantera/src/thermo/HMWSoln.h b/Cantera/src/thermo/HMWSoln.h index b32817a84..8ef0279f2 100644 --- a/Cantera/src/thermo/HMWSoln.h +++ b/Cantera/src/thermo/HMWSoln.h @@ -1447,11 +1447,16 @@ namespace Cantera { public: - /* - * Turn on copious debug printing + /*! + * Turn on copious debug printing when this + * is true and DEBUG_MODE is turned on. */ mutable int m_debugCalc; - + //! Return int specifying the amount of debug printing + /*! + * This will return 0 if DEBUG_MODE is not turned on + */ + int debugPrinting(); }; } diff --git a/test_problems/ChemEquil_gri_matrix/.cvsignore b/test_problems/ChemEquil_gri_matrix/.cvsignore index 945b4c162..1a696f873 100644 --- a/test_problems/ChemEquil_gri_matrix/.cvsignore +++ b/test_problems/ChemEquil_gri_matrix/.cvsignore @@ -5,3 +5,5 @@ gri_matrix output.txt outputa.txt tmp +.depends +*.d diff --git a/test_problems/ChemEquil_gri_pairs/.cvsignore b/test_problems/ChemEquil_gri_pairs/.cvsignore index 292072d37..f52eb8f65 100644 --- a/test_problems/ChemEquil_gri_pairs/.cvsignore +++ b/test_problems/ChemEquil_gri_pairs/.cvsignore @@ -4,3 +4,5 @@ diff_test.out gri_pairs outputa.txt csvCode.txt +.depends +*.d diff --git a/test_problems/ChemEquil_ionizedGas/.cvsignore b/test_problems/ChemEquil_ionizedGas/.cvsignore index 63d34f59c..59f637038 100644 --- a/test_problems/ChemEquil_ionizedGas/.cvsignore +++ b/test_problems/ChemEquil_ionizedGas/.cvsignore @@ -5,3 +5,5 @@ output.txt csvCode.txt ct2ctml.log diff_test.out +.depends +*.d diff --git a/test_problems/ChemEquil_red1/.cvsignore b/test_problems/ChemEquil_red1/.cvsignore index 76225eb0f..010199256 100644 --- a/test_problems/ChemEquil_red1/.cvsignore +++ b/test_problems/ChemEquil_red1/.cvsignore @@ -3,3 +3,5 @@ Makefile output.txt csvCode.txt diff_test.out +.depends +*.d diff --git a/test_problems/Makefile.in b/test_problems/Makefile.in index dc8c242e6..eaf43ae30 100644 --- a/test_problems/Makefile.in +++ b/test_problems/Makefile.in @@ -42,17 +42,17 @@ test: @ cd ChemEquil_ionizedGas; @MAKE@ -s test @ cd ChemEquil_red1; @MAKE@ -s test ifeq ($(test_ck),1) - @ cd ck2cti_test; @MAKE@ test + @ cd ck2cti_test; @MAKE@ -s test endif ifeq ($(test_python),1) - cd min_python; @MAKE@ test + cd min_python; @MAKE@ -s test endif ifeq ($(test_python),2) - cd min_python; @MAKE@ test - cd python; @MAKE@ test + cd min_python; @MAKE@ -s test + cd python; @MAKE@ -s test endif ifeq ($(test_cathermo),1) - cd cathermo; @MAKE@ test + cd cathermo; @MAKE@ -s test endif clean: diff --git a/test_problems/cathermo/HMW_test_1/.cvsignore b/test_problems/cathermo/HMW_test_1/.cvsignore index 004da4fdc..b2f67c9a9 100644 --- a/test_problems/cathermo/HMW_test_1/.cvsignore +++ b/test_problems/cathermo/HMW_test_1/.cvsignore @@ -8,3 +8,5 @@ HMW_test_1.d diff_test.out table.csv csvCode.txt +CheckDebug.txt +output_bc.txt diff --git a/test_problems/cathermo/HMW_test_1/HMW_test_1.cpp b/test_problems/cathermo/HMW_test_1/HMW_test_1.cpp index 5e088e596..8eb5157b9 100644 --- a/test_problems/cathermo/HMW_test_1/HMW_test_1.cpp +++ b/test_problems/cathermo/HMW_test_1/HMW_test_1.cpp @@ -56,14 +56,20 @@ int main(int argc, char **argv) try { -#ifdef DEBUG_MODE - CHECK_DEBUG_MODE = 1; -#endif - if (CHECK_DEBUG_MODE != 1) { - printf("Check can only be done if DEBUG_MODE is defined\n"); - exit(-1); - } HMWSoln *HMW = new HMWSoln(1); + +#ifdef DEBUG_MODE + CHECK_DEBUG_MODE = 1; +#endif + if (CHECK_DEBUG_MODE == 1) { + HMW->m_debugCalc = 1; + if (HMW->debugPrinting()) { + FILE *ff = fopen("CheckDebug.txt", "w"); + fprintf(ff,"%1d\n", 1); + fclose(ff); + } + HMW->m_debugCalc = 0; + } int nsp = HMW->nSpecies(); diff --git a/test_problems/cathermo/HMW_test_1/output_noD_blessed.txt b/test_problems/cathermo/HMW_test_1/output_noD_blessed.txt new file mode 100644 index 000000000..9e23f36f4 --- /dev/null +++ b/test_problems/cathermo/HMW_test_1/output_noD_blessed.txt @@ -0,0 +1,58 @@ +Index Name MoleF Molality Charge + 0 H2O(L) 8.1992706e-01 5.5508435e+01 0.0 + 1 Cl- 9.0036447e-02 6.0953986e+00 -1.0 + 2 H+ 3.1947185e-11 2.1628000e-09 1.0 + 3 Na+ 9.0036468e-02 6.0954000e+00 1.0 + 4 OH- 2.0645728e-08 1.3977000e-06 -1.0 + + Species Species beta0MX beta1MX beta2MX CphiMX alphaMX thetaij + Cl- H+ 0.17750 0.29450 0.00000 0.00080 2.00000 0.00000 + Cl- Na+ 0.07650 0.26640 0.00000 0.00127 2.00000 0.00000 + Cl- OH- 0.00000 0.00000 0.00000 0.00000 0.00000 -0.05000 + H+ Na+ 0.00000 0.00000 0.00000 0.00000 0.00000 0.03600 + H+ OH- 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 + Na+ OH- 0.08640 0.25300 0.00000 0.00440 2.00000 0.00000 + + Species Species Species psi + Cl- H+ Na+ -0.00400 + Cl- Na+ H+ -0.00400 + Cl- Na+ OH- -0.00600 + Cl- OH- Na+ -0.00600 + H+ Cl- Na+ -0.00400 + H+ Na+ Cl- -0.00400 + Na+ Cl- H+ -0.00400 + Na+ Cl- OH- -0.00600 + Na+ H+ Cl- -0.00400 + Na+ OH- Cl- -0.00600 + OH- Cl- Na+ -0.00600 + OH- Na+ Cl- -0.00600 +a1 = 3.04284e-10 +a2 = 3.04284e-10 + Name Activity ActCoeffMolal MoleFract Molality + H2O(L) 0.754581 0.92042 0.819823 55.5084 + Cl- 6.09579 0.999359 0.0900885 6.0997 + H+ 1.00009e-08 4.62404 3.19431e-11 2.1628e-09 + Na+ 6.09579 0.999359 0.0900885 6.0997 + OH- 7.5986e-07 0.54365 2.06431e-08 1.3977e-06 + Species Standard chemical potentials (kJ/gmol) +------------------------------------------------------------ + H2O(L) -306.685777 + Cl- -131.064852 + H+ 0.0017225 + Na+ -311.160543 + OH- -226.880122 +------------------------------------------------------------ + Some DeltaSS values: Delta(mu_0) + NaCl(S): Na+ + Cl- -> NaCl(S): 9.594995 kJ/gmol + : 3.870573 (dimensionless) + : 1.680969 (dimensionless/ln10) + G0(NaCl(S)) = -432.6304 (fixed) + G0(Na+) = -311.1605 + G0(Cl-) = -131.0649 + OH-: H2O(L) - H+ -> OH-: 79.80738 kJ/gmol + : 32.1939 (dimensionless) + : 13.98163 (dimensionless/ln10) + G0(OH-) = -226.8801 + G0(H+) = 0.0017225 + G0(H2O(L)) = -306.6858 +------------------------------------------------------------ diff --git a/test_problems/cathermo/HMW_test_1/runtest b/test_problems/cathermo/HMW_test_1/runtest index 621e5eb70..fb5c26b83 100755 --- a/test_problems/cathermo/HMW_test_1/runtest +++ b/test_problems/cathermo/HMW_test_1/runtest @@ -12,6 +12,7 @@ if test ! -x $prog ; then fi ########################################################################## /bin/rm -f test.out test.diff output.txt +/bin/rm -f CheckDebug.txt output_bc.txt ################################################################# # @@ -29,7 +30,14 @@ then fi $CANTERA_BIN/exp3to2.sh output.txt > outputa.txt -diff -w outputa.txt output_blessed.txt > diff_test.out +if [ -f CheckDebug.txt ] +then + cp output_blessed.txt output_bc.txt +else + cp output_noD_blessed.txt output_bc.txt +fi + +diff -w outputa.txt output_bc.txt > diff_test.out retnStat=$? if [ $retnStat = "0" ] then diff --git a/test_problems/min_python/negATest/.cvsignore b/test_problems/min_python/negATest/.cvsignore index e8aee5a04..bc5d02bc8 100644 --- a/test_problems/min_python/negATest/.cvsignore +++ b/test_problems/min_python/negATest/.cvsignore @@ -21,3 +21,4 @@ testdest2.xml negATest diff_xml.out noxNeg.xml +.ctt* diff --git a/test_problems/python/.cvsignore b/test_problems/python/.cvsignore index c56e7b82c..1212ade91 100644 --- a/test_problems/python/.cvsignore +++ b/test_problems/python/.cvsignore @@ -12,3 +12,4 @@ frac_test.out *.txt *.log flame1_blessed_tmp.csv +.ctt* diff --git a/tools/doc/Cantera.cfg.in b/tools/doc/Cantera.cfg.in index 022eed4ce..71d2150b6 100755 --- a/tools/doc/Cantera.cfg.in +++ b/tools/doc/Cantera.cfg.in @@ -102,7 +102,7 @@ FILE_PATTERNS = Kinetics.h Kinetics.cpp \ importCTML.cpp importCTML.h \ ThermoFactory.h ThermoFactory.cpp \ IdealGasPhase.h IdealGasPhase.cpp \ - SurfPhase.h SurfPhase.cpp \ + SurfPhase.h EdgePhase.h SurfPhase.cpp \ SpeciesThermoFactory.h SpeciesThermoFactory.cpp \ speciesThermoTypes.h SpeciesThermoMgr.h SpeciesThermo.h SpeciesThermoInterpTypes.h \ NasaThermo.h NasaPoly1.h NasaPoly2.h \