Creating Nitrogen, oxygen, and nitrogen ternary air system phase envelopeΒΆ

[1]:
from thermo import ChemicalConstantsPackage, CEOSGas, CEOSLiquid, PRMIX, FlashVL
from thermo.interaction_parameters import IPDB

constants, properties = ChemicalConstantsPackage.from_IDs(['oxygen', 'nitrogen', 'argon'])
kijs = IPDB.get_ip_asymmetric_matrix('ChemSep PR', constants.CASs, 'kij')
eos_kwargs = {'Pcs': constants.Pcs, 'Tcs': constants.Tcs, 'omegas': constants.omegas, 'kijs': kijs}
gas = CEOSGas(PRMIX, eos_kwargs=eos_kwargs, HeatCapacityGases=properties.HeatCapacityGases)
liquid = CEOSLiquid(PRMIX, eos_kwargs=eos_kwargs, HeatCapacityGases=properties.HeatCapacityGases)
flasher = FlashVL(constants, properties, liquid=liquid, gas=gas)
zs = [0.21, 0.78, 0.01]
_ = flasher.plot_TP(zs, Tmin=40, Tmax=130, show=True)
../_images/Examples_Creating_Nitrogen,_oxygen,_and_nitrogen_ternary_air_system_phase_envelope_1_0.png
[2]:
_ = flasher.plot_PT(zs, Pmin=1e4, Pmax=3.5e6, show=True)
../_images/Examples_Creating_Nitrogen,_oxygen,_and_nitrogen_ternary_air_system_phase_envelope_2_0.png
[3]:
flasher.plot_ternary(T=120)
../_images/Examples_Creating_Nitrogen,_oxygen,_and_nitrogen_ternary_air_system_phase_envelope_3_0.png
[4]:
flasher.plot_ternary(P=1e5)
../_images/Examples_Creating_Nitrogen,_oxygen,_and_nitrogen_ternary_air_system_phase_envelope_4_0.png

Note: Bubble and dew point calculations can be difficult to converge; not all systems will solve for all conditions. Not all flash specifications have a unique solution. You are welcome to send these cases to the author but the library is provided AS IS, with NO SUPPORT.