Pure Cubic Equation of State Class¶
-
class
cpure(pure, c1, c2, oma, omb, alpha_eos)[source]¶ Bases:
objectPure component Cubic EoS Object
This object have implemeted methods for phase equilibrium as for interfacial properties calculations.
Parameters: - pure (object) – pure component created with component class
- c2 (c1,) – constants of cubic EoS
- omb (oma,) – constants of cubic EoS
- alpha_eos (function) – function that gives thermal funcionality to attractive term of EoS
-
Tc¶ critical temperture [K]
Type: float
-
Pc¶ critical pressure [bar]
Type: float
-
w¶ acentric factor
Type: float
-
cii¶ influence factor for SGT polynomial [J m5 mol-2]
Type: array_like
-
Mw¶ molar weight of the fluid [g mol-1]
Type: float
-
a_eos : computes the attractive term of cubic eos.
-
psat : computes saturation pressure.
-
tsat : computes saturation temperature
-
density : computes density of mixture.
-
logfug : computes fugacity coefficient.
-
a0ad : computes dimensionless Helmholtz density energy
-
muad : computes dimensionless chemical potential.
-
dOm : computes dimensionless Thermodynamic Grand Potential.
-
ci : computes influence parameters matrix for SGT.
-
sgt_adim : computes dimensionless factors for SGT.
-
EntropyR : computes residual Entropy.
-
EnthalpyR: computes residual Enthalpy.
-
CvR : computes residual isochoric heat capacity.
-
CpR : computes residual isobaric heat capacity.
-
speed_sound : computes the speed of sound.
-
CpR(T, P, state, v0=None, T_Step=0.1)[source]¶ Cpr(T, P, state, v0, T_step)
Method that computes the residual heat capacity at given temperature and pressure.
Parameters: - T (float) – absolute temperature [K]
- P (float) – pressure [bar]
- state (string) – ‘L’ for liquid phase and ‘V’ for vapour phase
- v0 (float, optional) – initial guess for volume root [cm3/mol]
- T_step (float, optional) – Step to compute the numerical temperature derivates of Helmholtz free energy
Returns: Cp – residual heat capacity [J/mol K]
Return type: float
-
CvR(T, P, state, v0=None, T_Step=0.1)[source]¶ Cpr(T, P, state, v0, T_step)
Method that computes the residual isochoric heat capacity at given temperature and pressure.
Parameters: - T (float) – absolute temperature [K]
- P (float) – pressure [bar]
- state (string) – ‘L’ for liquid phase and ‘V’ for vapour phase
- v0 (float, optional) – initial guess for volume root [cm3/mol]
- T_step (float, optional) – Step to compute the numerical temperature derivates of Helmholtz free energy
Returns: Cv – residual isochoric heat capacity [J/mol K]
Return type: float
-
EnthalpyR(T, P, state, v0, T_step)[source]¶ Method that computes the residual enthalpy at given temperature and pressure.
Parameters: - T (float) – absolute temperature [K]
- P (float) – pressure [bar]
- state (string) – ‘L’ for liquid phase and ‘V’ for vapour phase
- v0 (float, optional) – initial guess for volume root [cm3/mol]
- T_step (float, optional) – Step to compute the numerical temperature derivates of Helmholtz free energy
Returns: Hr – residual enthalpy [J/mol]
Return type: float
-
EntropyR(T, P, state, v0, T_step)[source]¶ Method that computes the residual entropy at given temperature and pressure.
Parameters: - T (float) – absolute temperature [K]
- P (float) – pressure [bar]
- state (string) – ‘L’ for liquid phase and ‘V’ for vapour phase
- v0 (float, optional) – initial guess for volume root [cm3/mol]
- T_step (float, optional) – Step to compute the numerical temperature derivates of Helmholtz free energy
Returns: Sr – residual entropy [J/mol K]
Return type: float
-
a0ad(ro, T)[source]¶ Method that computes the dimensionless Helmholtz density energy at given density and temperature.
Parameters: - ro (float) – dimensionless density vector [rho = rho * b]
- T (float) – absolute dimensionless temperature [Adim]
Returns: a0ad – dimensionless Helmholtz density energy [Adim]
Return type: float
-
a_eos(T)[source]¶ Method that computes atractive term of cubic eos at fixed T (in K)
Parameters: T (float) – absolute temperature [K] Returns: a – atractive term array [bar cm6 mol-2] Return type: float
-
ci(T)[source]¶ Method that evaluates the polynomial for the influence parameters used in the SGT theory for surface tension calculations.
Parameters: T (float) – absolute temperature [K] Returns: ci – influence parameters [J m5 mol-2] Return type: float
-
dOm(roa, T, mu, Psat)[source]¶ Method that computes the dimensionless Thermodynamic Grand potential at given density and temperature.
Parameters: - roa (float) – dimensionless density vector [rho = rho * b]
- T (floar) – absolute dimensionless temperature [Adim]
- mu (float) – dimensionless chemical potential at equilibrium [Adim]
- Psat (float) – dimensionless pressure at equilibrium [Adim]
Returns: Out – Thermodynamic Grand potential [Adim]
Return type: float
-
density(T, P, state)[source]¶ Method that computes the density of the mixture at given temperature and pressure.
Parameters: - T (float) – absolute temperature [K]
- P (float) – pressure [bar]
- state (string) – ‘L’ for liquid phase and ‘V’ for vapour phase
Returns: density – molar density [mol/cm3]
Return type: float
-
logfug(T, P, state)[source]¶ Method that computes the fugacity coefficient at given temperature and pressure.
Parameters: - T (float) – absolute temperature [K]
- P (float) – pressure [bar]
- state (string) – ‘L’ for liquid phase and ‘V’ for vapour phase
Returns: - logfug (float) – fugacity coefficient
- v (float) – volume of the fluid [cm3/mol]
-
muad(ro, T)[source]¶ Method that computes the dimensionless chemical potential at given density and temperature.
Parameters: - roa (float) – dimensionless density vector [rho = rho * b]
- T (float) – absolute dimensionless temperature [adim]
Returns: muad – chemical potential [Adim]
Return type: float
-
pressure(v, T)[source]¶ Method that computes the pressure at given volume (cm3/mol) and temperature T (in K)
Parameters: - T (float) – absolute temperature [K]
- v (float) – molar volume [cm3/mol]
Returns: P – pressure [bar]
Return type: float
-
psat(T, P0)[source]¶ Method that computes saturation pressure at given temperature
Parameters: - T (float) – absolute temperature [K]
- P0 (float, optional) – initial value to find saturation pressure [bar], None for automatic initiation
Returns: - psat (float) – saturation pressure [bar]
- vl (float) – saturation liquid volume [cm3/mol]
- vv (float) – saturation vapor volume [cm3/mol]
-
sgt_adim(T)[source]¶ Method that evaluates dimensionless factors for temperature, pressure, density, tension and distance for interfacial properties computations with SGT.
Parameters: - T (float) –
- temperature [K] (absolute) –
Returns: - Tfactor (float) – factor to obtain dimentionless temperature (K -> adim)
- Pfactor (float) – factor to obtain dimentionless pressure (bar -> adim)
- rofactor (float) – factor to obtain dimentionless density (mol/cm3 -> adim)
- tenfactor (float) – factor to obtain dimentionless surface tension (mN/m -> adim)
- zfactor (float) – factor to obtain dimentionless distance (Amstrong -> adim)
-
speed_sound(T, P, state, v0, T_step, CvId, CpId)[source]¶ Method that computes the speed of sound at given temperature and pressure.
This calculation requires that the molar weight [g/mol] of the fluid has been set in the component function.
By default the ideal gas Cv and Cp are set to 3R/2 and 5R/2, the user can supply better values if available.
Parameters: - T (float) – absolute temperature [K]
- P (float) – pressure [bar]
- state (string) – ‘L’ for liquid phase and ‘V’ for vapour phase
- v0 (float, optional) – initial guess for volume root [cm3/mol]
- T_step (float, optional) – Step to compute the numerical temperature derivates of Helmholtz free energy
- CvId (float, optional) – Ideal gas isochoric heat capacity, set to 3R/2 by default [J/mol K]
- CpId (float, optional) – Ideal gas heat capacity, set to 3R/2 by default [J/mol K]
Returns: w – speed of sound [m/s]
Return type: float
-
tsat(P, T0, Tbounds)[source]¶ Method that computes saturation temperature at given pressure
Parameters: - P (float) – pressure [bar]
- T0 (float, optional) – Temperature to start iterations [K]
- Tbounds (tuple, optional) – (Tmin, Tmax) Temperature interval to start iterations [K]
Returns: - tsat (float) – saturation pressure [bar]
- vl (float) – saturation liquid volume [cm3/mol]
- vv (float) – saturation vapor volume [cm3/mol]