polykin.thermo.eos¤
IdealGas ¤
Ideal gas equation of state.
This EOS is based on the following \(P(v,T)\) relationship:
where \(P\) is the pressure, \(T\) is the temperature, and \(v\) is the molar volume.
Important
The ideal gas model is very convenient, but its validity is limited to low pressures and high temperatures.
Source code in src/polykin/thermo/eos/idealgas.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
P ¤
P(
T: Union[float, FloatArray],
v: Union[float, FloatArray],
y=None,
) -> Union[float, FloatArray]
Calculate the pressure of the fluid.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature. Unit = K.
TYPE:
|
v
|
Molar volume. Unit = m³/mol.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float | FloatArray
|
Pressure. Unit = Pa. |
Source code in src/polykin/thermo/eos/idealgas.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
Z ¤
Z(T=None, P=None, y=None)
Calculate the compressibility factor of the fluid.
RETURNS | DESCRIPTION |
---|---|
float
|
Compressibility factor of the vapor. |
Source code in src/polykin/thermo/eos/idealgas.py
34 35 36 37 38 39 40 41 42 43 44 45 |
|
fV ¤
fV(T: float, P: float, y: FloatVector) -> FloatVector
Calculate the fugacity of all components in the vapor phase.
\(\hat{f}_i\) is the fugacity in the vapor phase, \(\hat{\phi}_i(T,P,y)\) is the fugacity coefficient, \(P\) is the pressure, and \(y_i\) is the mole fraction in the vapor phase.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature. Unit = K.
TYPE:
|
P
|
Pressure. Unit = Pa.
TYPE:
|
y
|
Mole fractions of all components. Unit = mol/mol.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatVector
|
Fugacity coefficients of all components. |
Source code in src/polykin/thermo/eos/base.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
phiV ¤
phiV(T=None, P=None, y=None) -> FloatVector
Calculate the fugacity coefficients of all components in the vapor phase.
RETURNS | DESCRIPTION |
---|---|
FloatVector
|
Fugacity coefficients of all components. |
Source code in src/polykin/thermo/eos/idealgas.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
|
v ¤
v(T: float, P: float, y: FloatVector) -> float
Calculate the molar volume the fluid.
where \(v\) is the molar volue, \(Z\) is the compressibility factor, \(T\) is the temperature, \(P\) is the pressure, and \(y\) is the mole fraction vector.
PARAMETER | DESCRIPTION |
---|---|
T
|
Temperature. Unit = K.
TYPE:
|
P
|
Pressure. Unit = Pa.
TYPE:
|
y
|
Mole fractions of all components. Unit = mol/mol.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
Molar volume of the fluid. Unit = m³/mol. |
Source code in src/polykin/thermo/eos/base.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
|
Examples¤
Estimate the molar volume of a gas at 0°C and 1 atm.
from polykin.thermo.eos import IdealGas
eos = IdealGas()
v = eos.v(T=273.15, P=1.01325e5, y=None)
print(f"{v:.2e} m³/mol")