Soave Redlich Kwong
In [1]:
Copied!
from pvtpy.compositional import Component, component_from_name
from pvtpy.units import Pressure, Temperature
import numpy as np
import pandas as pd
from pvtpy.compositional import Component, component_from_name
from pvtpy.units import Pressure, Temperature
import numpy as np
import pandas as pd
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.soave_redlich_kwong.coef_ab(cp)
coef
coef = prop.soave_redlich_kwong.coef_ab(cp)
coef
Out[4]:
(35409.56807185824, 1.0046981013896104)
In [5]:
Copied!
p1 = Pressure(value = 185, unit='psi')
t1 = Temperature(value = 100, unit='farenheit')
p1 = Pressure(value = 185, unit='psi')
t1 = Temperature(value = 100, unit='farenheit')
In [6]:
Copied!
omega = prop.params['acentric_factor']
prop.soave_redlich_kwong.coef_alpha(t1,cp, omega)
omega = prop.params['acentric_factor']
prop.soave_redlich_kwong.coef_alpha(t1,cp, omega)
Out[6]:
1.1224917092791513
In [7]:
Copied!
A,B = prop.soave_redlich_kwong.coef_AB(p1,t1)
print(A,B)
A,B = prop.soave_redlich_kwong.coef_AB(p1,t1)
print(A,B)
0.2038975463516234 0.0309510623375231
In [8]:
Copied!
poly = prop.soave_redlich_kwong.cubic_poly(p1,t1)
poly
poly = prop.soave_redlich_kwong.cubic_poly(p1,t1)
poly
Out[8]:
$x \mapsto \text{-0.006310845667597102} + \text{0.17198851575427906}\,x - \text{1.0}\,x^{2} + \text{1.0}\,x^{3}$
In [9]:
Copied!
poly.roots()
poly.roots()
Out[9]:
array([0.05110012, 0.15569748, 0.7932024 ])
In [10]:
Copied!
ma = prop.molecular_weight
rho = prop.soave_redlich_kwong.estimate_densities(p1,t1, molecular_weight=ma)
rho
ma = prop.molecular_weight
rho = prop.soave_redlich_kwong.estimate_densities(p1,t1, molecular_weight=ma)
rho
Out[10]:
{'rho_gas': 1.712635751626581, 'rho_liquid': 26.584412239429383}
In [ ]:
Copied!