doxygen update:
Added EdgePhase Worked on test suite: HMW_Test_1 passes now whether Debug_Mode is turned on or not.
This commit is contained in:
parent
6b2b1ad51a
commit
1cd197ea7a
16 changed files with 165 additions and 26 deletions
|
|
@ -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
|
||||
* <thermo model="Edge">
|
||||
* <site_density units="mol/cm"> 3e-15 </site_density>
|
||||
* </thermo>
|
||||
* @endcode
|
||||
*/
|
||||
virtual void setParametersFromXML(const XML_Node& thermoData);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -5252,6 +5252,13 @@ namespace Cantera {
|
|||
}
|
||||
}
|
||||
|
||||
int HMWSoln::debugPrinting() {
|
||||
#ifdef DEBUG_MODE
|
||||
return m_debugCalc;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,3 +5,5 @@ gri_matrix
|
|||
output.txt
|
||||
outputa.txt
|
||||
tmp
|
||||
.depends
|
||||
*.d
|
||||
|
|
|
|||
|
|
@ -4,3 +4,5 @@ diff_test.out
|
|||
gri_pairs
|
||||
outputa.txt
|
||||
csvCode.txt
|
||||
.depends
|
||||
*.d
|
||||
|
|
|
|||
|
|
@ -5,3 +5,5 @@ output.txt
|
|||
csvCode.txt
|
||||
ct2ctml.log
|
||||
diff_test.out
|
||||
.depends
|
||||
*.d
|
||||
|
|
|
|||
|
|
@ -3,3 +3,5 @@ Makefile
|
|||
output.txt
|
||||
csvCode.txt
|
||||
diff_test.out
|
||||
.depends
|
||||
*.d
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -8,3 +8,5 @@ HMW_test_1.d
|
|||
diff_test.out
|
||||
table.csv
|
||||
csvCode.txt
|
||||
CheckDebug.txt
|
||||
output_bc.txt
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
58
test_problems/cathermo/HMW_test_1/output_noD_blessed.txt
Normal file
58
test_problems/cathermo/HMW_test_1/output_noD_blessed.txt
Normal file
|
|
@ -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
|
||||
------------------------------------------------------------
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -21,3 +21,4 @@ testdest2.xml
|
|||
negATest
|
||||
diff_xml.out
|
||||
noxNeg.xml
|
||||
.ctt*
|
||||
|
|
|
|||
|
|
@ -12,3 +12,4 @@ frac_test.out
|
|||
*.txt
|
||||
*.log
|
||||
flame1_blessed_tmp.csv
|
||||
.ctt*
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue