lib.mezcla module

This module implement mixture component properties

Mezcla: The main class with all integrated functionality. Use the properties in database and calculate state properties with the methods chosen in configuration

Liquid density calculation methods:
Liquid viscosity calculation methods:
Gas viscosity calculation methods:
Liquid thermal conductivity calculation methods:
Gas thermal conductivity calculation methods:
Surface tension calculation methods:
Mixture mass definition:
lib.mezcla.mix_unitmassflow(unitMassFlow, cmps)[source]

Calculate mixture composition properties with known unitMassFlow

lib.mezcla.mix_unitmolarflow(unitMolarFlow, cmps)[source]

Calculate mixture composition properties with known unitMolarFlow

lib.mezcla.mix_massflow_molarfraction(massFlow, molarFraction, cmps)[source]

Calculate mixture composition properties with known massFlow and molarFraction

lib.mezcla.mix_massflow_massfraction(massFlow, massFraction, cmps)[source]

Calculate mixture composition properties with known massFlow and massFraction

lib.mezcla.mix_molarflow_molarfraction(molarFlow, molarFraction, cmps)[source]

Calculate mixture composition properties with known molarFlow and molarFraction

lib.mezcla.mix_molarflow_massfraction(molarFlow, massFraction, cmps)[source]

Calculate mixture composition properties with known molarFlow and massFraction

lib.mezcla.Vc_ChuehPrausnitz(xi, Vci, Mi, hydrocarbon=None)[source]
Calculates critic volume of a mixture using the Chueh-Prausnitz

correlation, also referenced in API procedure 4B3.1 pag 314

\[V_{cm} = \sum_i^n\phi_iV_{ci}+\sum_i^n\sum_j^n\phi_i\phi_j\upsilon_{ij}\]
\[\phi_j = \frac{x_jV_{cj}^{2/3}}{\sum_{i=1}^nx_iV_{ci}^{2/3}}\]
\[\upsilon_{ij} = \frac{V_{ij}\left(V_{ci}+V_{cj}\right)}{2}\]
\[V_{ij} = -1.4684\eta_{ij}+C\]
\[\eta_{ij} = \left|\frac{V_{ci}-V_{cj}}{V_{ci}+V_{cj}}\right|\]
Parameters:
xilist

Mole fractions of components, [-]

Vcilist

Critical volume of components, [m³/kg]

Milist

Molecular weight of components, [g/mol]

hydrocarbonlist, optional

Hydrocarbon flag of components, default True for all components

Returns:
Vcmfloat

Critical volume of mixture, [m³/kg]

References

[18] Chueh, P.L., Prausnitz, J.M.; Vapor-Liquid Equilibria at High Pressures: Calculation of Critical Temperatures, Volumes and Pressures of Nonpolar Mixtures. AIChE Journal 13(6) (1967) 1107-1113

[2] API; Technical Data book: Petroleum Refining 6th Edition.

Examples

Example from [2]; 63% nC4 37% nC7

>>> Vc1 = unidades.SpecificVolume(0.0704, "ft3lb")
>>> Vc2 = unidades.SpecificVolume(0.0691, "ft3lb")
>>> Mi = [58.12, 100.2]
>>> Mm = Mi[0]*0.63+Mi[1]*0.37
>>> "%0.2f" % (Vc_ChuehPrausnitz([0.63, 0.37], [Vc1, Vc2], Mi).ft3lb*Mm)
'4.35'
lib.mezcla.RhoL_RackettMix(T, xi, Tci, Pci, Vci, Zrai, Mi)[source]
Calculates saturated liquid densities of muxteres using the

modified Rackett equation by Spencer-Danner, also referenced in API procedure 6A3.1 pag 479

\[\frac{1}{\rho_{bp}} = R\left(\sum_i x_i \frac{T_{ci}}{P_{ci}}\right) Z_{RAm}^{1+\left(1+T_r\right)^{2/7}}\]
\[Z_{RAm} = \sum_i x_iZ_{RAi}\]
\[T_{cm} = \sum_i \phi_iT_{ci}\]
\[\phi_i = \frac{x_iV_{ci}}{\sum_i x_iV_{ci}}\]
\[1-k_{ij} = \frac{8\left(V_{ci}V{cj}\right)^{1/2}} {\left(V_{ci}^{1/3}+V_{cj}^{1/3}\right)^3}\]
\[T_{cij} = \left(1+k{ij}\right)\left(T_{ci}T_{cj}\right)^{1/2}\]
Parameters:
Tfloat

Temperature, [K]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of components, [K]

Pcilist

Critical pressure of components, [Pa]

Vcilist

Critical volume of components, [m³/kg]

Zrailist

Racket constant of components, [-]

Milist

Molecular weight of components, [g/mol]

Returns:
rhofloat

Bubble point liquid density at T, [kg/m³]

References

[9] Spencer, C.F., Danner, R.P.; Prediction of Bubble-Point Density of Mixtures. J. Chem. Eng. Data 18(2) (1973) 230-234

[2] API; Technical Data book: Petroleum Refining 6th Edition.

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

Examples

Example from [2]; 58.71% ethane, 41.29% heptane at 91ºF

>>> T = unidades.Temperature(91, "F")
>>> xi = [0.5871, 0.4129]
>>> Tc1 = unidades.Temperature(89.92, "F")
>>> Tc2 = unidades.Temperature(512.7, "F")
>>> Pc1 = unidades.Pressure(706.5, "psi")
>>> Pc2 = unidades.Pressure(396.8, "psi")
>>> Vc1 = unidades.SpecificVolume(0.0788, "ft3lb")
>>> Vc2 = unidades.SpecificVolume(0.0691, "ft3lb")
>>> Zrai = [0.2819, 0.261]
>>> Mi = [30.07, 100.205]
>>> args = (T, xi, [Tc1, Tc2], [Pc1, Pc2], [Vc1, Vc2], Zrai, Mi)
>>> "%0.2f" % RhoL_RackettMix(*args).kgl
'0.56'

Example 5-3 from [3]; 70% ethane, 30% nC10 at 344.26K

>>> xi = [0.7, 0.3]
>>> Tci = [305.32, 617.7]
>>> Pci = [48.72e5, 21.1e5]
>>> Vci = [145.5/1000, 624/1000]
>>> Zrai = [0.282, 0.247]
>>> Mi = [1, 1]
>>> args = (344.26, [0.7, 0.3], Tci, Pci, Vci, Zrai, Mi)
>>> "%0.1f" % (1/RhoL_RackettMix(*args).gcc)
'120.0'
lib.mezcla.RhoL_CostaldMix(T, xi, Tci, wi, Vci, Mi)[source]
Calculates saturated liquid densities of pure components using the

Corresponding STAtes Liquid Density (COSTALD) method, developed by Hankinson and Thomson, referenced too in API procedure 6A3.2 pag. 482

\[T_{cm} = \frac{\sum_i\sum_jx_ix_j\left(V_i^oT_{ci}V_j^oT_{cj}\right) ^{1/2}}{V_m^o}\]
\[V_m^o = \frac{\sum_i xiV_i^o + 3 \sum_i x_iV_i^{o^{2/3}} \sum_i x_iV_i^{o^{1/3}}}{4}\]
\[\omega_m = \sum_i x_i\omega_{SRKi}\]
Parameters:
Tfloat

Temperature [K]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of components, [K]

wilist

Acentric factor optimized to SRK of components, [-]

Vcilist

Characteristic volume of components, [m³/kg]

Milist

Molecular weight of components, [g/mol]

Returns:
rhofloat

Bubble point liquid density at T, [kg/m³]

References

[10] Hankinson, R.W., Thomson, G.H.; A New Correlation for Saturated Densities of Liquids and Their Mixtures. AIChE Journal 25(4) (1979) 653-663

[2] API; Technical Data book: Petroleum Refining 6th Edition.

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

Examples

Example from [2]; 20% methane, 80% nC10 at 160ºF

>>> T = unidades.Temperature(160, "F")
>>> Tc1 = unidades.Temperature(-116.67, "F")
>>> Tc2 = unidades.Temperature(652, "F")
>>> Vc1 = unidades.SpecificVolume(1.592/16.04, "ft3lb")
>>> Vc2 = unidades.SpecificVolume(9.919/142.28, "ft3lb")
>>> Mi = [16.04, 142.28]
>>> args = (T, [0.2, 0.8], [Tc1, Tc2], [0.0074, 0.4916], [Vc1, Vc2], Mi)
>>> "%0.3f" % RhoL_CostaldMix(*args).kgl
'0.667'

Example 5-3 from [3]; 70% ethane, 30% nC10 at 344.26K

>>> xi = [0.7, 0.3]
>>> Tci = [305.32, 617.7]
>>> Vci = [145.5/1000, 624/1000]
>>> wi = [0.099, 0.491]
>>> Mi = [1, 1]
>>> args = (344.26, [0.7, 0.3], Tci, wi, Vci, Mi)
>>> "%0.1f" % (1/RhoL_CostaldMix(*args).gcc)
'119.5'
lib.mezcla.RhoL_AaltoKeskinenMix(T, P, xi, Tci, Pci, Vci, wi, Mi, rhos)[source]
Calculates compressed-liquid density of a mixture, using the

