Mixture Cubic Equation of State Class¶
-
class
cubicm(mix, c1, c2, oma, omb, alpha_eos, mixrule)[source]¶ Bases:
objectMixture Cubic EoS Object
This object have implemeted methods for phase equilibrium as for interfacial properties calculations.
Parameters: - mix (object) – mixture created with mixture 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
- mixrule (function) – computes mixture attactive and cohesive terms
-
Tc¶ critical temperture [K]
Type: array_like
-
Pc¶ critical pressure [bar]
Type: array_like
-
w¶ acentric factor
Type: array_like
-
cii¶ influence factor for SGT polynomials [J m5 mol-2]
Type: array_like
-
nc¶ number of components of mixture
Type: int
-
Mw¶ molar weight of the fluids [g mol-1]
Type: array_like
-
secondorder¶ True if dlogfugef and dlogfugef_aux methods are available
Type: bool
-
secondordersgt¶ True if dmuad and dmuad_aux methods are available
Type: bool
-
temperature_aux: computes temperature dependent parameters.
-
a_eos : computes the attractive term of cubic eos.
-
Zmix : computes the roots of compressibility factor polynomial.
-
density : computes density of mixture.
-
logfugef : computes effective fugacity coefficients.
-
logfugmix : computes mixture fugacity coeficcient.
-
dlogfugef: computes effective fugacity coefficients and its composition derivatives.
-
a0ad : computes dimensionless Helmholtz density energy.
-
muad : computes dimensionless chemical potential.
-
dmuad : computes dimensionless chemical potential and its composition derivatives.
-
dOm : computes dimensionless Thermodynamic Grand Potential.
-
ci : computes influence parameters matrix for SGT.
-
sgt_adim : computes dimensionless factors for SGT.
-
beta_sgt : method that incorporates the beta correction 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(X, T, P, state, v0=None, T_Step=0.1)[source]¶ Cpr(X, T, P, state, v0, T_step)
Method that computes the residual heat capacity at given composition, temperature and pressure.
Parameters: - X (array_like) – molar fraction array
- 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(X, T, P, state, v0=None, T_Step=0.1)[source]¶ Cpr(X, T, P, state, v0, T_step)
Method that computes the residual isochoric heat capacity at given composition, temperature and pressure.
Parameters: - X (array_like) – molar fraction array
- 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(X, T, P, state, v0, T_step)[source]¶ Method that computes the residual enthalpy at given composition, temperature and pressure.
Parameters: - X (array_like) – molar fraction array
- 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(X, T, P, state, v0, T_step)[source]¶ Method that computes the residual entropy at given composition, temperature and pressure.
Parameters: - X (array_like) – molar fraction array
- 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
-
Zmix(X, T, P)[source]¶ Method that computes the roots of the compressibility factor polynomial at given mole fractions (X), Temperature (T) and Pressure (P)
Parameters: - X (array_like) – mole fraction vector
- T (float) – absolute temperature [K]
- P (float) – pressure [bar]
Returns: Z – roots of Z polynomial
Return type: array_like
-
a0ad(roa, T)[source]¶ Method that computes the dimensionless Helmholtz density energy at given density and temperature.
Parameters: - rhoa (array_like) – dimensionless density vector [rhoa = rho * b[0]]
- T (float) – absolute temperature [K]
Returns: a0ad – dimensionless Helmholtz density energy
Return type: float
-
a_eos(T)[source]¶ Method that computes attractive term of cubic eos at fixed T (in K)
Parameters: T (float) – absolute temperature [K] Returns: a – attractive term array [bar cm6 mol-2] Return type: array_like
-
beta_sgt(beta)[source]¶ Method that allow asigning the beta correction for the influence parameter in Square Gradient Theory.
Parameters: beta (array_like) – beta corrections for influence parameter
-
ci(T)[source]¶ Method that evaluates the polynomials for the influence parameters used in the SGT theory for surface tension calculations.
Parameters: T (float) – absolute temperature [K] Returns: cij – matrix of influence parameters with geometric mixing rule [J m5 mol-2] Return type: array_like
-
dOm(roa, T, mu, Psat)[source]¶ Method that computes the dimensionless Thermodynamic Grand potential at given density and temperature.
Parameters: - rhoa (array_like) – dimensionless density vector [rhoa = rho * b[0]]
- T (float) – absolute temperature [K]
- mu (array_like) – dimensionless chemical potential at equilibrium [adim]
- Psat (float) – dimensionless pressure at equilibrium [adim]
Returns: dom – Thermodynamic Grand potential [Adim]
Return type: float
-
density(X, T, P, state, rho0=None)[source]¶ Method that computes the molar concentration (molar density) of the mixture at given composition (X), temperature (T) and pressure (P)
Parameters: - X (array_like) – mole fraction vector
- T (float) – absolute temperature [K]
- P (float) – pressure [bar]
- state (string) – ‘L’ for liquid phase and ‘V’ for vapor phase
Returns: density – Molar concentration of the mixture [mol/cm3]
Return type: float
-
dlogfugef(X, T, P, state)[source]¶ Method that computes the effective fugacity coefficients and its composition derivatives at given composition, temperature and pressure.
Parameters: - X (array_like) – mole fraction vector
- T (float) – absolute temperature [K]
- P (float) – pressure [bar]
- state (string) – ‘L’ for liquid phase, ‘V’ for vapour phase
- v0 (float, optional) – initial volume to iterate [cm3/mol]
Returns: - logfug (array_like) – effective fugacity coefficients
- dlogfug (array_like) – composition derivatives of effective fugacity coefficients
- v (float) – volume of phase [cm3/mol]
-
dmuad(rhoa, T)[source]¶ muad(roa, T)
Method that computes the dimensionless chemical potential and its derivatives at given density and temperature.
Parameters: - rhoa (array_like) – dimensionless density vector [rhoa = rho * b[0]]
- T (float) – absolute temperature [K]
Returns: - muad (array_like) – dimensionless chemical potential vector
- dmuad (array_like) – dimensionless derivatives of chemical potential vector
-
logfugef(X, T, P, state)[source]¶ Method that computes the effective fugacity coefficients at given composition, temperature and pressure.
Parameters: - X (array_like,) – mole fraction vector
- T (float) – absolute temperature [K]
- P (float) – pressure [bar]
- state (string) – ‘L’ for liquid phase, ‘V’ for vapour phase
- v0 (float, optional) – initial volume to iterate [cm3/mol]
Returns: - logfug (array_like) – effective fugacity coefficients
- v (float) – volume of the mixture [cm3/mol]
-
logfugmix(X, T, P, state)[source]¶ Method that computes the mixture fugacity coefficient at given composition, temperature and pressure.
Parameters: - X (array_like) – mole fraction vector
- T (float) – absolute temperature [K]
- P (float) – pressure [bar]
- state (string) – ‘L’ for liquid phase and ‘V’ for vapour phase
Returns: - lofgfug (array_like) – effective fugacity coefficients
- v (float) – volume of phase [cm3/mol]
-
muad(roa, T)[source]¶ Method that computes the dimensionless chemical potential at given density and temperature.
Parameters: - rhoa (array_like) – dimensionless density vector [rhoa = rho * b[0]]
- T (float) – absolute temperature [K]
Returns: muad – dimensionless chemical potential vector
Return type: array_like
-
muad_aux(rhoa, temp_aux)[source]¶ muad(roa, T)
Method that computes the dimensionless chemical potential at given density and temperature.
Parameters: - rhoa (array_like) – dimensionless density vector [rhoa = rho * b[0]]
- T (float) – absolute temperature [K]
Returns: muad – dimensionless chemical potential vector
Return type: array_like
-
pressure(X, v, T)[source]¶ Method that computes the pressure at given composition X, volume (cm3/mol) and temperature T (in K)
Parameters: - X (array_like) – mole fraction vector
- v (float) – molar volume in [cm3/mol]
- T (float) – absolute temperature [K]
Returns: P – pressure [bar]
Return type: float
-
sgt_adim(T)[source]¶ Method that evaluates dimensionless factors for temperature, pressure, density, tension and distance for interfacial properties computations with SGT.
Parameters: T (absolute temperature [K]) – 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(X, 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: - X (array_like) – molar fraction array
- 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