Van Der Walls
In [8]:
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 [9]:
Copied!
prop = component_from_name('propane')
prop
prop = component_from_name('propane')
prop
Out[9]:
Component(name='propane', formula='C3H8', iupac_key='ATUOYWHBWRKTHZ-UHFFFAOYSA-N', iupac='1S/C3H8/c1-3-2/h3H2;1-2H3', cas='74-98-6', molecular_weight=44.097, specific_gravity=None, critical_pressure=Pressure(value=616.0, unit=<PressureUnits.psi: 'psi'>), critical_temperature=Temperature(value=206.06, unit=<TemperatureUnits.farenheit: 'farenheit'>), antoine_coefficients=Antoine(a=4.53678, b=1149.36, c=24.906), van_der_walls=VanDerWalls(a=None, b=None), redlich_kwong=RedlichKwong(a=None, b=None), soave_redlich_kwong=SoaveRedlichKwong(a=None, b=None, alpha=None, a_alpha=None), peng_robinson=PengRobinson(a=None, b=None, alpha=None, a_alpha=None), mole_fraction=None, params={'id': 3.0, 'acentric_factor': 0.1523})
In [10]:
Copied!
cp = prop.critical_properties()
cp
cp = prop.critical_properties()
cp
Out[10]:
CriticalProperties(critical_pressure=Pressure(value=616.0, unit=<PressureUnits.psi: 'psi'>), critical_temperature=Temperature(value=206.06, unit=<TemperatureUnits.farenheit: 'farenheit'>))
In [11]:
Copied!
prop.van_der_walls.coef_ab(cp)
prop.van_der_walls.coef_ab(cp)
Out[11]:
(34946.10506074155, 1.4495298092532467)
In [12]:
Copied!
p1 = Pressure(value = 185, unit='psi')
t1 = Temperature(value = 100, unit='farenheit')
prop.van_der_walls.coef_AB(p1,t1)
p1 = Pressure(value = 185, unit='psi')
t1 = Temperature(value = 100, unit='farenheit')
prop.van_der_walls.coef_AB(p1,t1)
Out[12]:
(0.17926974743405383, 0.04465469520072008)
In [13]:
Copied!
poly = prop.van_der_walls.cubic_poly(p1,t1)
poly
poly = prop.van_der_walls.cubic_poly(p1,t1)
poly
Out[13]:
$x \mapsto \text{-0.008005235930377745} + \text{0.17926974743405383}\,x - \text{1.04465469520072}\,x^{2} + \text{1.0}\,x^{3}$
In [ ]:
Copied!
In [14]:
Copied!
ma = prop.molecular_weight
rho = prop.van_der_walls.estimate_densities(p1,t1, molecular_weight=ma)
rho
ma = prop.molecular_weight
rho = prop.van_der_walls.estimate_densities(p1,t1, molecular_weight=ma)
rho
Out[14]:
{'rho_gas': 1.6108195257038465, 'rho_liquid': 18.025022053627083}
In [ ]:
Copied!