cantera/samples/python/liquid_vapor/critProperties/critProperties.py
Ray Speth 2528df0f75 Reorganized source tree structure
These changes make it unnecessary to copy header files around during
the build process, which tends to confuse IDEs and debuggers. The
headers which comprise Cantera's external C++ interface are now in
the 'include' directory.

All of the samples and demos are now in the 'samples' subdirectory.
2012-02-12 02:27:14 +00:00

29 lines
789 B
Python

"""
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(),
'carbondioxide':CarbonDioxide(),
'heptane':Heptane()
}
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)