Aalto-Keskinen modification of Chang-Zhao correlation

\[T_{cm} = \frac{\sum_i\sum_jx_ix_j\left(V_i^oT_{ci}V_j^oT_{cj}\right) ^{1/2}}{V_m^o}\]
\[V_m^o = \frac{\sum_i xiV_i^o + 3 \sum_i x_iV_i^{o^{2/3}} \sum_i x_iV_i^{o^{1/3}}}{4}\]
\[P_{cm} = \frac{\left(0.291-0.08\omega_{SRKm}\right)RT_{cm}}{V_{cm}}\]
\[\omega_{SRKm} = \left(\sum_i x_i\omega_{SRKi}\right)^2\]
Parameters:
Tfloat

Temperature, [K]

Pfloat

Pressure, [Pa]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of components, [K]

Pcilist

Critical pressure of components, [Pa]

Vcilist

Critical volume of components, [m³/kg]

wilist

Acentric factor (SRK optimized) of components, [-]

Milist

Molecular weight of components, [g/mol]

rhosfloat

Boiling point liquid density, [kg/m³]

Returns:
rhofloat

High-pressure liquid density, [kg/m³]

References

[11] Aalto, M., Keskinen, K.I., Aittamaa, J., Liukkonen, S.; An Improved Correlation for Compressed Liquid Densities of Hydrocarbons. Part 2. Mixtures. Fluid Phase Equilibria 114 (1996) 21-35

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

Examples

Example 5-4 from [3]; 70% ethane, 30% nC10 at 344.26K and 10000psi

>>> P = unidades.Pressure(10000, "psi")
>>> xi = [0.7, 0.3]
>>> Tci = [305.32, 617.7]
>>> Pci = [48.72e5, 21.1e5]
>>> Vci = [145.5/1000, 624/1000]
>>> wi = [0.099, 0.491]
>>> Mi = [1, 1]
>>> args = (344.26, P, xi, Tci, Pci, Vci, wi, Mi, 1/116.43*1000)
>>> "%0.2f" % (1/RhoL_AaltoKeskinenMix(*args).gcc)
'99.05'
lib.mezcla.RhoL_TaitCostaldMix(T, P, xi, Tci, Vci, wi, Mi, rhos)[source]
Calculates compressed-liquid density of a mixture, using the

Thomson-Brobst-Hankinson modification of Chang-Zhao correlation adapted to mixtures, also referenced in API procedure 6A3.4, pag 489

\[T_{cm} = \frac{\sum_i\sum_jx_ix_j\left(V_i^oT_{ci}V_j^oT_{cj}\right) ^{1/2}}{V_m^o}\]
\[V_m^o = \frac{\sum_i xiV_i^o + 3 \sum_i x_iV_i^{o^{2/3}} \sum_i x_iV_i^{o^{1/3}}}{4}\]
\[P_{cm} = \frac{\left(0.291-0.08\omega_{SRKm}\right)RT_{cm}}{V_{cm}}\]
\[\omega_{SRKm} = \left(\sum_i x_i\omega_{SRKi}\right)^2\]
\[\frac{P_s}{P_{cm}} = P_m^{(0)}+\omega_{SRKm}P_m^{(1)}\]
\[P_m^{(0)} = 5.8031817 \log T_{rm}+0.07608141\alpha\]
\[P_m^{(1)} = 4.86601\beta\]
\[\alpha = 35 - \frac{36}{T_{rm}}-96.736\log T_{rm}+T_{rm}^6\]
\[\beta = \log T_{rm}+0.03721754\alpha\]
Parameters:
Tfloat

Temperature, [K]

Pfloat

Pressure, [Pa]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of components, [K]

Vcilist

Critical volume of components, [m³/kg]

wilist

Acentric factor (SRK optimized) of components, [-]

Milist

Molecular weight of components, [g/mol]

rhosfloat

Boiling point liquid density, [kg/m³]

Returns:
rhofloat

High-pressure liquid density, [kg/m³]

References

[12] Thomson, G.H., Brobst, K.R., Hankinson, R.W.; An Improved Correlation for Densities of Compressed Liquids and Liquid Mixtures. AIChE Journal 28(4) (1982): 671-76

[2] API; Technical Data book: Petroleum Refining 6th Edition.

Examples

Example from [2]; 20% ethane, 80% nC10 at 166F and 3000psi

>>> T = unidades.Temperature(160, "F")
>>> P = unidades.Pressure(3000, "psi")
>>> xi = [0.2, 0.8]
>>> Tc1 = unidades.Temperature(89.92, "F")
>>> Tc2 = unidades.Temperature(652, "F")
>>> Tci = [Tc1, Tc2]
>>> Mi = [30.07, 142.286]
>>> Vc1 = unidades.SpecificVolume(2.335/Mi[0], "ft3lb")
>>> Vc2 = unidades.SpecificVolume(9.919/Mi[1], "ft3lb")
>>> Vci = [Vc1, Vc2]
>>> wi = [0.0983, 0.4916]
>>>
>>> Vs = unidades.SpecificVolume(2.8532/119.8428, "ft3lb")
>>> args = (T, P, xi, Tci, Vci, wi, Mi, 1/Vs)
>>> "%0.3f" % RhoL_TaitCostaldMix(*args).gcc
'0.698'
lib.mezcla.RhoL_NasrifarMix(T, P, xi, Tci, Vci, wi, Mi, rhos)[source]
Calculates compressed-liquid density of a mixture, using the

Nasrifar correlation

\[T_{cm} = \frac{\sum_i\sum_jx_ix_j\left(V_i^oT_{ci}V_j^oT_{cj}\right) ^{1/2}}{V_m^o}\]
\[V_m^o = \frac{\sum_i xiV_i^o + 3 \sum_i x_iV_i^{o^{2/3}} \sum_i x_iV_i^{o^{1/3}}}{4}\]
\[P_{cm} = \frac{\left(0.291-0.08\omega_{SRKm}\right)RT_{cm}}{V_{cm}}\]
\[\omega_{SRKm} = \sum_i x_i\omega_{SRKi}\]
Parameters:
Tfloat

Temperature, [K]

Pfloat

Pressure, [Pa]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of components, [K]

Vcilist

Critical volume of components, [m³/kg]

wilist

Acentric factor (SRK optimized) of components, [-]

Milist

Molecular weight of components, [g/mol]

rhosfloat

Boiling point liquid density, [kg/m³]

Returns:
rhofloat

High-pressure liquid density, [kg/m³]

References

[13] Nasrifar, K., Ayatollahi, S., Moshfeghian, M.; A Compressed Liquid Density Correlation. Fluid Phase Equilibria 168 (2000) 149-163

lib.mezcla.RhoL_APIMix(T, P, xi, Tci, Pci, rhos, To=None, Po=None)[source]
Calculates compressed-liquid density, using the analytical expression

of Lu Chart referenced in API procedure 6A2.22

\[\rho_2 = \rho_1\frac{C_2}{C_1}\]
Parameters:
Tfloat

Temperature, [K]

Pfloat

Pressure, [Pa]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of components, [K]

Pcilist

Critical pressure of components, [Pa]

rhosfloat

Liquid density at 60ºF, [kg/m^3]

Tofloat, optional

Reference temperature with known density, [K]

Pofloat, optional

Reference pressure with known density, [Pa]

Returns:
rhofloat

High-pressure liquid density, [kg/m^3]

References

[14] Rea, H.E., Spencer, C.F., Danner, R.P.; Effect of Pressure and Temperature on the Liquid Densities of Pure Hydrocarbons. J. Chem. Eng. Data 18(2) (1973) 227-230

[2] API; Technical Data book: Petroleum Refining 6th Edition.

Examples

Example A from [2]; 60.52% Ethylene, 39.48% n-heptane at 162.7ºF and 900psi

>>> T = unidades.Temperature(162.7, "F")
>>> P = unidades.Pressure(900, "psi")
>>> x = [0.6052, 0.3948]
>>> Tc = unidades.Temperature(48.58, "F")
>>> Tc2 = unidades.Temperature(512.7, "F")
>>> Pc = unidades.Pressure(729.8, "psi")
>>> Pc2 = unidades.Pressure(396.8, "psi")
>>> rs = unidades.Density(37.55, "lbft3")
>>> To = unidades.Temperature(49, "F")
>>> Po = unidades.Pressure(400, "psi")
>>> "%0.1f" % RhoL_APIMix(T, P, x, [Tc, Tc2], [Pc, Pc2], rs, To, Po).lbft3
'31.5'

Example C from [2]; 20% methane, 80% n-C10 at 160ºF and 3000psi

>>> T = unidades.Temperature(162.7, "F")
>>> P = unidades.Pressure(900, "psi")
>>> x = [0.2, 0.8]
>>> Tc1 = unidades.Temperature(-116.63, "F")
>>> Tc2 = unidades.Temperature(652.1, "F")
>>> Pc1 = unidades.Pressure(667.8, "psi")
>>> Pc2 = unidades.Pressure(304, "psi")
>>> rs = unidades.Density(41.65, "lbft3")
>>> "%0.1f" % RhoL_APIMix(T, P, x, [Tc1, Tc2], [Pc1, Pc2], rs).lbft3
'42.6'
lib.mezcla._Pv(T, Tcm, Pcm, wm)[source]
Pseudo vapor presure from pseudocritical properties to use in

compressed liquid density correlations

Parameters:
Tfloat

Temperature, [K]

Tcmfloat

Pseudo critical temperature of mixture, [K]

Pcmfloat

Pseudo critical pressure of mixture, [Pa]

wmfloat

Acentric factor of mixture, [-]

Returns:
Pbpfloat

Boiling point pressure, [Pa]

References

[11] Aalto, M., Keskinen, K.I., Aittamaa, J., Liukkonen, S.; An Improved Correlation for Compressed Liquid Densities of Hydrocarbons. Part 2. Mixtures. Fluid Phase Equilibria 114 (1996) 21-35

[12] Thomson, G.H., Brobst, K.R., Hankinson, R.W.; An Improved Correlation for Densities of Compressed Liquids and Liquid Mixtures. AIChE Journal 28(4) (1982): 671-76

lib.mezcla.MuL_KendallMonroe(xi, mui)[source]
Calculate viscosity of liquid mixtures using the Kendall-Monroe method,

also referenced in API procedure 11A3.1, pag 1051

\[\mu_m = \left(\sum_{i=1}^nx_i\mu_i^{1/3}\right)^3\]
Parameters:
xilist

Mole fractions of components, [-]

muilist

Viscosities of components, [Pa·s]

Returns:
mufloat

Viscosity of mixture, [Pa·s]

References

[20] Kendall, J., Monroe, P.; The Viscosity of Liquids II. The Viscosity-Composition Curve for Ideal Liquid Mixtures. J. Am. Chem. Soc. 39(9) (1917) 1787-1802

[2] API; Technical Data book: Petroleum Refining 6th Edition.

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

Examples

Example A from [2]; 29.57% nC16, 35.86% benzene, 34.57% nC6 at 77ºF

>>> x = [0.2957, 0.3586, 0.3457]
>>> mu = [3.03e-3, 0.6e-3, 0.3e-3]
>>> "%0.2f" % MuL_KendallMonroe(x, mu).cP
'0.89'

Example B from [2]; 25% nC3, 50% nC5, 25% cycloC6 at 160ºF >>> x = [0.25, 0.5, 0.25] >>> mu = [0.109e-3, 0.218e-3, 0.63e-3] >>> “%0.3f” % MuL_KendallMonroe(x, mu).cP ‘0.256’

lib.mezcla.MuL_Chemcad(xi, Mi, mui)[source]

Calculate viscosity of liquid mixtures using the mixing rules of Arrhenius and with modification used in CHEMCAD®

\[\mu_m = e^A\]
\[A = \sum_i \frac{x_iM_i}{M_m}\log\mu_i if M > 2000\]
\[A = \sum_i x_i\log\mu_i if M < 2000\]
Parameters:
xilist

Mole fractions of components, [-]

Milist

Molecular weight of components, [g/mol]

muilist

Viscosities of components, [Pa·s]

Returns:
mufloat

Viscosity of mixture, [Pa·s]

Notes

I can’t find any reference for this mixing rule. In some place is refered as the Arrhenius mixing rules, but only for the los molecular weight form.

lib.mezcla.MuG_Reichenberg(T, xi, Tci, Pci, Mi, mui, Di)[source]
Calculate viscosity of gas mixtures using the Reichenberg method as

explain in [3]

\[\eta_m = \sum _{i=1}^n K_i\left(1+2\sum_{j=1}^{i-1}H_{ij}K_j + \sum_{j=1≠i}^n \sum_{k=1≠i}^nH_{ij}H_{ik}K_jK_k\right)\]
\[K_i = \frac{x_i\eta_i}{x_i+\eta_i \sum_{k=1≠i}^n x_kH_{ik} \left[3+\left(2M_k/M_i\right)\right]}\]
\[H_{ij} = \left[\frac{M_iM_j}{32\left(M_i+M_j\right)^3}\right]^{1/2} \left(C_i+C_j\right)^2 \frac{\left[1+0.36T_{rij}\left(T_{rij}-1 \right)\right]^{1/6}F_{Rij}}{T_{rij}^{1/2}}\]
\[F_{Ri} = \frac{T_{ri}^{3.5}+\left(10\mu_{ri}\right)^7} {T_{ri}^{3.5}\left[1+\left(10\mu_{ri}\right)^7\right]}\]
\[C_i = \frac{M_i^{1/4}}{\left(\eta_iU_i\right)^{1/2}}\]
\[U_i = \frac{\left[1+0.36T_{ri}\left(T_{ri}-1\right)\right]^{1/6}F_{Ri}} {T_{ri}^{1/2}}\]
\[T_{rij} = \frac{T}{\left(T_{ci}T_{cj}\right)^{1/2}}\]
\[\mu_{rij} = \left(\mu_{ri}\mu_{rj}\right)^{1/2}\]
\[\mu_r = 52.46\frac{\mu^2P_c}{T_c^2}\]
Parameters:
Tfloat

Temperature, [K]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of components, [K]

Pcilist

Critical pressure of components, [Pa]

Milist

Molecular weights of components, [g/mol]

muilist

Viscosities of components, [Pa·s]

Dilist

Dipole moment of components, [Debye]

Returns:
mufloat

Viscosity of mixture, [Pa·s]

References

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

Examples

Example 9-4 from [3]; 28.6% N2, 71.4% R22 at 50ºC

>>> T = unidades.Temperature(50, "C")
>>> x = [0.286, 0.714]
>>> Tc = [126.2, 369.28]
>>> Pc = [33.98e5, 49.86e5]
>>> M = [28.014, 86.468]
>>> mu = [188e-7, 134e-7]
>>> D = [0, 1.4]
>>> "%0.1f" % MuG_Reichenberg(T, x, Tc, Pc, M, mu, D).microP
'146.2'
lib.mezcla.MuG_Wilke(xi, Mi, mui)[source]
Calculate viscosity of gas mixtures using the Wilke mixing rules, also

referenced in API procedure 11B2.1, pag 1102

\[\mu_{m} = \sum_{i=1}^n \frac{\mu_i}{1+\frac{1}{x_i}\sum_{j=1} ^n x_j \phi_{ij}}\]
\[\phi_{ij} = \frac{\left[1+\left(\mu_i/\mu_j\right)^{0.5}(M_j/M_i) ^{0.25}\right]^2}{4/\sqrt{2}\left[1+\left(M_i/M_j\right)\right] ^{0.5}}\]
Parameters:
xilist

Mole fractions of components, [-]

Milist

Molecular weights of components, [g/mol]

muilist

Viscosities of components, [Pa·s]

Returns:
mufloat

Viscosity of mixture, [Pa·s]

References

[1] Wilke, C.R.; A Viscosity Equation for Gas Mixtures. J. Chem. Phys. 18(4) (1950) 517-519

[2] API; Technical Data book: Petroleum Refining 6th Edition.

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

Examples

Selected point in Table II from [1] CO2 3.5%, O2 0.3%, CO 27.3%, H2 14.4%, CH4 3.7%, N2 50%, C2 0.8%

>>> from numpy import r_
>>> from lib.mEoS import CO2, O2, CO, H2, CH4, N2, C2
>>> Mi = [CO2.M, O2.M, CO.M, H2.M, CH4.M, N2.M, C2.M]
>>> xi = [0.035, 0.003, 0.273, 0.144, 0.037, 0.5, 0.008]
>>> mui = r_[147.2, 201.9, 174.9, 87.55, 108.7, 178.1, 90.9]
>>> "%0.7f" % MuG_Wilke(xi, Mi, mui*1e-9).dynscm2
'0.0001711'

Example A from [2]; 58.18% H2, 41.82% propane at 77ºF and 14.7 psi

>>> mu = MuG_Wilke([0.5818, 0.4182], [2.02, 44.1], [8.91e-6, 8.22e-6])
>>> "%0.4f" % mu.cP
'0.0092'

Example B from [2] 95.6% CH4, 3.6% C2, 0.5% C3, 0.3% N2

>>> x = [0.956, 0.036, 0.005, 0.003]
>>> Mi = [16.04, 30.07, 44.1, 28.01]
>>> mui = [1.125e-5, 9.5e-6, 8.4e-6, 1.79e-5]
>>> "%0.5f" % MuG_Wilke(x, Mi, mui).cP
'0.01117'

Example 9-5 from [3], methane 69.7%, n-butane 30.3%

>>> mui = [109.4e-7, 72.74e-7]
>>> "%0.2f" % MuG_Wilke([0.697, 0.303], [16.043, 58.123], mui).microP
'92.25'
lib.mezcla.MuG_Herning(xi, Mi, mui)[source]
Calculate viscosity of gas mixtures using the Herning-Zipperer mixing

rules, as explain in [3]

\[\mu_{m} = \sum_{i=1}^n \frac{\mu_i}{1+\frac{1}{x_i}\sum_{j=1} ^n x_j \phi_{ij}}\]
\[\phi_{ij} = \left(\frac{M_j}{M_i}\right)^{1/2}\]
Parameters:
xilist

Mole fractions of components, [-]

Milist

Molecular weights of components, [g/mol]

muilist

Viscosities of components, [Pa·s]

Returns:
mufloat

Viscosity of mixture, [Pa·s]

References

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

Examples

Example 9-6 from [3], methane 69.7%, n-butane 30.3%

>>> mui = [109.4e-7, 72.74e-7]
>>> "%0.1f" % MuG_Herning([0.697, 0.303], [16.043, 58.123], mui).microP
'92.8'
lib.mezcla.MuG_Lucas(T, P, xi, Tci, Pci, Vci, Zci, Mi, Di)[source]
Calculate the viscosity of a gas mixture using the Lucas mixing rules

as explain in [3].

\[T_{cm} = \sum_i x_iT_{ci}\]
\[P_{cm} = RT_{cm}\frac{\sum_i x_iZ_{ci}}{\sum_i x_iV_{ci}}\]
\[M_m = \sum_i x_iM_i\]
\[F_{Pm}^o = \sum_i x_iF_{Pi}^o\]
\[F_{Qm}^o = \left(\sum_i x_iF_{Qi}^o\right)A\]
\[A = 1-0.01\left(\frac{M_H}{M_L}\right)^{0.87}\]
Parameters:
Tfloat

Temperature, [K]

Pfloat

Pressure, [Pa]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of components, [K]

Pcilist

Critical pressure of components, [Pa]

Vcilist

Critical volume of components, [m³/kg]

Zcilist

Critical compressibility factor of components, [-]

Milist

Molecular weights of components, [g/mol]

Dilist

Dipole moment of components, [Debye]

Returns:
mufloat

Viscosity of gas, [Pa·s]

References

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

Examples

Example 9-7 in [3], 67.7% NH3 33.3% H2 at 33ºC

>>> Tc = [405.5, 33.2]
>>> Pc = [113.5e5, 13e5]
>>> Vc =[72.5/17.031/1000, 64.3/2.016/1000]
>>> Zc = [0.244, 0.306]
>>> M = [17.031, 2.0158]
>>> D = [1.47, 0]
>>> mu = MuG_Lucas(33+273.15, 101325, [0.677, 0.323], Tc, Pc, Vc, Zc, M, D)
>>> "%0.1f" % mu.microP
'116.3'
lib.mezcla.MuG_Chung(T, xi, Tci, Vci, Mi, wi, Di, ki)[source]

Calculate the viscosity of a gas mixture using the Chung correlation

\[\mu=40.785\frac{F_{cm}\left(M_mT\right)^{1/2}}{V_{cm}^{2/3}\Omega_v}\]
\[\sigma_i = 0.809V_{ci}^{1/3}\]
\[\sigma_{ij} = \xi\left(\sigma_i\sigma_j\right)^{1/2}\]
\[\sigma_m^3 = \sum_i \sum_j x_ix_j\sigma_{ij}^3\]
\[\frac{\epsilon_i}{k} = \frac{T_{ci}}{1.2593}\]
\[\frac{\epsilon_{ij}}{k} = \zeta\left(\frac{\epsilon_i}{k} \frac{\epsilon_j}{k}\right)^{1/2}\]
\[\left(\frac{\epsilon}{k}\right)_m = \frac{\sum_i \sum_j x_ix_j \left(\epsilon_{ij}/k\right)\sigma_{ij}^3}{\sigma_m^3}\]
\[\omega_{ij} = \frac{\omega_i+\omega_j}{2}\]
\[\kappa_{ij} = \left(\kappa_i+\kappa_j\right)^{1/2}\]
\[M_{ij} = \frac{2M_iM_j}{M_i+M_j}\]
\[M_m = \left[\frac{\sum_i\sum_jx_ix_j\left(\epsilon_{ij}/k\right)\sigma_ {ij}^3M_{ij}^{1/2}}{\left(\epsilon/k\right)_m\sigma_m^3}\right]^2\]
\[\omega_m =\frac{\sum_i\sum_jx_ix_j\omega_{ij}\sigma_{ij}^3}{\sigma_m^3}\]
\[\mu_m^4 = \sigma_m^3\sum_i\sum_j\frac{x_ix_j\mu_i^2\mu_j^2} {\sigma_{ij}^3}\]
\[\kappa_m = \sum_i \sum_j x_ix_j\kappa_{ij}\]
\[F_{cm} = 1-0.2756\omega_m+0.059035\mu_{rm}^4+\kappa_m\]
\[mu_{rm} = \frac{131.3\mu}{\left(V_{cm}T_{cm}\right)^{1/2}}\]
\[T_{cm} = 1.2593\left(\frac{\epsilon}{k}\right)_m\]
\[V_{cm} = \left(\frac{\sigma_m}{0.809}\right)^3\]
Parameters:
Tfloat

Temperature, [K]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of components, [K]

Vcilist

Critical volume of components, [m³/kg]

Milist

Molecular weights of components, [g/mol]

wilist

Acentric factor of components, [-]

Dilist

Dipole moment of components, [Debye]

kilist

Correction factor for polar substances, [-]

Returns:
mufloat

Viscosity of gas, [Pa·s]

Notes

The method use binary interaction parameters for disimilar molecules, polar of hidrogen-bonding substances. That parameters must be calculated from experimental data. In this implementation this paramter set equal to unity

References

[15] Chung, T.H., Ajlan, M., Lee, L.L., Starling, K.E.; Generalized Multiparameter Correlation for Nonpolar and Polar Fluid Transport Properties. Ind. Eng. Chem. Res. 27(4) (1988) 671-679

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

Examples

Example 9-8 in [3], 20.4% H2S 79.6% ethyl ether at 331K

>>> x = [0.204, 0.796]
>>> Tc = [373.4, 466.7]
>>> Vc = [98/34.082/1000, 280/74.123/1000]
>>> M = [34.082, 74.123]
>>> w = [0.09, 0.281]
>>> mu = [0.9, 1.3]
>>> k = [0, 0]
>>> "%0.1f" % MuG_Chung(331, x, Tc, Vc, M, w, mu, k).microP
'87.6'
lib.mezcla.MuG_P_Chung(T, xi, Tci, Vci, Mi, wi, Di, ki, rho, muo)[source]

Calculate the viscosity of a compressed gas using the Chung correlation

\[\mu=40.785\frac{F_c\left(MT\right)^{1/2}}{V_c^{2/3}\Omega_v}\]
Parameters:
Tfloat

Temperature, [K]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of components, [K]

Vcilist

Critical volume of components, [m³/kg]

Milist

Molecular weights of components, [g/mol]

wilist

Acentric factor of components, [-]

Dilist

Dipole moment of components, [Debye]

kilist

Correction factor for polar substances, [-]

rhofloat

Density, [kg/m³]

muofloat

Viscosity of low-pressure gas, [Pa·s]

Returns:
mufloat

Viscosity of gas mixture, [Pa·s]

References

[15] Chung, T.H., Ajlan, M., Lee, L.L., Starling, K.E.; Generalized Multiparameter Correlation for Nonpolar and Polar Fluid Transport Properties. Ind. Eng. Chem. Res. 27(4) (1988) 671-679

[1] Wilke, C.R.; A Viscosity Equation for Gas Mixtures. J. Chem. Phys. 18(4) (1950) 517-519

lib.mezcla.MuG_TRAPP(T, P, xi, Tci, Vci, Zci, Mi, wi, rho, muo)[source]
Calculate the viscosity of a compressed gas using the TRAPP (TRAnsport

Property Prediction) method.

\[\eta_m - \eta_m^o = F_{\eta m}\left(\eta^R-\eta^{Ro}\right) + \Delta\eta^{ENSKOG}\]
\[h_m = \sum_i\sum_jx_ix_jh_{ij}\]
\[f_mh_m = \sum_i\sum_jx_ix_jf_{ij}h_{ij}\]
\[h_{ij} = \frac{\left(h_i^{1/3}+h_j^{1/3}\right)^3}{8}\]
\[f_{ij} = \left(f_if_j\right)^{1/2}\]
\[T_o = T/f_m\]
\[\rho_o = \rho h_m\]
\[F_{\eta m} = \frac{1}{44.094^{1/2}h_m^2} \sum_i\sum_j x_ix_j \left(f_{ij}M_{ij}\right)^{1/2}h_{ij}^{4/3}\]
\[M_{ij} = \frac{2M_iM_j}{M_i+M_j}\]
\[\Delta\eta^{ENSKOG} = \eta_m^{ENSKOG} - \eta_x^{ENSKOG}\]
\[\eta_m^{ENSKOG} = \sum_i \beta_iY_i + \sum_i\sum_jx_ix_j\sigma_{ij}^6 \eta_{ij}^og_{ij}\]
\[\sigma_i = 4.771h_i^{1/3}\]
\[\sigma_{ij} = \frac{\sigma_i+\sigma_j}{2}\]
\[g_{ij} = \frac{1}{1-\xi}+\frac{3\xi}{\left(1-\xi\right)^2}\Theta_{ij}+ \frac{2\xi^2}{\left(1-\xi\right)^3}\Theta_{ij}^2\]
\[\Theta_{ij} = \frac{\sigma_i\sigma_j}{2\sigma_{ij}} \frac{\sum_kx_k\sigma_k^2}{\sum_k x_k\sigma_k^3}\]
\[\xi = 6.023e-4\frac{\pi}{6}\rho\sum_i x_i\sigma_i^3\]
\[Y_i = x_i\left[1+\frac{8\pi}{15}6.023e-4\rho\sum_jx_j\left(\frac{M_j} {M_i+M_j}\right)\sigma_{ij}^3g_{ij}\right]\]
\[\sum_i B_{ij}\beta_j = Y_i\]
\[B_{ij} = 2\sum_kx_ix_k\frac{g_{ik}}{\eta_{ij}^o}\left(\frac{M_k} {M_i+M_k}\right)^2\left[\left(1+\frac{5}{3}\frac{M_i}{M_k}\right) \delta_{ij}-\frac{2}{3}\frac{M_i}{M_k}\delta_{jk}\right]\]
\[\sigma_x = \left(\sum_i\sum_jx_ix_j\sigma_{ij}^3\right)^{1/3}\]
\[M_x = \frac{\left(\sum_i\sum_jx_ix_jM_{ij}^{1/2}\sigma_{ij}^4\right)^2} {\sigma_x^8}\]
Parameters:
Tfloat

