diff --git a/Cantera/python/examples/transport/.cvsignore b/Cantera/python/examples/transport/.cvsignore index f3c7a7c5d..40dc23c25 100644 --- a/Cantera/python/examples/transport/.cvsignore +++ b/Cantera/python/examples/transport/.cvsignore @@ -1 +1,7 @@ Makefile +ct2ctml.log +diff_out_0.txt +h2o2.xml +output_0.txt +runtest +transport_log.xml diff --git a/Cantera/python/examples/transport/Makefile.in b/Cantera/python/examples/transport/Makefile.in index 73cf4f97d..ccbb43e79 100644 --- a/Cantera/python/examples/transport/Makefile.in +++ b/Cantera/python/examples/transport/Makefile.in @@ -1,16 +1,17 @@ #!/bin/sh -PY_DEMOS = dustygas.py PYTHON_CMD = @PYTHON_CMD@ -run: - @(for py in $(PY_DEMOS) ; do \ - echo "running $${py}..."; \ - $(PYTHON_CMD) "$${py}"; \ - done) +all + $(PYTHON_CMD) dustygas.py +run: + $(PYTHON_CMD) dustygas.py + +test: + ./runtest clean: - rm -f *.log *.csv *.xml + ./cleanup # end of file diff --git a/Cantera/python/examples/transport/cleanup b/Cantera/python/examples/transport/cleanup new file mode 100755 index 000000000..3e75eafa7 --- /dev/null +++ b/Cantera/python/examples/transport/cleanup @@ -0,0 +1,4 @@ +#!/bin/sh +# +/bin/rm -rf .cttmp* ct2ctml.log transport_log.xml vcs_equilibrate_res*.csv \ + diff_out_0.txt h2o2.xml ct2ctml.log output_0.txt diff --git a/Cantera/python/examples/transport/dustygas.py b/Cantera/python/examples/transport/dustygas.py index 60bb85354..fbf840391 100644 --- a/Cantera/python/examples/transport/dustygas.py +++ b/Cantera/python/examples/transport/dustygas.py @@ -16,7 +16,7 @@ from Cantera.DustyGasTransport import * g = importPhase('h2o2.cti') # set the gas state -g.set(T = 500.0, P = OneAtm, X = "OH:1, H:2, O2:3") +g.set(T = 500.0, P = OneAtm, X = "OH:1, H:2, O2:3, O:1.0E-8, H2:1.0E-8, H2O:1.0E-8, H2O2:1.0E-8, HO2:1.0E-8, AR:1.0E-8") # create a Dusty Gas transport manager for this phase d = DustyGasTransport(g) @@ -26,7 +26,7 @@ d.set(porosity = 0.2, tortuosity = 4.0, pore_radius = 1.5e-7, diameter = 1.5e-6) # lengths in meters # print the multicomponent diffusion coefficients -#print d.multiDiffCoeffs() +print d.multiDiffCoeffs() # compute molar species fluxes state1 = g.saveState() @@ -36,3 +36,4 @@ state2 = g.saveState() delta = 0.001 print d.molarFluxes(state1, state1, delta) +print d.molarFluxes(state1, state2, delta) diff --git a/Cantera/python/examples/transport/output_blessed_0.txt b/Cantera/python/examples/transport/output_blessed_0.txt new file mode 100644 index 000000000..0e67ec2b6 --- /dev/null +++ b/Cantera/python/examples/transport/output_blessed_0.txt @@ -0,0 +1,31 @@ +[[ 6.04406471e-06 1.01738100e-06 3.25467803e-15 9.44878921e-07 + 3.20196626e-07 3.45252809e-15 3.12341397e-15 3.09815027e-15 + 2.93166212e-15] + [ 5.08690499e-15 1.00940773e-05 2.95033119e-15 8.72973220e-07 + 2.90021521e-07 3.22819878e-15 2.88500792e-15 2.86100892e-15 + 2.70458750e-15] + [ 3.25467803e-15 5.90066238e-07 2.40899947e-06 8.67150386e-07 + 2.75178768e-07 3.02514701e-15 2.87336197e-15 2.85661971e-15 + 2.73675664e-15] + [ 3.14959640e-15 5.81982147e-07 2.89050129e-15 2.56318977e-06 + 2.87270338e-07 3.25199672e-15 3.05588867e-15 3.04247847e-15 + 2.94726056e-15] + [ 3.20196626e-15 5.80043042e-07 2.75178768e-15 8.61811015e-07 + 2.62146728e-06 2.99922209e-15 2.85602138e-15 2.83971549e-15 + 2.72221044e-15] + [ 3.45252809e-15 6.45639757e-07 3.02514701e-15 9.75599015e-07 + 2.99922209e-07 2.08849997e-06 3.19672263e-15 3.17885565e-15 + 3.07926377e-15] + [ 3.12341397e-15 5.77001585e-07 2.87336197e-15 9.16766600e-07 + 2.85602138e-07 3.19672263e-15 1.62315735e-06 3.02939857e-15 + 2.93566827e-15] + [ 3.09815027e-15 5.72201784e-07 2.85661971e-15 9.12743541e-07 + 2.83971549e-07 3.17885565e-15 3.02939857e-15 1.60480867e-06 + 2.92422492e-15] + [ 2.93166212e-15 5.40917501e-07 2.73675664e-15 8.84178169e-07 + 2.72221044e-07 3.07926377e-15 2.93566827e-15 2.92422492e-15 + 1.51904485e-06]] +[-0. -0. -0. -0. -0. -0. -0. -0. -0.] +[ -7.04749149e-14 -1.88567695e-05 -3.64733235e-14 -9.21405522e-06 + -3.58390239e-06 -3.54030661e-14 -3.04704797e-14 -3.02364800e-14 + -2.89579939e-14] diff --git a/Cantera/python/examples/transport/runtest.in b/Cantera/python/examples/transport/runtest.in new file mode 100755 index 000000000..ac3373fb5 --- /dev/null +++ b/Cantera/python/examples/transport/runtest.in @@ -0,0 +1,49 @@ +#!/bin/sh +# +# +temp_success="1" +/bin/rm -f output_0.txt diff_csv.txt diff_out_0.txt + +########################################################################## +PYTHON_CMD=@PYTHON_CMD@ +prog=dustygas.py +if test ! -f $prog ; then + echo $prog ' does not exist' + exit -1 +fi +################################################################# +# +CANTERA_DATA=${CANTERA_DATA:=../../../data/inputs}; export CANTERA_DATA +CANTERA_BIN=${CANTERA_BIN:=../../../bin} + +################################################################# + +$PYTHON_CMD $prog > output_0.txt <<+ +1.0 ++ +retnStat=$? +if [ $retnStat != "0" ] +then + temp_success="0" + echo "$prog returned with bad status, $retnStat, check output" +fi + +diff -w output_blessed_0.txt output_0.txt > diff_out_0.txt +retnStat_0=$? + + +retnTotal=1 +if test $retnStat_0 = "0" +then + retnTotal=0 +fi + + +if test $retnTotal = "0" +then + echo "Successful test comparison on "`pwd` +else + echo "Unsuccessful test comparison on "`pwd` " test" + echo " files are different - see diff_out_0.txt" +fi +