Redlich Kwong
In [1]:
Copied!
from pvtpy.compositional import Component, component_from_name
from pvtpy.units import Pressure, Temperature
import numpy as np
from pvtpy.compositional import Component, component_from_name
from pvtpy.units import Pressure, Temperature
import numpy as np
In [2]:
Copied!
prop = component_from_name('propane')
prop.df()
prop = component_from_name('propane')
prop.df()
Out[2]:
formula C3H8 iupac_key ATUOYWHBWRKTHZ-UHFFFAOYSA-N iupac 1S/C3H8/c1-3-2/h3H2;1-2H3 cas 74-98-6 molecular_weight 44.097 van_der_walls {} redlich_kwong {} soave_redlich_kwong {} peng_robinson {} critical_pressure 616.0 critical_temperature 206.06 id 3.0 acentric_factor 0.1523 Name: propane, dtype: object
In [3]:
Copied!
cp = prop.critical_properties()
cp
cp = prop.critical_properties()
cp
Out[3]:
CriticalProperties(critical_pressure=Pressure(value=616.0, unit=<PressureUnits.psi: 'psi'>), critical_temperature=Temperature(value=206.06, unit=<TemperatureUnits.farenheit: 'farenheit'>))
In [4]:
Copied!
coef = prop.redlich_kwong.coef_ab(cp)
coef
coef = prop.redlich_kwong.coef_ab(cp)
coef
Out[4]:
(913628.6150409831, 1.0046981013896104)
In [5]:
Copied!
p1 = Pressure(value = 185, unit='psi')
t1 = Temperature(value = 100, unit='farenheit')
A,B = prop.redlich_kwong.coef_AB(p1,t1)
print(A,B)
p1 = Pressure(value = 185, unit='psi')
t1 = Temperature(value = 100, unit='farenheit')
A,B = prop.redlich_kwong.coef_AB(p1,t1)
print(A,B)
0.1981125133542597 0.0309510623375231
In [6]:
Copied!
poly = prop.redlich_kwong.cubic_poly(p1,t1)
poly
poly = prop.redlich_kwong.cubic_poly(p1,t1)
poly
Out[6]:
$x \mapsto \text{-0.00613179275067107} + \text{0.16620348275691535}\,x - \text{1.0}\,x^{2} + \text{1.0}\,x^{3}$
In [7]:
Copied!
ma = prop.molecular_weight
rho = prop.redlich_kwong.estimate_densities(p1,t1, molecular_weight=ma)
rho
ma = prop.molecular_weight
rho = prop.redlich_kwong.estimate_densities(p1,t1, molecular_weight=ma)
rho
Out[7]:
{'rho_gas': 1.6930299733398178, 'rho_liquid': 25.750511328486244}
In [ ]:
Copied!