Temperature, [K]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of components, [K]

Vcilist

Critical volume of components, [m³/kg]

Zcilist

Critical compressibility factor of components, [K]

Milist

Molecular weights of components, [g/mol]

wilist

Acentric factor of components, [-]

rhofloat

Density, [kg/m³]

muofloat

Viscosity of low-pressure gas, [Pa·s]

Returns:
mufloat

Viscosity of gas, [Pa·s]

References

[1] Wilke, C.R.; A Viscosity Equation for Gas Mixtures. J. Chem. Phys. 18(4) (1950) 517-519

[21] Ely, J.F., Hanley, H.J.M.; A Computer Program for the Prediction of Viscosity and Thermal Condcutivity in Hydrocarbon Mixtures. NBS Technical Note 1039 (1981)

[16] Younglove, B.A., Ely, J.F.; Thermophysical Properties of Fluids. II. Methane, Ethane, Propane, Isobutane, and Normal Butane. J. Phys. Chem. Ref. Data 16(4) (1987) 577-798

[17] Ely, J.F.; An Enskog Correction for Size and Mass Difference Effects in Mixture Viscosity Prediction. J. Res. Natl. Bur. Stand. 86(6) (1981) 597-604

Examples

Example 9-14 in [3], 80% methane, 20% nC10 at 377.6K and 413.7bar

>>> x = [0.8, 0.2]
>>> M = [16.043, 142.285]
>>> Tc = [190.56, 617.7]
>>> Vc = [98.6/16.043/1000, 624/142.285/1000]
>>> Zc = [0.286, 0.256]
>>> w = [0.011, 0.49]
>>> rho = 1/243.8*58.123*1000
>>> mu = MuG_TRAPP(377.6, 413.7e5, x, Tc, Vc, Zc, M, w, 448.4, 10.2e-6)
>>> "%0.1f" % mu.muPas
'82.6'
lib.mezcla.MuG_DeanStielMix(xi, Tci, Pci, Mi, rhoc, rho, muo)[source]
Calculate the viscosity of a compressed gas using the Dean-Stiel

correlation, also referenced in API databook Procedure 11B4.1, pag 1107

