cantera/Cantera/python/examples/reactors/surf_pfr_sim/runtest
Harry Moffat 5b725eec64 Fixed the problem so that convergence would occur.
The time step in the inner loop was decreased by a factor of 100.
   Previously, there were convergence problems with this example problem.
2009-12-28 23:04:55 +00:00

63 lines
1.4 KiB
Bash
Executable file

#!/bin/sh
#
#
temp_success="1"
/bin/rm -f output_0.txt surf_pfr_output.csv diff_csv.txt diff_out_0.txt
##########################################################################
prog=surf_pfr.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=$?
csvdiff -a 1.0E-20 surf_pfr_blessed_0.csv surf_pfr_output.csv > diff_csv.txt
retnStat_csv_0=$?
retnTotal=1
if test $retnStat_0 = "0"
then
retnTotal=0
fi
retnCSVTotal=1
if test $retnStat_csv_0 = "1"
then
retnCSVTotal=0
fi
if test $retnCSVTotal = "0"
then
echo "Successful test comparison on "`pwd`
if test $retnTotal = "1"
then
echo " But text files show differences. See diff_out_0.txt"
fi
else
echo "Unsuccessful test comparison of csv files on "`pwd` " test"
echo " see diff_csv.txt "
if test $retnTotal != "0"
then
echo " ASCII files are different too - see diff_test*.txt"
fi
fi