added example of computing critical-state properties
This commit is contained in:
parent
1d3a254530
commit
6d5a3c7f0b
1 changed files with 25 additions and 0 deletions
25
Cantera/python/examples/critProperties.py
Normal file
25
Cantera/python/examples/critProperties.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
"""
|
||||
Print the critical state properties for the fluids for which Cantera has
|
||||
built-in liquid/vapor equations of state.
|
||||
"""
|
||||
|
||||
from Cantera import *
|
||||
from Cantera.liquidvapor import *
|
||||
|
||||
fluids = {'water':Water(),
|
||||
'nitrogen':Nitrogen(),
|
||||
'methane':Methane(),
|
||||
'hydrogen':Hydrogen(),
|
||||
'oxygen':Oxygen()}
|
||||
|
||||
print 'Critical State Properties'
|
||||
print '%20s %10s %10s %10s' % ('Fluid','Tc [K]', 'Pc [Pa]', 'Zc')
|
||||
for name in fluids.keys():
|
||||
f = fluids[name]
|
||||
tc = f.critTemperature()
|
||||
pc = f.critPressure()
|
||||
rc = f.critDensity()
|
||||
mw = f.meanMolecularWeight()
|
||||
zc = pc*mw/(rc*GasConstant*tc)
|
||||
print '%20s %10.4g %10.4G %10.4G' % (name, tc, pc, zc)
|
||||
|
||||
Loading…
Add table
Reference in a new issue