mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
Added dir files.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
Makefile
|
||||
runtest
|
||||
ct2ctml.log
|
||||
diff_out_0.txt
|
||||
h2o2.xml
|
||||
output_0.txt
|
||||
transport_log.xml
|
||||
14
Cantera/python/examples/equilibrium/simple_test/Makefile.in
Normal file
14
Cantera/python/examples/equilibrium/simple_test/Makefile.in
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
PYTHON_CMD = @PYTHON_CMD@
|
||||
|
||||
run:
|
||||
$(PYTHON_CMD) adiabatic.py
|
||||
|
||||
test:
|
||||
./runtest
|
||||
clean:
|
||||
rm -f *.log *.csv *.xml
|
||||
|
||||
# end of file
|
||||
|
||||
5
Cantera/python/examples/equilibrium/simple_test/cleanup
Executable file
5
Cantera/python/examples/equilibrium/simple_test/cleanup
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
/bin/rm -rf equilibrate_log*.html
|
||||
/bin/rm -rf .cttmp* ct2ctml.log transport_log.xml vcs_equilibrate_res*.csv \
|
||||
equil_koh.csv
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
ohmech:
|
||||
|
||||
temperature 2000 K
|
||||
pressure 10132.5 Pa
|
||||
density 0.0117038 kg/m^3
|
||||
mean mol. weight 19.2076 amu
|
||||
|
||||
1 kg 1 kmol
|
||||
----------- ------------
|
||||
enthalpy -7.55312e+06 -1.451e+08 J
|
||||
internal energy -8.41887e+06 -1.617e+08 J
|
||||
entropy 14945.3 2.871e+05 J/K
|
||||
Gibbs function -3.74437e+07 -7.192e+08 J
|
||||
heat capacity c_p 2617.61 5.028e+04 J/K
|
||||
heat capacity c_v 2184.73 4.196e+04 J/K
|
||||
|
||||
X Y Chem. Pot. / RT
|
||||
------------- ------------ ------------
|
||||
H2 0.00273982 0.000287549 -27.6814
|
||||
H 0.000269379 1.41359e-05 -13.8407
|
||||
O 0.000632389 0.000526761 -16.7409
|
||||
O2 0.0894549 0.149027 -33.4819
|
||||
OH 0.00880602 0.00779726 -30.5817
|
||||
H2O 0.898095 0.842343 -44.4224
|
||||
HO2 2.52646e-06 4.3415e-06 -47.3226
|
||||
H2O2 1.58781e-07 2.81184e-07 -61.1633
|
||||
AR 0 0
|
||||
H2 0.00274 0.0002875 -4.603e+08
|
||||
H 0.0002694 1.414e-05 -2.302e+08
|
||||
O 0.0006324 0.0005268 -2.784e+08
|
||||
O2 0.08945 0.149 -5.568e+08
|
||||
OH 0.008806 0.007797 -5.085e+08
|
||||
H2O 0.8981 0.8423 -7.387e+08
|
||||
HO2 2.526e-06 4.342e-06 -7.869e+08
|
||||
H2O2 1.588e-07 2.812e-07 -1.017e+09
|
||||
AR 0 0 -1.188e+10
|
||||
49
Cantera/python/examples/equilibrium/simple_test/runtest.in
Executable file
49
Cantera/python/examples/equilibrium/simple_test/runtest.in
Executable file
@@ -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=simple.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
|
||||
|
||||
23
Cantera/python/examples/equilibrium/simple_test/simple.py
Normal file
23
Cantera/python/examples/equilibrium/simple_test/simple.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# homogeneous equilibrium of a gas.
|
||||
|
||||
from Cantera import *
|
||||
|
||||
# create an object representing the gas phase
|
||||
gas = importPhase("h2o2.cti")
|
||||
|
||||
# set the initial state
|
||||
gas.set(T = 2000.0, P = 0.1*OneAtm, X = "H2:1.0, O2:0.6")
|
||||
|
||||
# equilibrate the gas holding T and P fixed
|
||||
gas.equilibrate("TP")
|
||||
|
||||
# print a summary of the results
|
||||
print gas
|
||||
|
||||
# Individual properties can also be retrieved...
|
||||
x = gas.moleFractions()
|
||||
y = gas.massFractions()
|
||||
mu = gas.chemPotentials()
|
||||
names = gas.speciesNames()
|
||||
for n in range(gas.nSpecies()):
|
||||
print "%20s %10.4g %10.4g %10.4g " % (names[n], x[n], y[n], mu[n])
|
||||
Reference in New Issue
Block a user