\[\left(\mu-\mu_o\right)\xi=10.8x10^{-5}\left[exp\left(1.439\rho_r\right) -exp\left(-1.11\rho_r^{1.858}\right)\right]\]
\[\xi = \frac{T_{pc}^{1/6}}{M_m^{1/2}P_{pc}^{2/3}\]
\[T_{pc} = \sum_i x_iT_{ci}\]
\[P_{pc} = \sum_i x_iP_{ci}\]
\[M_m = \sum_i x_iM_i\]
Parameters:
xilist

Mole fractions of components, [-]

Tcifloat

Critical temperature of components, [K]

Pcifloat

Critical pressure of components, [Pa]

Milist

Molecular weight of components, [g/mol]

rhocfloat

Critical Density of mixture, [kg/m³]

rhofloat

Density, [kg/m³]

muofloat

Viscosity of low-pressure gas, [Pa·s]

Returns:
mufloat

Viscosity of gas, [Pa·s]

References

[19] Dean, D.E., Stiel, L.I.; The Viscosity of Nonpolar Gas Mixtures at Moderate and High Pressures. AIChE Journal 11(3) (1965) 526-532

[2] API; Technical Data book: Petroleum Refining 6th Edition.

Examples

Example in [2], 60% Methane 40% propane at 1500psi and 257ºF

>>> Tc1 = unidades.Temperature(-116.66, "F")
>>> Tc2 = unidades.Temperature(206.02, "F")
>>> Pc1 = unidades.Pressure(667.04, "psi")
>>> Pc2 = unidades.Pressure(616.13, "psi")
>>> x = [0.6, 0.4]
>>> args = (x, [Tc1, Tc2], [Pc1, Pc2], [16.04, 44.1], 1, 0.5283, 123e-7)
>>> "%0.4f" % MuG_DeanStielMix(*args).cP
'0.0163'
lib.mezcla.MuG_APIMix(T, P, xi, Tci, Pci, muo)[source]
Calculate the viscosity of nonhydrocarbon gases at high pressure using

the linearization of Carr figure as give in API Databook procedure 11C1.2, pag 1113

\[\frac{\mu}{\mu_o}=A_1hP_r^f + A_2\left(kP_r^l+mP_r^n+pP_r^q\right)\]
Parameters:
Tfloat

Temperature, [K]

Pfloat

Pressure, [Pa]

xilist

Mole fractions of components, [-]

Tcifloat

Critical temperature of components, [K]

Pcifloat

Critical pressure of components, [Pa]

muofloat

Viscosity of low-pressure gas, [Pa·s]

Returns:
mufloat

Viscosity of gas, [Pa·s]

Notes

This method is recomended for gaseous nonhydrocarbons at high pressure, although this method is also applicable for hydrocarbons.

References

[2] API; Technical Data book: Petroleum Refining 6th Edition.

Examples

Example B in [2], 60% Methane 40% propane at 1500psi and 257ºF

>>> T = unidades.Temperature(257, "F")
>>> P = unidades.Pressure(1500, "psi")
>>> Tc1 = unidades.Temperature(-116.66, "F")
>>> Tc2 = unidades.Temperature(206.02, "F")
>>> Pc1 = unidades.Pressure(667.04, "psi")
>>> Pc2 = unidades.Pressure(616.13, "psi")
>>> x = [0.6, 0.4]
>>> "%0.4f" % MuG_APIMix(T, P, x, [Tc1, Tc2], [Pc1, Pc2], 123e-7).cP
'0.0173'
lib.mezcla.ThL_Li(xi, Vi, Mi, ki)[source]
Calculate thermal conductiviy of liquid nmixtures using the Li method,

also referenced in API procedure 12A2.1, pag 1145

\[\lambda_{m} = \sum_{i} \sum_{j} \phi_i \phi_j k_{ij}\]
\[k_{ij} = 2\left(\lambda_i^{-1}+\lambda_j^{-1}\right)^{-1}\]
\[\phi_{i} = \frac{x_iV_i}{\sum_j x_jV_j}\]
Parameters:
xilist

Mole fractions of components, [-]

Vilist

Specific volume of components, [m³/kg]

Milist

Molecular weight of components, [g/mol]

kilist

Thermal conductivities of components, [W/m·K]

Returns:
kfloat

Thermal conductivities of mixture, [W/m·K]

References

[4] Li, C.C.; Thermal Conductivity of Liquid Mixtures. AIChE Journal 22(5) (1976) 927-930

[2] API; Technical Data book: Petroleum Refining 6th Edition.

Examples

Example from [2] 68% nC7, 32% CycloC5 at 32F and 1atm

>>> V1 = unidades.MolarVolume(2.285, "ft3lbmol")
>>> V2 = unidades.MolarVolume(1.473, "ft3lbmol")
>>> k1 = unidades.ThermalConductivity(0.07639, "BtuhftF")
>>> k2 = unidades.ThermalConductivity(0.08130, "BtuhftF")
>>> "%0.5f" % ThL_Li([0.68, 0.32], [V1, V2], [1, 1], [k1, k2]).BtuhftF
'0.07751'
lib.mezcla.ThL_Power(wi, ki)[source]
Calculate thermal conductiviy of liquid nmixtures using the power law

method, as referenced in [3]

\[\lambda_{m} = \frac{1}{\sqrt{\sum_{i} w_i/\lambda_i^2}}\]
Parameters:
wilist

Weight fractions of components, [-]

kilist

Thermal conductivities of components, [W/m·K]

Returns:
kfloat

Thermal conductivities of mixture, [W/m·K]

Notes

This method shold not be used if water is in the mixture or if pure component thermal conductivities are very different, ki/kj < 2

References

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

lib.mezcla.ThG_LindsayBromley(T, xi, Mi, Tbi, mui, ki)[source]
Calculate thermal conductiviy of gas mixtures using the Lindsay-Bromley

method, also referenced in API procedure 12B2.1, pag 1164

\[k = \sum_{i} \frac{k_i}{\frac{1}{x_i}\sum x_i A_{ij}}\]
\[A_{ij} = \frac{1}{4} \left\{ 1 + \left[\frac{\mu_i}{\mu_j} \left(\frac{M_j}{M_i}\right)^{0.75} \left(\frac{1+S_i/T}{1+S_j/T} \right)\right]^{0.5}\right\}^2\left(\frac{1+S_{ij}/T}{1+S_i/T}\right)\]
\[S_{ij} = (S_i S_j)^{0.5}\]
Parameters:
Tfloat

Temperature, [K]

xilist

Mole fractions of components, [-]

Mifloat

Molecular weights of components, [g/mol]

Tbifloat

Boiling points of components, [K]

muifloat

Gas viscosities of components, [Pa·s]

kilist

Thermal conductivities of components, [W/m·K]

Returns:
kfloat

Thermal conductivities of mixture, [W/m·K]

References

[5] Lindsay, A.L., Bromley, L.A.; Thermal Conductivity of Gas Mixtures. Ind. & Eng. Chem. 42(8) (1950) 1508-1511

[2] API; Technical Data book: Petroleum Refining 6th Edition.

Examples

Example from [2] 29.96% nC5, 70.04% nC6 at 212F and 1atm

>>> T = unidades.Temperature(212, "F")
>>> x = [0.2996, 0.7004]
>>> M = [72.15, 86.18]
>>> Tb1 = unidades.Temperature(96.93, "F")
>>> Tb2 = unidades.Temperature(155.71, "F")
>>> mu1 = unidades.Viscosity(0.008631, "cP")
>>> mu2 = unidades.Viscosity(0.008129, "cP")
>>> k1 = unidades.ThermalConductivity(0.01280, "BtuhftF")
>>> k2 = unidades.ThermalConductivity(0.01165, "BtuhftF")
>>> k = ThG_LindsayBromley(T, x, M, [Tb1, Tb2], [mu1, mu2], [k1, k2])
>>> "%0.5f" % k.BtuhftF
'0.01197'
lib.mezcla.ThG_MasonSaxena(xi, Mi, mui, ki)[source]
Calculate thermal conductiviy of gas mixtures using the Mason-Saxena

method

\[k = \sum_{i} \frac{k_i}{\frac{1}{x_i}\sum x_i A_{ij}}\]
\[A_{ij} = \frac{\epsilon \left[1+\left(\lambda_{tri}/\lambda_{trj} \right)^{1/2} \left(M_i/M_j\right)^{1/4}\right]^2} {\left[8\left(1+M_i/M_j\right)\right]^{1/2}}\]
\[\frac{\lambda_{tri}}{\lambda_{trj}}=\frac{\mu_i}{\mu_j}\frac{M_i}{M_j}\]
Parameters:
xilist

Mole fractions of components, [-]

Mifloat

Molecular weights of components, [g/mol]

muifloat

Gas viscosities of components, [Pa·s]

kilist

Thermal conductivities of components, [W/m·K]

Returns:
kfloat

Thermal conductivities of mixture, [W/m·K]

References

[6] Mason, E.A., Saxena, S.C.; Approximate Formula for the Thermal Conductivity of Gas Mixtures. Fhys. Fluids 1(5) (1958) 361-369

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

Examples

Example 10-5 from [3]; 25% benzene, 75% Argon at 100.6ºC and 1bar

>>> xi = [0.25, 0.75]
>>> Mi = [78.114, 39.948]
>>> mui = [92.5e-7, 271e-7]
>>> ki = [0.0166, 0.0214]
>>> "%0.4f" % ThG_MasonSaxena(xi, Mi, mui, ki)
'0.0184'
lib.mezcla.ThG_Chung(T, xi, Tci, Vci, Mi, wi, Cvi, mu)[source]
Calculate thermal conductivity of gas mixtures at low pressure using

the Chung correlation

\[\lambda_o = \frac{7.452\mu_o\Psi}{M}\]
\[\Psi = 1 + \alpha \left\{[0.215+0.28288\alpha-1.061\beta+0.26665Z]/ [0.6366+\beta Z + 1.061 \alpha \beta]\right\}\]
\[\alpha = \frac{C_v}{R}-1.5\]
\[\beta = 0.7862-0.7109\omega + 1.3168\omega^2\]
\[Z=2+10.5T_r^2\]
Parameters:
Tfloat

Temperature, [K]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of compounds, [K]

Vcilist

Critical volume of compounds, [m³/kg]

Milist

Molecular weight of components, [g/mol]

wilist

Acentric factor of compounds, [-]

Cvilist

Ideal gas heat capacity at constant volume of components, [J/kg·K]

mufloat

Gas viscosity [Pa·s]

Returns:
kfloat

Thermal conductivity, [W/m/k]

References

[15] Chung, T.H., Ajlan, M., Lee, L.L., Starling, K.E.; Generalized Multiparameter Correlation for Nonpolar and Polar Fluid Transport Properties. Ind. Eng. Chem. Res. 27(4) (1988) 671-679

[1] Wilke, C.R.; A Viscosity Equation for Gas Mixtures. J. Chem. Phys. 18(4) (1950) 517-519

Examples

Example 10-5 from [3]; 25% benzene, 75% Argon at 100.6ºC and 1bar

>>> T = unidades.Temperature(100.6, "C")
>>> xi = [0.25, 0.75]
>>> Tci = [562.05, 150.86]
>>> Vci = [256/78.114/1000, 74.57/39.948/1000]
>>> Mi = [78.114, 39.948]
>>> wi = [0.21, -0.002]
>>> Cvi = [96.2/78.114*1000, 12.5/39.948*1000]
>>> mui = [92.5e-7, 271e-7]
>>> ki = [0, 0]
>>> mu = MuG_Chung(T, xi, Tci, Vci, Mi, wi, mui, ki)
>>> "%0.1f" % mu.microP
'183.3'
>>> "%0.4f" % ThG_Chung(T, xi, Tci, Vci, Mi, wi, Cvi, mu)
'0.0222'
lib.mezcla.ThG_P_Chung(T, xi, Tci, Vci, Mi, wi, Di, ki, rho, ko)[source]
Calculate the thermal conductivity of a compressed gas mixture using

the Chung correlation

\[\lambda = \frac{31.2 \eta^o\Psi}{M}(1/G_2+B_6y)+qB_7y^2T_r^{1/2}G_2\]
Parameters:
Tfloat

Temperature, [K]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of compounds, [K]

Vcilist

Critical volume of compounds, [m³/kg]

Milist

Molecular weight of components, [g/mol]

wilist

Acentric factor of compounds, [-]

Dilist

Dipole moment of compounds, [Debye]

kilist

Corection factor for polar substances, [-]

rhofloat

Density, [kg/m³]

kofloat

Low-pressure gas thermal conductivity[Pa*S]

Returns:
kfloat

High-pressure gas thermal conductivity [W/m/k]

References

[15] Chung, T.H., Ajlan, M., Lee, L.L., Starling, K.E.; Generalized Multiparameter Correlation for Nonpolar and Polar Fluid Transport Properties. Ind. Eng. Chem. Res. 27(4) (1988) 671-679

[1] Wilke, C.R.; A Viscosity Equation for Gas Mixtures. J. Chem. Phys. 18(4) (1950) 517-519

Examples

Example 10-7 from [3]; 75.5% methane, 24.5% CO2 at 370.8K and 174.8bar

>>> Tc = [190.56, 304.12]
>>> Vc = [98.6/16.043/1000, 94.07/44.01/1000]
>>> M = [16.043, 44.01]
>>> w = [0.011, 0.225]
>>> x = [0.755, 0.245]
>>> D = [0, 0]
>>> k = [0, 0]
>>> args = (370.8, x, Tc, Vc, M, w, D, k, 1/159*22.9*1000, 0.0377)
>>> "%0.3f" % ThG_P_Chung(*args)
'0.058'
lib.mezcla.ThG_StielThodosYorizane(T, xi, Tci, Pci, Vci, wi, Mi, V, ko)[source]
Calculate thermal conductiviy of gas mixtures at high pressure using

the Stiel-Thodos correlation for pure compound using the mixing rules defined by Yorizane et al.

\[T_{cm} = \frac{\sum_i \sum_j x_ix_jV_{cij}T_{cij}}{V_{cm}}\]
\[V_{cm} = \sum_i \sum_j x_ix_jV_{cij}\]
\[\omega_m = \sum_i x_i\omega_i\]
\[Z_{cm} = 0.291-0.08\omega_m\]
\[P_{cm} = \frac{Z_{cm}RT_{cm}}{V_{cm}}\]
\[M_m = \sum_i x_iM_i\]
\[T_{cij} = \left(T_{ci}T_{cj}\right)^{1/2}\]
\[V_{cij} = \frac{\left(V_{ci}^{1/3}+V_{cj}^{1/3}\right)^3}{8}\]
Parameters:
Tfloat

Temperature, [K]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of compounds, [K]

Vcilist

Critical volume of compounds, [m³/kg]

Zcilist

Critical pressure of compounds, [-]

wilist

Acentric factor of compounds, [-]

Milist

Molecular weight of compounds, [g/mol]

Vfloat

Specific volume, [m³/kg]

kolist

Thermal conductivities of mixture at low pressure, [W/m·K]

Returns:
kfloat

Thermal conductivities of mixture, [W/m·K]

References

[7] Yorizane, M., Yoshiumra, S., Masuoka, H., Yoshida, H.; Thermal Conductivities of Binary Gas Mixtures at High Pressures: N2-O2, N2-Ar, CO2-Ar, CO2-CH4. Ind. Eng. Chem. Fundam. 22(4) (1983) 458-462

[3] Poling, B.E, Prausnitz, J.M, O’Connell, J.P; The Properties of Gases and Liquids 5th Edition. McGraw-Hill, New York, 2001

Examples

Example 10-6 from [3]; 75.5% methane, 24.5% CO2 at 370.8K and 174.8bar

>>> Tc = [190.56, 304.12]
>>> Pc = [45.99e5, 73.74e5]
>>> Vc = [98.6/16.043/1000, 94.07/44.01/1000]
>>> M = [16.043, 44.01]
>>> w = [0.011, 0.225]
>>> x = [0.755, 0.245]
>>> args = (370.8, x, Tc, Pc, Vc, w, M, 159/22.9/1000, 0.0377)
>>> "%0.4f" % ThG_StielThodosYorizane(*args)
'0.0527'
lib.mezcla.ThG_TRAPP(T, xi, Tci, Vci, Zci, wi, Mi, rho, ko)[source]
Calculate the thermal conductivity of gas mixtures at high pressure

using the TRAPP (TRAnsport Property Prediction) method.

\[\lambda_m = \lambda_m^o+F_{\lambda m}X_{\lambda m} \left(\lambda^R-\lambda^{Ro}\right)\]
\[h_m = \sum_i \sum_j x_ix_jh_{ij}\]
\[f_m = \frac{\sum_i \sum_j x_ix_jf_{ij}h_{ij}}{h_m}\]
\[h_{ij}=\frac{\left(h_i^{1/3}+h_j^{1/3}\right)^3}{8}\]
\[f_{ij} = \left(f_if_j\right)^{1/2}\]
\[T_o = T/f_m\]
\[\rho_o = \rho h_m\]
\[F_{\lambda m} = \frac{44.094^{1/2}}{h_m^2} \sum_i \sum_j x_ix_j \left(\frac{f_{ij}}{M_{ij}}\right)^{1/2}h_{ij}^{4/3}\]
\[M_{ij} = \left(\frac{1}{2M_i}+\frac{1}{2M_j}\right)^{-1}\]
\[X_{\lambda m} = \left[1+\frac{2.1866\left(\omega_m-\omega^R\right)} {1-0.505\left(\omega_m-\omega^R\right)}\right]^{1/2}\]
\[\omega_m = \sum_i x_i\omega_i\]
Parameters:
Tfloat

Temperature, [K]

xilist

Mole fractions of components, [-]

Tcilist

Critical temperature of compounds, [K]

Vcilist

Critical volume of compounds, [m³/kg]

Zcilist

Critical pressure of compounds, [Pa]

wilist

Acentric factor of compounds, [-]

Milist

Molecular weight of compounds, [g/mol]

rhofloat

Density, [kg/m3]

kofloat

Low-pressure gas thermal conductivity, [Pa*S]

Returns:
kfloat

High-pressure gas thermal conductivity [W/m/k]

References

[1] Wilke, C.R.; A Viscosity Equation for Gas Mixtures. J. Chem. Phys. 18(4) (1950) 517-519

[21] Ely, J.F., Hanley, H.J.M.; A Computer Program for the Prediction of Viscosity and Thermal Condcutivity in Hydrocarbon Mixtures. NBS Technical Note 1039 (1981)

Examples

Example 10-8 from [3]; 75.5% methane, 24.5% CO2 at 370.8K and 174.8bar

>>> Tc = [190.56, 304.12]
>>> Vc = [98.6/16.043/1000, 94.07/44.01/1000]
>>> Zc = [0.286, 0.274]
>>> M = [16.043, 44.01]
>>> w = [0.011, 0.225]
>>> x = [0.755, 0.245]
>>> args = (370.8, x, Tc, Vc, Zc, w, M, 1/159*22.9*1000, 0.0377)
>>> "%0.4f" % ThG_TRAPP(*args)
'0.0549'
lib.mezcla.Tension(xi, sigmai)[source]
Calculate surface tension of liquid nmixtures using the Morgan-Griggs

law of mixtures method, also referenced in API procedure 10A2.1, pag 991

\[\sigma_{m} = \sum_{i} x_i \sigma_i\]
Parameters:
xilist

Mole fractions of components, [-]

sigmailist

Surface tension of components, [N/m]

Returns:
sigmafloat

Surface tension of mixture, [N/m]

References

[8] Livingston, J.k Morgan, R., Griggs, M.A.; The Properties of Mixed Liquids III. The Law of Mixtures I. J. Am. Chem. Soc. 39 (1917) 2261-2275

[2] API; Technical Data book: Petroleum Refining 6th Edition.

Examples

Example from [2] 37.9% benzene, 62.1% CycloC6 at 77F and 1atm

>>> s1 = unidades.Tension(28.2, "dyncm")
>>> s2 = unidades.Tension(24.3, "dyncm")
>>> "%0.1f" % Tension([0.379, 0.621], [s1, s2]).dyncm
'25.8'
class lib.mezcla.Mezcla(tipo=0, **kwargs)[source]

Bases: Entity

Class to model mixture calculation, components, physics properties, mixing rules, entity save/load layer.

Parameters:
tipoint

kind of mix definition:

  • 0 : Undefined

  • 1 : Unitary Massflow

  • 2 : Unitary Molarflow

  • 3 : Mass flow and molar fractions

  • 4 : Mass flow and mass fractions

  • 5 : Molar flow and molar fractions

  • 6 : Molar flow and mass fractions

idslist

Index of component in database, [-]

customCmplist

List with additional component defined out of main database

fraccionMolar: list

Molar fraccion list of compounds, [-]

fraccionMasica: list

Mass fraccion list of compounds, [-]

caudalMasico: float

Total mass flow, [kg/h)

caudalMolar: float

Total molar flow, [kmol/h)

caudalUnitarioMasico: list

Mass flow for each compund, [kg/h]

caudalUnitarioMolar: list

Molar flow for each compund, [kmol/h]

Methods

Cp_Gas(T, P)

Calculate specific heat from gas, API procedure 7D4.1, pag 714

Cp_Liquido(T)

Calculate specific heat from liquid, API procedure 7D1.9, pag 714

Mu_Gas(T, P, rho)

General method for calculate viscosity of gas

Mu_Liquido(T, P)

General method for calculate viscosity of Liquid

RhoL(T, P)

Calculate the density of liquid phase using any of available correlation

Tension(T)

General method for calculate surface tension

ThCond_Gas(T, P, rho)

General method for calculate thermal conductivity of gas

ThCond_Liquido(T, P, rho)

General method for calculate thermal conductivity of liquid

__call__()

Add callable functionality, so it can be possible add kwargs, advanced functionality can be added in subclass

readStatefromJSON(mezcla)

Read entity state from JSON file

recallZeros(lista[, val])

Method to return any list with null component added

writeStatetoJSON(state)

Write entity state to JSON file

Notes

Additionally can define custom calculation method with the parameters:

  • ids: List with component index of mixture

  • rhoLMix: Liquid density correlation index

  • Corr_RhoLMix: Compressed liquid density correlation index

  • MuLMix: Liquid viscosity correlation index

  • MuGMix: Gas viscosity correlation index

  • corr_MuGMix: Compressed gas viscosity correlation index

  • ThCondLMix: Liquid thermal conductivity correlation index

  • ThCondGMix: Gas thermal conductivity correlation index

  • corr_ThCondGMix: Compressed gas thermal conductivity correlation

These options overwrite the project configuration and the user configuration, for now only in API usage. Not custom stream property definition in main program

Examples

This are several ejemples of usage of this class with several configuration definition, obviously not all correlation return valid values.

Liquid density methods: Example from [2]; 58.71% ethane, 41.29% heptane at 91ºF

>>> xi = [0.5871, 0.4129]
>>> c0 = Mezcla(2, ids=[3, 11], caudalUnitarioMolar=xi, RhoLMix=0)
>>> c1 = Mezcla(2, ids=[3, 11], caudalUnitarioMolar=xi, RhoLMix=1)
>>> args = (unidades.Temperature(91, "F"), 101325)
>>> "%0.2f %0.2f" % (c0.RhoL(*args).kgl, c1.RhoL(*args).kgl)
'0.57 0.57'

Example from [3]; 20% ethane, 80% nC10 at 166F and 3000psi

>>> c0 = Mezcla(2, ids=[3, 14], caudalUnitarioMolar=[2, 8], RhoLPMix=0)
>>> c1 = Mezcla(2, ids=[3, 14], caudalUnitarioMolar=[2, 8], RhoLPMix=1)
>>> c2 = Mezcla(2, ids=[3, 14], caudalUnitarioMolar=[2, 8], RhoLPMix=2)
>>> args = (unidades.Temperature(160, "F"), unidades.Pressure(3000, "psi"))
>>> "%0.3f %0.3f" % (c0.RhoL(*args).kgl, c1.RhoL(*args).kgl)
'0.678 0.681'
>>> "%0.3f" % c2.RhoL(*args).kgl
'0.687'

Gas viscosity methods: Example 9-4 from [3]; 28.6% N2, 71.4% R22 at 50ºC

>>> c0 = Mezcla(2, ids=[46, 220], caudalUnitarioMolar=[286, 714], MuGMix=0)
>>> c1 = Mezcla(2, ids=[46, 220], caudalUnitarioMolar=[286, 714], MuGMix=1)
>>> c2 = Mezcla(2, ids=[46, 220], caudalUnitarioMolar=[286, 714], MuGMix=2)
>>> c3 = Mezcla(2, ids=[46, 220], caudalUnitarioMolar=[286, 714], MuGMix=3)
>>> c4 = Mezcla(2, ids=[46, 220], caudalUnitarioMolar=[286, 714], MuGMix=4)
>>> args = (unidades.Temperature(50, "C"), 101325, 0)
>>> "%0.2f %0.2f" % (c0.Mu_Gas(*args).microP, c1.Mu_Gas(*args).microP)
'151.22 160.94'
>>> "%0.2f %0.2f" % (c2.Mu_Gas(*args).microP, c3.Mu_Gas(*args).microP)
'156.18 148.89'
>>> "%0.2f" % c4.Mu_Gas(*args).microP
'148.66'

Example 9-14 in [3], 80% methane, 20% nC10 at 377.6K and 413.7bar

>>> c0 = Mezcla(2, ids=[2, 14], caudalUnitarioMolar=[8, 2], MuGPMix=0)
>>> c1 = Mezcla(2, ids=[2, 14], caudalUnitarioMolar=[8, 2], MuGPMix=1)
>>> c2 = Mezcla(2, ids=[2, 14], caudalUnitarioMolar=[8, 2], MuGPMix=2)
>>> c3 = Mezcla(2, ids=[2, 14], caudalUnitarioMolar=[8, 2], MuGPMix=3)
>>> c4 = Mezcla(2, ids=[2, 14], caudalUnitarioMolar=[8, 2], MuGPMix=4)
>>> args = (377.6, 413.7e5, 448.4)
>>> "%0.2f %0.2f" % (c0.Mu_Gas(*args).muPas, c1.Mu_Gas(*args).muPas)
'55.66 112.22'
>>> "%0.2f %0.2f" % (c2.Mu_Gas(*args).muPas, c3.Mu_Gas(*args).muPas)
'83.37 40.78'
>>> "%0.2f" % c4.Mu_Gas(*args).muPas
'39.91'

Liquid viscosity methods: Example A from [2]; 29.57% nC16, 35.86% benzene, 34.57% nC6 at 77ºF

>>> x = [0.2957, 0.3586, 0.3457]
>>> c0 = Mezcla(2, ids=[20, 40, 10], caudalUnitarioMolar=x, MuLMix=0)
>>> c1 = Mezcla(2, ids=[20, 40, 10], caudalUnitarioMolar=x, MuLMix=1)
>>> args = (unidades.Temperature(77, "F"), 101325)
>>> "%0.2f %0.2f" % (c0.Mu_Liquido(*args).cP, c1.Mu_Liquido(*args).cP)
'0.88 0.76'

Liquid thermal conductivity methods: Example from [2] 68% nC7, 32% CycloC5 at 32F and 1atm >>> x = [0.68, 0.32] >>> c0 = Mezcla(2, ids=[11, 36], caudalUnitarioMolar=x, ThCondLMix=0) >>> c1 = Mezcla(2, ids=[11, 36], caudalUnitarioMolar=x, ThCondLMix=1) >>> args = (unidades.Temperature(32, “F”), 101325, 0) >>> “%0.3f %0.3f” % (c0.ThCond_Liquido(*args), c1.ThCond_Liquido(*args)) ‘0.132 0.132’

Gas thermal conductivity methods: Example 10-5 from [3]; 25% benzene, 75% Argon at 100.6ºC and 1bar

>>> x = [0.25, 0.75]
>>> c0 = Mezcla(2, ids=[40, 98], caudalUnitarioMolar=x, ThCondGMix=0)
>>> c1 = Mezcla(2, ids=[40, 98], caudalUnitarioMolar=x, ThCondGMix=1)
>>> c2 = Mezcla(2, ids=[40, 98], caudalUnitarioMolar=x, ThCondGMix=2)
>>> args = (unidades.Temperature(100.6, "C"), 1e5, 0)
>>> "%0.4f %0.4f" % (c0.ThCond_Gas(*args), c1.ThCond_Gas(*args))
'0.0187 0.0197'
>>> "%0.4f" % c2.ThCond_Gas(*args)
'0.0224'

Example 10-6 from [3]; 75.5% methane, 24.5% CO2 at 370.8K and 174.8bar Here the Chung method is the best option to get the low pressure thermal conductivity of mixture

>>> x = [0.755, 0.245]
>>> kw = {"caudalUnitarioMolar": x, "ThCondGMix": 2}
>>> c0 = Mezcla(2, ids=[2, 49], ThCondGPMix=0, **kw)
>>> c1 = Mezcla(2, ids=[2, 49], ThCondGPMix=1, **kw)
>>> c2 = Mezcla(2, ids=[2, 49], ThCondGPMix=2, **kw)
>>> args = (370.8, 174.8e5, 1/159*22.9*1000)
>>> "%0.4f %0.4f" % (c0.ThCond_Gas(*args), c1.ThCond_Gas(*args))
'0.0526 0.0548'
>>> "%0.4f" % c2.ThCond_Gas(*args)
'0.0580'
METHODS_RhoL = ['Rackett', 'COSTALD']
METHODS_RhoLP = ['Aalto-Keskinen (1996)', 'Tait-COSTALD (1982', 'Nasrifar (2000)', 'API']
METHODS_MuG = ['Reichenberg (1975)', 'Lucas (1984)', 'Chung (1988)', 'Wilke (1950)', 'Herning-Zipperer (1936)']
METHODS_MuGP = ['Lucas (1984)', 'Chung (1988)', 'TRAPP (1996)', 'Dean-Stiel (1965)', 'API']
METHODS_MuL = ['Kendall-Monroe', 'Arrhenius']
METHODS_ThG = ['Mason-Saxena (1958)', 'Lindsay-Bromley (1950)', 'Chung (1988)']
METHODS_ThGP = ['Stiel-Thodos-Yorizane (1983)', 'TRAPP', 'Chung (1988)']
METHODS_ThL = ['Li (1976)', 'Power Law']
__init__(tipo=0, **kwargs)[source]

Class constructor, copy kwargs for child class, it can be customize for child class to add functionality

kwargs = {'MuGMix': None, 'MuGPMix': None, 'MuLMix': None, 'RhoLMix': None, 'RhoLPMix': None, 'ThCondGMix': None, 'ThCondGPMix': None, 'ThCondLMix': None, 'caudalMasico': 0.0, 'caudalMolar': 0.0, 'caudalUnitarioMasico': [], 'caudalUnitarioMolar': [], 'customCmp': [], 'fraccionMasica': [], 'fraccionMolar': [], 'ids': []}
_arraylize(prop, unit=None)[source]

Get the compounds property prop as list prop: a string code with the property to return

f_acent, M, Vc, Tc,…

_Ho(T)[source]

Ideal gas enthalpy, referenced in API procedure 7B4.1, pag 645

\[H_m^o = \sum_i x_wH_i^o\]
Parameters:
Tfloat

Temperature, [K]

References

[2] API; Technical Data book: Petroleum Refining 6th Edition.

_so(T)[source]

Ideal gas entropy, referenced in API procedure 7F2.1, pag 741

\[S_m^o = \sum_i x_wS_i^o - \frac{R}{M} x_i\lnx_i\]
Parameters:
Tfloat

Temperature, [K]

References

[2] API; Technical Data book: Petroleum Refining 6th Edition.

Cp_Gas(T, P)[source]

Calculate specific heat from gas, API procedure 7D4.1, pag 714

Cp_Liquido(T)[source]

Calculate specific heat from liquid, API procedure 7D1.9, pag 714

RhoL(T, P)[source]

Calculate the density of liquid phase using any of available correlation

Mu_Gas(T, P, rho)[source]

General method for calculate viscosity of gas

Mu_Liquido(T, P)[source]

General method for calculate viscosity of Liquid

Tension(T)[source]

General method for calculate surface tension

ThCond_Liquido(T, P, rho)[source]

General method for calculate thermal conductivity of liquid

ThCond_Gas(T, P, rho)[source]

General method for calculate thermal conductivity of gas

writeStatetoJSON(state)[source]

Write entity state to JSON file

readStatefromJSON(mezcla)[source]

Read entity state from JSON file

recallZeros(lista, val=0)[source]

Method to return any list with null component added

References