lib.petro module

Petroleum fractions hypotethical pseudocomponent definition

Petroleo: The main class with all integrated functionality

Correlation for calculation of properties:

Correlations for Zc calculations:
Distillation curves interconversiono methods:
Advanced petroleum fraction properties:
PNA decomposition procedures:
lib.petro.translate(context: str, sourceText: str, disambiguation: str = None, n: int = -1) str
lib.petro._unit(key, val, unit=None)[source]

Set appropiate unit for value

Parameters:
keystring

Property name

valfloat

Property value to unitize

unitstring, optional

In case it necessary use a alternate unit

Returns:
xunidades.unidad

A instance of appropiate unidades.unidad subclass

Notes

Default use the petroleum english standards units, R, psi, ft³/lb…

lib.petro.prop_Ahmed(Nc)[source]
Calculate petroleum fractions properties with the carbon atom number as

the only known property

Parameters:
Ncfloat

Carbon atom number [-]

Returns:
propdict

A dict with the calculated properties:

  • M: Molecular weight, [-]

  • Tc: Critic temperature, [ºR]

  • Pc: Critic pressure, [psi]

  • Tb: Normal boiling temperature, [ºR]

  • w: Acentric factor, [-]

  • SG: Specific gravity, [-]

  • Vc: Critic volume, [ft³/lb]

References

[1] Katz, D.L., Firoozabadi, A.; Predicting Phase Behavior of Condensate/Crude-oil SystemsUsing Methane Interaction Coefficients. Journal of Petroleum Technology 30(11) (1978) 1649-1655

[2] Ahmed, T., Cady, G., Story, A.; A Generalized Correlation for Characterizing theHydrocarbon Heavy Fractions.. Paper SPE 14266, presented at the 60th Annual TechnicalConference of the Society of Petroleum Engineers, Las Vegas,September 22–25, 1985.

Examples

>>> "%0.0f" % prop_Ahmed(6)["Tb"].R
'604'
>>> "%0.5f" % prop_Ahmed(45)["Vc"].ft3lb
'0.06549'
lib.petro.prop_Riazi_Daubert_1980(Tb, SG)[source]
Calculate petroleum fractions properties with the Riazi (1980)

correlation with the boiling temperature and specific gravity as input paramters

Parameters:
Tbfloat

Normal boiling temperature, [K]

SG: float

Specific gravity, [-]

Returns:
propdict

A dict with the calculated properties:

  • M: Molecular weight, [-]

  • Tc: Critic temperature, [ºR]

  • Pc: Critic pressure, [psi]

  • Vc: Critic volume, [ft3/lb]

References

[4] Riazi, M.R., Daubert, T.E.; Simplify Property Predictions. Hydrocarbon Processing (March 1980): 115–116

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

Examples

Example 2.2 from [9]: C7+ fraction with Tb=198ºF and SG=0.7365

>>> T = unidades.Temperature(198, "F")
>>> p = prop_Riazi_Daubert_1980(T, 0.7365)
>>> "%.0f %.0f %.0f %.4f" % (p["M"], p["Tc"].R, p["Pc"].psi, p["Vc"].ft3lb)
'96 990 467 0.0623'
lib.petro.prop_Riazi_Daubert(tita1, val1, tita2, val2)[source]

Calculate petroleum fractions properties known two properties

Parameters:
tita1string

Name of first known property

tita2string

Name of second known property

val1: float

First known property value

val2: float

Second known property value

Returns:
propdict

A dict with the calculated properties:

  • Tc: Temperatura crítica, [ºR]

  • Pc: Presión crítica, [psi]

  • Vc: Volumen crítico, [ft³/lb]

  • M: Peso molecular, [-]

  • Tb: Temperatura fusión, [ºR]

  • SG: Gravedad específica, [-]

  • I: Huang characterization factor, [-]

  • CH: Carbon/hydrogen weight ratio, [-]

Notes

The available input properties for tita are:

  • Tb: Temperatura fusión, [ºR]

  • SG: Gravedad específica, [-]

  • M: Peso molecular, [-]

  • CH: Carbon/hydrogen weight ratio, [-]

  • I: Huang characterization factor, [-]

  • v1: Kinematic viscosity at 100ºF, [m²/s]

Raise NotImplementedError if input pair are unsupported or input isn’t in limit:

  • 80ºF ≤ T ≤ 650ºF

  • 70 ≤ M ≤ 300

References

[3] Riazi, M.R., Daubert, T.E.; Characterization Parameters for Petroleum Fractions. Ind. Eng. Chem. Res. 26(4) (1987) 755-759

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

Examples

Example 2.1 from [9]: C7+ fraction with M=150 and SG=0.78

>>> p = prop_Riazi_Daubert("M", 150, "SG", 0.78)
>>> "%i %i %.4f %.0f" % (p["Tc"].R, p["Pc"].psi, p["Vc"].ft3lb, p["Tb"].R)
'1160 320 0.0636 825'

Example 2.2 from [9]: Petroleum fraction with Tb=198ºF and SG=0.7365

>>> T = unidades.Temperature(198, "F")
>>> p = prop_Riazi_Daubert("Tb", T, "SG", 0.7365)
>>> "%.0f %.0f %.0f %.4f" % (p["M"], p["Tc"].R, p["Pc"].psi, p["Vc"].ft3lb)
'97 986 466 0.0626'
>>> "%.3f" % prop_Edmister(Tc=p["Tc"], Pc=p["Pc"], Tb=p["Tb"])["w"]
'0.287'
lib.petro.prop_Cavett(Tb, API)[source]
Calculate petroleum fractions properties with the Cavett (1980)

correlation. Use API as a alternate input parameter to specific gravity

Parameters:
Tbfloat

Normal boiling temperature, [K]

APIfloat

API gravity, [-]

Returns:
propdict

A dict with the calculated properties:

  • Tc: Critic temperature, [ªR]

  • Pc: Critic pressure, [Pa]

References

[7] Cavett, R.H.; Physical data for distillation calculations, vapor-liquidequilibrium.. Proceedings of the 27th Meeting, API, San Francisco, Issue 3,351-366.

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

Examples

Example 2.2 from [9]: Petroleum fraction with Tb=198ºF and SG=0.7365

>>> T = unidades.Temperature(198, "F")
>>> API = 141.5/0.7365-131.5
>>> p = prop_Cavett(T, API)
>>> "%.1f %.0f" % (p["Tc"].R, p["Pc"].psi)
'978.1 466'
lib.petro.prop_Lee_Kesler(Tb, SG)[source]
Calculate petroleum fractions properties with the Lee-Kesker (1976)

correlation. Use API as a alternate input parameter to specific gravity

Parameters:
Tbfloat

Normal boiling temperature, [K]

SG: float

Specific gravity, [-]

Returns:
propdict

A dict with the calculated properties:

  • Tc: Critic temperature, [ªR]

  • Pc: Critic pressure, [Pa]

  • M: Molecular weight, [-]

  • w: Acentric factor, [-]

References

[8] Kesler, M.G., Lee, B.I.; Improve Prediction of Enthalpy of Fractions. Hydrocarbon Processing 55(3) (1976) 153-158

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

Examples

Example 2.2 from [9]: Petroleum fraction with Tb=198ºF and SG=0.7365

>>> T = unidades.Temperature(198, "F")
>>> p = prop_Lee_Kesler(T, 0.7365)
>>> "%.0f %.0f %.1f %.3f" % (p["Tc"].R, p["Pc"].psi, p["M"], p["w"])
'981 470 98.6 0.306'
lib.petro.prop_Sim_Daubert(Tb, SG)[source]
Calculate petroleum fractions properties with the Sim-Daubert (1980)

computerized version of Winn (1957) graphical correlations

Parameters:
Tbfloat

Normal boiling temperature, [K]

SG: float

Specific gravity, [-]

Returns:
propdict

A dict with the calculated properties:

  • M: Molecular weight, [-]

  • Tc: Critic temperature, [ªR]

  • Pc: Critic pressure, [Pa]

References

[6] Sim, W.J., Daubert, T.E.; Prediction of Vapor-Liquid Equilibria of UndefinedMixtures. Ind. Eng. Chem. Process Des. Dev. 19(3) (1980) 386-393

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

Examples

Example 2.2 from [9]: Petroleum fraction with Tb=198ºF and SG=0.7365

>>> T = unidades.Temperature(198, "F")
>>> p = prop_Sim_Daubert(T, 0.7365)
>>> "%.0f %.0f %.0f" % (p["Tc"].R, p["Pc"].psi, p["M"])
'979 479 96'
lib.petro.prop_Watansiri_Owens_Starling(Tb, SG, M)[source]
Calculate petroleum fractions properties with the Watansiri-Owens-

Starling (1985) correlation using boiling temperature and molecular weight as input parameters

Parameters:
Tbfloat

Normal boiling temperature, [K]

SG: float

Specific gravity, [-]

M: float

Molecular weight, [-]

Returns:
propdict

A dict with the calculated properties:

  • Tc: Critic temperature, [K]

  • Pc: Critic pressure, [atm]

  • Vc: Critic volume, [cm3/gr]

  • w: Acentric factor, [-]

  • Dm: Dipole moment, [Debye]

References

[10] Watansiri, S., Owens, V.H., Starling, K.E.; Correlations for estimating critical constants, acentricfactor, and dipole moment for undefined coal-fluidfractions. Ind. Eng. Chem. Process. Des. Dev. 24(2) (1985) 294-296

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

Examples

Example 2.2 from [9]: Petroleum fraction with Tb=198ºF and SG=0.7365

>>> T = unidades.Temperature(198, "F")
>>> p = prop_Watansiri_Owens_Starling(T, 0.7365, 96)
>>> "%.0f %.5f" % (p["Tc"].R, p["Vc"].ft3lb)
'980 0.06548'
lib.petro.prop_Rowe(M)[source]
Calculate petroleum fractions properties with the Rowe

correlations (1978) using only the molecular weight as input parameter

Parameters:
M: float

Molecular weight, [-]

Returns:
propdict

A dict with the calculated properties:

  • Tc: Critic temperature, [R]

  • Tb: Boiling temperature, [R]

  • Pc: Critic pressure, [psi]

Notes

Critical pressure examples in [9] don’t get result, the equations isn’t equal in both references

References

[11] Rowe, A.M.; Internally Consistent Correlations for Predicting PhaseCompositions for Use in Reservoir Compositional Simulators. Paper SPE 7475, In: Presented at the 53rd Annual Society ofPetroleum Engineers Fall Technical Conference and Exhibition,1978.

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

Examples

Example 2.3 from [9]: Petroleum fraction with M=216 and SG=0.8605

>>> p = prop_Rowe(216)
>>> "%.1f" % p["Tc"].R
'1279.8'
lib.petro.prop_Standing(M, SG)[source]
Calculate petroleum fractions properties with the Standing (1977)

correlations based in the graphical plot of Mathews et al. (1942) using molecular weight and specific gravity as input parameter

Parameters:
M: float

Molecular weight, [-]

SG: float

Specific gravity, [-]

Returns:
propdict

A dict with the calculated properties:

  • Tc: Critic temperature, [K]

  • Pc: Critic pressure, [atm]

References

[12] Standing, M.B.; Volumetric and Phase Behavior of Oil Field HydrocarbonSystems.. Society of Petroleum Engineers, Dallas, TX. 1977

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

Examples

Example 2.3 from [9]: Petroleum fraction with M=216 and SG=0.8605

>>> p = prop_Standing(216, 0.8605)
>>> "%.1f %.0f" % (p["Tc"].R, p["Pc"].psi)
'1269.3 270'
lib.petro.prop_Willman_Teja(Tb)[source]
Calculate petroleum fractions properties with the Willman-Teja (1987)

correlations using only the boiling temperature as input parameter

Parameters:
Tb: float

Boiling temperature, [K]

Returns:
propdict

A dict with the calculated properties:

  • Tc: Critic temperature, [K]

  • Pc: Critic pressure, [MPa]

  • n: Carbon number, [-]

References

[13] Willman, B., Teja, A.; Prediction of dew points of semicontinuous natural gas andpetroleum mixtures. 1. Characterization by use of aneffective carbon number and ideal solution predictions. Ind. Eng. Chem. Res. 26(5) (1987) 948-952

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

Examples

Example 2.2 from [9]: Petroleum fraction with Tb=198ºF and SG=0.7365

>>> Tb = unidades.Temperature(198, "F")
>>> p = prop_Willman_Teja(Tb)
>>> "%.0f %.0f" % (p["Tc"].R, p["Pc"].psi)
'977 442'
lib.petro.prop_Magoulas_Tassios(M, SG)[source]
Calculate petroleum fractions properties with the Magoulas-Tassios(1990)

correlations using molecular weight and specific gravity as input parameter

Parameters:
M: float

Molecular weight, [-]

SG: float

Specific gravity, [-]

Returns:
propdict

A dict with the calculated properties:

  • Tc: Critic temperature, [K]

  • Pc: Critic pressure, [MPa]

  • w: Acentric factor, [-]

References

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

[14] Magoulas, S., Tassios, D.; Predictions of phase behavior of HT-HP reservoir fluids.. Paper SPE 37294, Society of Petroleum Engineers, Richardson,TX, 1990.

Examples

Example 2.3 from [9]: Petroleum fraction with M=216 and SG=0.8605

>>> p = prop_Magoulas_Tassios(216, 0.8605)
>>> "%.0f %.0f" % (p["Tc"].R, p["Pc"].psi)
'1317 273'
lib.petro.prop_Tsonopoulos(SG, Tb)[source]
Calculate petroleum fractions properties with the Tsonopoulos (1990)

correlations using molecular weight and specific gravity as input parameter

Parameters:
SG: float

Specific gravity, [-]

Tb: float

Boiling temperature, [K]

Returns:
propdict

A dict with the calculated properties:

  • Tc: Critic temperature, [K]

  • Pc: Critic pressure, [MPa]

References

[45] Tsonopoulos, C., Heidman, J.L., Hwang, S.C.; Thermodynamic and Transport Properties of Coal Liquids. An Exxon Monograph, Wiley, New York, 1986

lib.petro.prop_Twu(Tb, SG)[source]
Calculate petroleum fractions properties with the Two (1983)

correlation with the boiling temperature and specific gravity as input paramters

Parameters:
Tbfloat

Normal boiling temperature, [K]

SG: float

Specific gravity, [-]

Returns:
propdict

A dict with the calculated properties:

  • M: Molecular weight, [-]

  • Tc: Critic temperature, [ºR]

  • Pc: Critic pressure, [psi]

  • Vc: Critic volume, [ft3/lb]

References

[5] Twu, C.H.; An Internally Consistent Correlation for Predicting theCritical Properties and Molecular Weights of Petroleum andCoal-tar Liquids. Fluid Phase Equilbria 16 (1984) 137-150

Examples

>>> crit = prop_Twu(510, 1.097)
>>> "%.1f %.1f %.1f" % (crit["Tc"].R, crit["Pc"].psi, crit["M"])
'1380.3 556.8 130.4'
lib.petro.prop_Sancet(M)[source]
Calculate petroleum fractions properties with the Sancet (2007)

correlations using only the molecular weight as input parameter

Parameters:
M: float

Molecular weight, [-]

Returns:
propdict

A dict with the calculated properties:

  • Tc: Critic temperature, [ºR]

  • Pc: Critic pressure, [psi]

  • Tb: Boiling temperature, [ºR]

References

[5] Twu, C.H.; An Internally Consistent Correlation for Predicting theCritical Properties and Molecular Weights of Petroleum andCoal-tar Liquids. Fluid Phase Equilbria 16 (1984) 137-150

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

Examples

Example 2.1 from [9]: C7+ fraction with M=150 and SG=0.78

>>> p = prop_Sancet(150)
>>> "%.0f %.0f %.0f" % (p["Tc"].R, p["Pc"].psi, p["Tb"].R)
'1133 297 828'
lib.petro.prop_Silva_Rodriguez(M)[source]
Calculate petroleum fractions properties with the Silva-Rodriguez
  1. correlations

Parameters:
M: float

Molecular weight, [-]

Returns:
propdict

A dict with the calculated properties:

  • Tb: Boiling temperature, [K]

  • SG: Specific gravity, [-]

References

[16] Silva, M.B., Rodriguez, F.; Automatic fitting of equations of state for phase behaviormatching.. Paper SPE 23703, Society of Petroleum Engineers, Richardson,TX, 1992.

[9] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

Examples

Example 2.1 from [9]: C7+ fraction with M=150 and SG=0.78

>>> p = prop_Silva_Rodriguez(150)
>>> "%.0f %.4f" % (p["Tb"].R, p["SG"])
'839 0.7982'
lib.petro.Tb_Soreide(M, SG)[source]
Calculate petroleum fractions boiling temperature with the Soreide
  1. correlations

Parameters:
M: float

Molecular weight, [-]

SG: float

Specific gravity, [-]

Returns:
Tbfloat

Boiling temperature, [K]

References

[17] Soreide, I.; Improved Phase Behavior Predictions of Petroleum ReservoirFluids From a Cubic Equation of State.. Doctor of engineering dissertation. Norwegian Institute ofTechnology, Trondheim, 1989.

lib.petro.vc_Hall_Yarborough(M, SG)[source]
Calculate petroleum fractions critic volume with the Hall-Yarborough
  1. correlation

Parameters:
M: float

Molecular weight, [-]

SG: float

Specific gravity, [-]

Returns:
vcfloat

Boiling temperature, [K]

References

[18] Hall, K.R., Yarborough, L.; New Simple Correlation for Predicting Critical Volume. Chemical Engineering (November 1971): 76

lib.petro.M_Goossens(Tb, d20)[source]
Calculate petroleum fractions molecular weight with the Goossens
  1. correlation

Parameters:
Tbfloat

Normal boiling temperature, [K]

d20float

Liquid density at 20ºC and 1 atm, [g/cm³]

Returns:
M: float

Molecular weight, [-]

References

[43] Goossens, A.G.; Prediction of Molecular Weight of Petroleum Fractions. Ind. Eng. Chem. Res. 35(3) (1996) 985-988

Examples

>>> "%.1f" % M_Goossens(306, 0.6258)["M"]
'77.0'
lib.petro.w_Korsten(Tb, Tc, Pc)[source]
Calculate petroleum fractions acentric factor with the Korsten (2000)

correlation

Parameters:
Tbfloat

Normal boiling temperature, [K]

Tcfloat

Critical temperature, [K]

Pcfloat

Critical pressure, [Pa]

Returns:
w: float

Acentric factor, [-]

References

[44] Korsten, H.; Internally Consistent Prediction of Vapor Pressure and Related Properties. Ind. Eng. Chem. Res. 39(3) (2000) 813-820

lib.petro.prop_Riazi(SG, tita, val)[source]
Calculate petroleum fractions properties using the Riazi correlation.

This correlation is recommendated for heavy weight fractions C20-C50.

Parameters:
SG: float

Specific gravity, [-]

titastring

Name of second known property

val float

known property value

Returns:
propdict

A dict with the calculated properties:

  • Tc: Critic temperature, [ºR]

  • Pc: Critic pressure, [psi]

  • Vc: Critic volume, [ft³/lb]

  • Tb: Boiling temperatura, [ºR]

  • d20: Liquid density at 20ºC, [g/cm³]

  • I: Huang Characterization factor, [-]

Notes

The available input properties for tita are:

  • Tb: Boiling temperature, [ºR]

  • M: Molecular weight, [-]

The critic volume is calculate in mole base, so be careful to correct with molecular weight

References

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

lib.petro.prop_Riazi_Alsahhaf(Tb, M, d20)[source]
Calculate petroleum fractions properties with the Riazi-AlSahhaf (1998)

correlation with the boiling temperature and liquid density at 20ºC as input paramters.

Parameters:
Tbfloat

Normal boiling temperature, [K]

Mfloat

Molecular Weight, [g/mol]

d20float

Liquid density at 20ºC and 1 atm, [g/cm³]

Returns:
propdict

A dict with the calculated properties:

  • Tc: Critic temperature, [K]

  • Pc: Critic pressure, [MPa]

  • Vc: Critic volume, [cm³/g]

Notes

This correlation generalized the Riazi-Daubert method to non-polar compounds and gases.

References

[26] Riazi, M.R., Al-Sahhaf, T.A., Sl-Shammari M.A.; A Generalized Method for Estimation of Critical Constants. Fluid Phase Equilibria 147 (1998) 1-6

lib.petro.prop_Riazi_Alsahhaf_PNA(M, cmp)[source]
Calculate petroleum fractions properties with the Riazi-AlSahhaf PNA

correlation with the molecular weight as input parameter. The procedure calculate the phisical properties for paraphins, naphthenes and aromatics constituents of fraction.

Parameters:
Mfloat

Molecular weight, [-]

cmpstring

Hydrocarbon type, P (paraffins), N (naphthenes) or A (aromatics)

Returns:
propdict

A dict with the calculated properties:

  • Tf: Freezing temperature, [K]

  • Tb: Boiling temperature, [K]

  • SG: Specific gravity, [-]

  • d20: Density at 20ºC, [g/cm³]

  • Tc: Critic temperature, [K]

  • Pc: Critic pressure, [bar]

  • Vc: Critic volume, [cm³/g]

  • w: Acentric factor, [-]

  • I: Refractive index parameter, [-]

  • sigma: Surface tension, [dyn/cm]

References

[27] Riazi, M.R., A1-Sahhaf, T.A.; Physical Properties of Heavy Petroleum Fractions and CrudeOils. Fluid Phase Equilibria 117 (1996) 217-224.

[28] Riazi, M.R., A1-Sahhaf, T.; Physical Properties of n-Alkanes and n-Alkyl Hydrocarbons: Application to Petroleum Mixtures. Ind. Eng. Chem. Res. 34(11) (1995) 4145-4148

lib.petro.Zc_Hougen(w)[source]
Calculate the critical compressibility factdor Zc using the Hougen

correlation (1959)

Parameters:
wfloat

Acentric factor, [-]

Returns:
Zcfloat

Critical compressibility factor, [-]

References

[22] Hougen, O.A., Watson, K.M., Ragatz, R.A.; Chemical Process Principles, 2nd ed.. New York: Wiley, 1959, p. 577.

lib.petro.Zc_Reid(w)[source]
Calculate the critical compressibility factdor Zc using the Reid

Prausnith and Sherwood (1977) correlation

Parameters:
wfloat

Acentric factor, [-]

Returns:
Zcfloat

Critical compressibility factor, [-]

References

[23] Reid, R., Prausnitz, J.M., Sherwood, T.; The Properties of Gases and Liquids, 3rd ed. New York:McGraw-Hill, 1977, p. 21..

lib.petro.Zc_Salerno(w)[source]
Calculate the critical compressibility factdor Zc using the Salerno

correlation (1985)

Parameters:
wfloat

Acentric factor, [-]

Returns:
Zcfloat

Critical compressibility factor, [-]

References

[21] Salerno, S, Cascella, M., May, D., Watson, P., Tassios, D.; Prediction of Vapor Pressures and Saturated Volumes with aSimple Cubic Equation of State: Part I. A Reliable DataBase. Fluid Phase Equilibria 27 (1986) 15-34

lib.petro.Zc_Nath(w)[source]
Calculate the critical compressibility factdor Zc using the Nath

correlation (1985)

Parameters:
wfloat

Acentric factor, [-]

Returns:
Zcfloat

Critical compressibility factor, [-]

References

[24] Nath, J.; Acentric Factor and the Critical Volumes for Normal Fluids. Ind. Eng. Chem. Fundam. 21(3) (1985) 325-326

lib.petro.Zc_Lee_Kesler(w)[source]
Calculate the critical compressibility factdor Zc using the Lee-Kesler

correlation (1975)

Parameters:
wfloat

Acentric factor, [-]

Returns:
Zcfloat

Critical compressibility factor, [-]

References

[25] Lee, B.I., Kesler, M.G.; A Generalized Thermodynamic Correlation Based on Three-Parameter Corresponding States. AIChE Journal 21(3) (1975) 510-527

lib.petro.D86_TBP_Riazi(Ti, Xi=None, reverse=False)[source]
Interconversion between D86 and TBP at atmospheric pressure using the

Riazi correlation

Parameters:
Tilist

Distillation data with the D86 distillation temperature

Xilist

Volumetric cut point range

reverseboolean

To do the reverse conversion

Returns:
TBPlist

Calculated distillation data

References

[19] Riazi, M.R., Daubert, T.E.; Analytical Correlations Interconvert Distillation Curve Types. Oil & Gas Journal 84 (1986) 50-57

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

Examples

Example 3.2 from [29]

>>> X = [0, 0.1, 0.3, 0.5, 0.7, 0.9]
>>> TBP = [10, 71.1, 143.3, 204.4, 250.6, 291.7]
>>> TBP_K = [t+273.15 for t in TBP]
>>> D86 = D86_TBP_Riazi(TBP_K, X, reverse=True)
>>> D86_C = [t-273.15 for t in D86]
>>> "%.0f" % D86_C[0]
'32'

Example 3.3 from [29]

>>> X = [0, 0.1, 0.3, 0.5, 0.7, 0.9]
>>> D86 = [165.6, 173.7, 193.3, 206.7, 222.8, 242.8]
>>> D86_K = [t+273.15 for t in D86]
>>> TDB = D86_TBP_Riazi(D86_K, X)
>>> TDB_C = [t-273.15 for t in TDB]
>>> "%.1f %.1f %.1f %.1f %.1f %.1f" % tuple(TDB_C)
'134.2 157.4 190.3 209.0 230.2 254.7'
lib.petro.D86_TBP_Daubert(Ti, Xi=None, T50=None, reverse=False)[source]
Interconversion between D86 and TBP at atmospheric pressure using the

Daubert correlation, API procedure 3A1.1

Parameters:
Tilist

Distillation data with the T0, T10, T30, T50, T70, T90, T95

Xilist

Volumetric cut point range

T50float

D86 distillation at 50% point temperature

reverseboolean

To do the reverse conversion

Returns:
TBPlist

Calculated distillation data

References

[32] Daubert, T.E.; Petroleum Fraction Distillation Interconversion. Hydrocarbon Processing 73(9) (1994) 75-78

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

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

Examples

Example from [20]

>>> X = [0.1, 0.3, 0.5, 0.7, 0.9]
>>> D86 = [350, 380, 404, 433, 469]
>>> D86_K = [unidades.F2K(t) for t in D86]
>>> TDB = D86_TBP_Daubert(D86_K, X, D86_K[2])
>>> TDB_F = [t.F for t in TDB]
>>> "%.1f %.1f %.1f %.1f %.1f" % tuple(TDB_F)
'316.5 372.6 411.2 451.2 496.7'

Inverse case

>>> X = [0.1, 0.3, 0.5, 0.7, 0.9]
>>> TDB = [321, 371, 409, 447, 469]
>>> TDB_K = [unidades.F2K(t) for t in TDB]
>>> D86 = D86_TBP_Daubert(TDB_K, X, TDB_K[2], reverse=True)
>>> D86_F = [t.F for t in D86]
>>> "%.1f %.1f" % (D86_F[1], D86_F[2])
'378.4 401.9'

Example 3.3 from [29]

>>> X = [0, 0.1, 0.3, 0.5, 0.7, 0.9]
>>> D86 = [165.6, 173.7, 193.3, 206.7, 222.8, 242.8]
>>> D86_K = [t+273.15 for t in D86]
>>> TDB = D86_TBP_Daubert(D86_K, X)
>>> TDB_C = [t-273.15 for t in TDB]
>>> "%.1f %.1f %.1f %.1f %.1f %.1f" % tuple(TDB_C)
'133.5 154.2 189.2 210.7 232.9 258.2'
lib.petro.SD_D86_Riazi(Ti, Xi=None, F=None)[source]

Interconversion between SD and D86

Parameters:
Tilist

Distillation data with the D86 distillation temperature

Xilist

Volumetric cut point range

Ffloat

Parameter, :math: $F = 0.01411*SD_{10%}^0.05434*SD_{50%}^0.6147

Returns:
D86list

Calculated distillation data

References

[19] Riazi, M.R., Daubert, T.E.; Analytical Correlations Interconvert Distillation Curve Types. Oil & Gas Journal 84 (1986) 50-57

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

Examples

Example 3.5 from [29]

>>> X = [0.1, 0.3, 0.5, 0.7, 0.9]
>>> SD = [33.9, 64.4, 101.7, 140.6, 182.2]
>>> SD_K = [t+273.15 for t in SD]
>>> F = 0.01411*SD_K[0]**0.05434*SD_K[2]**0.6147
>>> D86 = SD_D86_Riazi(SD_K, X, F)
>>> D86_C = [t-273.15 for t in D86]
>>> "%.1f %.1f %.1f %.1f %.1f" % tuple(D86_C)
'53.2 70.9 96.0 131.3 168.3'
lib.petro.SD_D86_Daubert(Ti, Xi=None, SD50=None)[source]
Interconversion between gas chromatography (ASTM D2887) and ASTM D86 at

atmospheric pressure using the Daubert correlation, API procedure 3A3.2

Parameters:
Tilist

Distillation data with the T0, T10, T30, T50, T70, T90, T95

Xilist

Volumetric cut point range

SD50float

SD86 distillation at 50% point temperature

Returns:
TBPlist

Calculated distillation data

References

[32] Daubert, T.E.; Petroleum Fraction Distillation Interconversion. Hydrocarbon Processing 73(9) (1994) 75-78

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

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

Examples

Example from [20]

>>> X = [0, 0.1, 0.3, 0.5, 0.7, 0.9, 1]
>>> SD = [77, 93, 148, 215, 285, 360, 408]
>>> SD_K = [unidades.F2K(t) for t in SD]
>>> D86 = SD_D86_Daubert(SD_K, X)
>>> D86_F = [t.F for t in D86]
>>> "%.1f %.1f %.1f %.1f %.1f %.1f %.1f" % tuple(D86_F)
'121.3 128.2 154.8 206.3 270.6 334.0 367.5'

Example 3.5 from [29]

>>> X = [0.1, 0.3, 0.5, 0.7, 0.9]
>>> SD = [33.9, 64.4, 101.7, 140.6, 182.2]
>>> SD_K = [t+273.15 for t in SD]
>>> D86 = SD_D86_Daubert(SD_K, X, SD_K[2])
>>> D86_C = [t-273.15 for t in D86]
>>> "%.1f %.1f %.1f %.1f %.1f" % tuple(D86_C)
'53.5 68.2 96.9 132.6 167.8'
lib.petro.D86_EFV(Ti, Xi=None, SG=None, reverse=False)[source]

Interconversion between D86 and EFV

Parameters:
Tilist

Distillation data with the D86 distillation temperature

Xilist

Volumetric cut point range

SGfloat

Specific gravity, [-]

reverseboolean

To do the reverse conversion

Returns:
EFVlist

Calculated distillation data

References

[19] Riazi, M.R., Daubert, T.E.; Analytical Correlations Interconvert Distillation Curve Types. Oil & Gas Journal 84 (1986) 50-57

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

Examples

Example 3.2 from [29]

>>> X = [0, 0.1, 0.3, 0.5, 0.7, 0.9]
>>> TBP = [10, 71.1, 143.3, 204.4, 250.6, 291.7]
>>> TBP_K = [t+273.15 for t in TBP]
>>> D86 = D86_TBP_Riazi(TBP_K, X, reverse=True)
>>> EFV = D86_EFV(D86, X, SG=0.7862)
>>> EFV_C = [t-273.15 for t in EFV]
>>> "%.0f" % EFV_C[0]
'68'
lib.petro.SD_TBP(Ti, Xi=None, SD50=None)[source]
Interconversion between gas chromatography (ASTM D2887) and TBP at

atmospheric pressure using the Daubert correlation, API procedure 3A3.1

Parameters:
Tilist

Distillation data with the T0, T10, T30, T50, T70, T90, T95

Xilist

Volumetric cut point range

SD50float

SD86 distillation at 50% point temperature

Returns:
TBPlist

Calculated distillation data

References

[32] Daubert, T.E.; Petroleum Fraction Distillation Interconversion. Hydrocarbon Processing 73(9) (1994) 75-78

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

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

Examples

Example from [20]

>>> X = [0.05, 0.1, 0.3, 0.5, 0.7, 0.9, 0.95]
>>> SD = [293, 305, 324, 336, 344, 359, 369]
>>> SD_K = [unidades.F2K(t) for t in SD]
>>> TDB = SD_TBP(SD_K, X)
>>> TDB_F = [t.F for t in TDB]
>>> "%.1f %.1f %.1f %.1f %.1f %.1f %.1f" % tuple(TDB_F)
'322.2 327.7 332.4 336.0 339.6 350.1 357.4'

Example 3.4 from [29]

>>> X = [0.1, 0.3, 0.5, 0.7, 0.9]
>>> SD = [151.7, 162.2, 168.9, 173.3, 181.7]
>>> SD_K = [t+273.15 for t in SD]
>>> TDB = SD_TBP(SD_K, X, SD_K[2])
>>> TDB_C = [t-273.15 for t in TDB]
>>> "%.1f %.1f %.1f %.1f %.1f" % tuple(TDB_C)
'164.3 166.9 168.9 170.9 176.8'
lib.petro.D1160_TBP_10mmHg(Ti, Xi=None)[source]

Interconversion between ASTM D1160 and TBP distillation curve at 10 mmHg

Parameters:
Tilist

Distillation data with the T0, T10, T30, T50, T70, T90, T95

Xilist

Volumetric cut point range

Returns:
TBPlist

Calculated distillation data

References

[33] Edmister, W.C., Okamoto, K.K.; Applied Hydrocarbon Thermodynamics, Part 13: Equilibrium Flash Vaporization Correlations for Heavy Oils Under Subatmospheric Pressures. Petroleum Refiner 38(9) (1959) 271-288

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

Examples

Example 3.6 from [29]

>>> X = [0.1, 0.3, 0.5, 0.7, 0.9]
>>> D1160 = [150, 205, 250, 290, 350]
>>> D1160_K = [t+273.15 for t in D1160]
>>> TDB = D1160_TBP_10mmHg(D1160_K, X)
>>> TDB_C = [t-273.15 for t in TDB]
>>> "%.1f %.1f %.0f %.0f %.0f" % tuple(TDB_C)
'146.6 200.9 250 290 350'
lib.petro.Tb_Pressure(T, P, Kw=None, reverse=False)[source]
Conversion of boiling point at Sub or super atmospheric pressure to the

normal boiling point, API Procedure 5A1.19

Parameters:
Tfloat

Temperature, [K]

Pfloat

Pressure, [Pa]

Kw: float

Watson characterization factor, [-]

reverseboolean

Do the inverse calculation from normal boiling point to other pressure

Returns:
TBPlist

Calculated distillation data

References

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

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

Examples

Example from [20]

>>> T = unidades.Temperature(365, "F")
>>> P = unidades.Pressure(10, "mmHg")
>>> TDB = Tb_Pressure(T, P, 12.5)
>>> "%.0f" % TDB
'602'
lib.petro.curve_Predicted(x, T)[source]

Fill the missing point of a distillation curve

Parameters:
xlist

Array with mole/volume/weight fraction, [-]

Tlist

Array with boiling point temperatures, [K]

Returns:
TBPlist

Calculated distillation data

References

[34] Riazi, M.R.; Distribution Model for Properties of Hydrocarbon-Plus Fractions. Ind. Eng. Chem. Res. 28(11) (1989) 1731-1735.

Examples

Example 4.7 from [54]_

>>> xw = [0.261, 0.254, 0.183, 0.14, 0.01, 0.046, 0.042, 0.024, 0.015,         0.009, 0.007]
>>> x = [sum(xw[:i+1]) for i, xi in enumerate(xw)]
>>> T = [365, 390, 416, 440, 461, 482, 500, 520, 539, 556, 573]
>>> parameter, r = curve_Predicted(x, T)
>>> "%.0f %.4f %.4f" % tuple(parameter)
'327 0.2028 1.3802'
lib.petro._Tb_Predicted(par, x)[source]

Calculate a specific point in the distillation curve

lib.petro.PourPoint(SG, Tb, v100=None)[source]
Calculate the pour point of petroleum fractions using the procedure

2B8 from API technical databook, pag. 235 The pour point is the lowest temperature at which it will flow or can be poured.

Parameters:
SGfloat

Specific gravity, [-]

Tbfloat

Mean average boiling point, [K]

v100float

Kinematic viscosity at 100ºF, [cSt]

Returns:
PPfloat

Pour point, [ºR]

Notes

Raise NotImplementedError if input isn’t in limit:

  • 0.8 ≤ SG ≤ 1

  • 800ºR ≤ Tb ≤ 1500ºR

  • 2cSt ≤ v100 ≤ 960cSt

References

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

Examples

>>> T = unidades.Temperature(972, "R")
>>> v = unidades.Diffusivity(3, "cSt")
>>> "%0.0f" % PourPoint(0.839, T, v).R
'458'
lib.petro.AnilinePoint(SG, Tb)[source]
Calculate the aniline point of petroleum fractions using the procedure

2B9 from API technical databook, pag. 237 The aniline point is the lowest temperature at which a petroleum fraction is completely miscible with an equal volume of distilled aniline.

Parameters:
SGfloat

Specific gravity, [-]

Tbfloat

Mean average boiling point, [ºR]

Returns:
APfloat

Aniline point, [ªR]

Notes

Raise NotImplementedError if input isn’t in limit:

  • 0.7 ≤ SG ≤ 1

  • 200ºF ≤ Tb ≤ 1100ºF

References

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

Examples

>>> T = unidades.Temperature(570.2, "F")
>>> "%0.1f" % AnilinePoint(0.8304, T).R
'635.5'
lib.petro.SmokePoint(SG, Tb)[source]
Calculate the smoke point of petroleum fractions using the procedure 2B10

from API technical databook, pag. 239 The smoke point is the height in millimeters of the flame that is produced in a lamp at standard conditions without causing smoking.

Parameters:
SGfloat

Specific gravity, [-]

Tbfloat

Mean average boiling point, [ºF]

Returns:
SPfloat

Cloud point, [mm]

Notes

Raise NotImplementedError if input isn’t in limit:

  • 0.7 ≤ SG ≤ 0.86

  • 200ºF ≤ Tb ≤ 550ºF

References

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

Examples

>>> T = unidades.Temperature(414.5, "F")
>>> "%0.1f" % SmokePoint(0.853, T).mm
'16.7'
lib.petro.FreezingPoint(SG, Tb)[source]
Calculate freezing point of petroleum fractions using the procedure 2B11

from API technical databook, pag. 241 The freezing point is the temperature at which solid crystals formed on cooling disappear as the temperature is raised.

Parameters:
SGfloat

Specific gravity, [-]

Tbfloat

Mean average boiling point, [ºR]

Returns:
FPfloat

Cloud point, [ºR]

Notes

Raise NotImplementedError if input isn’t in limit:

  • 0.74 ≤ SG ≤ 0.9

  • 725ºR ≤ Tb ≤ 1130ºR

References

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

Examples

>>> T = unidades.Temperature(874.5, "R")
>>> "%0.0f" % CloudPoint(0.799, T).R
'417'
lib.petro.CloudPoint(SG, Tb)[source]
Calculate cloud point of petroleum fractions using the procedure 2B12

from API technical databook, pag. 243 The cloud point of is the temperature at which its solid paraffin content begins to solidify and separate in tiny crystals, causing the oil to appear cloudy.

Parameters:
SGfloat

Specific gravity, [-]

Tbfloat

Mean average boiling point, [ºR]

Returns:
CPfloat

Cloud point, [ºR]

Notes

Raise NotImplementedError if input isn’t in limit:

  • 0.77 ≤ SG ≤ 0.93

  • 800ºR ≤ Tb ≤ 1225ºR

References

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

Examples

>>> T = unidades.Temperature(811.5, "R")
>>> "%0.1f" % CloudPoint(0.787, T).R
'383.4'
lib.petro.CetaneIndex(API, Tb)[source]
Calculate cetane index of petroleum fractions using the procedure 2B13

from API technical databook, pag. 245 Cetane index is the number equal to the porcentage of cetane in a blend of cetane and α-methyl naphthalene having the same ignition quality as a sample of the petroleum fraction.

Parameters:
APIfloat

API gravity, [-]

Tbfloat

Mean average boiling point, [ºF]

Returns:
CIfloat

Cetane Index, [-]

Notes

Raise NotImplementedError if input isn’t in limit:

  • 27 ≤ API ≤ 47

  • 360ºF ≤ Tb ≤ 700ºF

References

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

Examples

>>> T = unidades.Temperature(617, "F")
>>> "%0.1f" % CetaneIndex(32.3, T)
'57.1'
lib.petro.PNA_Riazi(M, SG, n, d20=None, VGC=None, CH=None)[source]
Calculate fractional compositon of paraffins, naphthenes and aromatics

contained in petroleum fractions using the procedure 2B4.1 from API technical databook, pag. 225

Parameters:
Mfloat

Molecular weight, [g/mol]

SGfloat

Specific gravity, [-]

nfloat

Refractive index, [-]

d20float

Density at 20ºC, [g/cm³]

VGCfloat

Viscosity gravity constant, [-]

CHfloat

Carbon/hydrogen ratio, [-]

Returns:
xpfloat

Paraffins mole fraction, [-]

xnfloat

Naphthenes mole fraction, [-]

xafloat

Aromatics mole fraction, [-]

Notes

Density at 20ºC is optional and can be calculated from specific gravity. VGC and CH are optional parameters, the procedure need one of them

Raise NotImplementedError if input viscosity or CH ratio are undefined

References

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

Examples

>>> "%0.3f %0.3f %0.3f" % PNA_Riazi(378, 0.9046, 1.5002, 0.9, VGC=0.8485)
'0.606 0.275 0.118'
lib.petro.PNA_Peng_Robinson(Nc, M, WABP)[source]
Calculate fractional compositon of paraffins, naphthenes and aromatics

contained in petroleum fractions using the Peng-Robinson procedure

Parameters:
Ncindex

Carbon number, [-]

Mfloat

Molecular weight, [g/mol]

WABPfloat

Weight average boiling temperature, [K]

Returns:
xpfloat

Paraffins mole fraction, [-]

xnfloat

Naphthenes mole fraction, [-]

xafloat

Aromatics mole fraction, [-]

Notes

This method can too calculate the critical properties of fraction

References

[36] Ahmed, T.; Hydrocarbon Phase Behavior. Gulf Publishing, Houston, TX, 1989.

[38] Robinson, D.B., Peng, D.Y.; The characterization of the heptanes and heavier fractions. Research Report 28. GPA, 1978. Tulsa, OK.

lib.petro.PNA_Bergman(Tb, SG, Kw)[source]
Calculate fractional compositon of paraffins, naphthenes and aromatics

contained in petroleum fractions using the Bergman procedure

Parameters:
Tbfloat

Boiling temperature, [K]

SGfloat

Specific gravity, [-]

Kwfloat

Watson characterization factor, [-]

Returns:
xpfloat

Paraffins mole fraction, [-]

xnfloat

Naphthenes mole fraction, [-]

xafloat

Aromatics mole fraction, [-]

Notes

This method can too calculate the critical properties of fraction

References

[36] Ahmed, T.; Hydrocarbon Phase Behavior. Gulf Publishing, Houston, TX, 1989.

[37] Bergman, D.F., Tek, M.R., Katz, D.L.; Retrograde Condensation in Natural Gas Pipelines. Project PR 2-29 of Pipelines Research Committee, AGA, January 1977

lib.petro.PNA_van_Nes(M, n, d20, S)[source]
Calculate fractional compositon of paraffins, naphthenes and aromatics

contained in petroleum fractions using the Van Nes procedure

Parameters:
Mfloat

Molecular weight, [g/mol]

nfloat

Refractive index, [-]

d20float

Density at 20ºC, [g/cm³]

Sfloat

Sulfur content, [-]

Returns:
xpfloat

Paraffins mole fraction, [-]

xnfloat

Naphthenes mole fraction, [-]

xafloat

Aromatics mole fraction, [-]

Notes

This method can too calculate the total number of rings, the number of aromatics rings and the naphthenic rings

References

[35] Van Nes, K., Van Western, H.A.; Aspects of the Constitution of Mineral Oils. Elsevier, New York, 1951

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

lib.petro.viscoAPI(Tb=None, Kw=None, v100=None, v210=None, T=None, T1=None, T2=None)[source]
Calculate viscosity of a petroleum fraction using the API procedure

11A4.2 and 11A4.4

Parameters:
Tbfloat

Boiling temperature, [K]

Kwfloat

Watson characterization factor, [-]

v100float, optional

Kinematic viscosity at 100ºF, [m²/s]

v210float, optional

Kinematic viscosity at 210ºF, [m²/s]

Tfloat, optional

Optional temperature to calculate the viscosity, [K]

T1float, optional

Temperature for v100 viscosity value, [K]

T2float, optional

Temperature for v210 viscosity value, [K]

Returns:
v100float

Kinematic viscosity at 100ºF, [m²/s]

v210float

Kinematic viscosity at 210ºF, [m²/s]

vTfloat, optional

Kinematic viscosity at T input, [m²/s]

Notes

By default the method calculate the viscosity at 100ºF and 210ºF, can too calculate the viscosity at input T temperature if T1 and T2 are different to 100ºF and 210ºF v100 and v210 input are at that temperatures if both viscosity are input Tb and Kw input aren’t unnecesary

References

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

Examples

Example A in procedure 11A4.2

>>> Tb = unidades.Temperature(598.7, "F")
>>> T = unidades.Temperature(140, "F")
>>> mu = viscoAPI(Tb, 11.87, T=T)
>>> "%0.2f %0.2f %0.2f" % (mu["v100"].cSt, mu["v210"].cSt, mu["vT"].cSt)
'5.94 1.88 3.57'

Example B in procedure 11A4.2

The values differ, in reference only use 2 decimal number in intermediate >>> Tb = unidades.Temperature(647.3, “F”) >>> T = unidades.Temperature(304, “F”) >>> mu = viscoAPI(Tb, 9.955, T=T) >>> “%0.2f %0.2f %0.2f” % (mu[“v100”].cSt, mu[“v210”].cSt, mu[“vT”].cSt) ‘39.41 5.20 2.12’

Example C in procedure 11A4.2

>>> Tb = unidades.Temperature(382.1, "F")
>>> mu = viscoAPI(Tb, 11.93)
>>> "%0.3f" % mu["v100"].cSt
'1.249'
>>> Tb = unidades.Temperature(1113.2, "F")
>>> mu = viscoAPI(Tb, 11.94)
>>> "%0.0f" % mu["v100"].cSt
'2612'

Example B in procedure 11A4.4

>>> T = unidades.Temperature(68, "F")
>>> T1 = unidades.Temperature(32, "F")
>>> T2 = unidades.Temperature(104, "F")
>>> v100 = unidades.Diffusivity(1.644, "cSt")
>>> v210 = unidades.Diffusivity(0.925, "cSt")
>>> mu = viscoAPI(T1=T1, T2=T2, T=T, v100=v100, v210=v210)
>>> "%0.3f" % mu["vT"].cSt
'1.201'
lib.petro.SUS(T, v)[source]
Calculate the Saybolt Universal Viscosity in Saybolt Universal Seconds

(SUS) from kinematic viscosity, also referenced in API Procedure 11A1.1, pag 1027

Parameters:
Tfloat

Temperature, [K]

vfloat

Kinematic viscosity, [cSt]

Returns:
SUSfloat

Saybolt Universal Seconds, [s]

References

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

[30] ASTM D2161-05; Standard Practice for Conversion of Kinematic Viscosity to Saybolt Universal Viscosity or to Saybolt Furol Viscosity. ASTM International, West Conshohocken, PA 2005, www.astm.org

Examples

Example A from [20], SUS at 200ºF for ν=53cSt

>>> T = unidades.Temperature(617, "F")
>>> "%0.0f" % SUS(T, 53)
'254'

Example B from [20], SUS at 0ºF for ν=90cSt

>>> T = unidades.Temperature(0, "F")
>>> "%0.0f" % SUS(T, 90)
'415'
lib.petro.SFS(T, v)[source]
Calculate the Saybolt Furol Viscosity in Saybolt Furol Seconds

(SFS) from kinematic viscosity, also referenced in API Procedure 11A1.4, pag 1031

Parameters:
Tfloat

Temperature, [K]

vfloat

Kinematic viscosity, [cSt]

Returns:
SFSfloat

Saybolt Furol Seconds, [s]

References

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

[30] ASTM D2161-05; Standard Practice for Conversion of Kinematic Viscosity to Saybolt Universal Viscosity or to Saybolt Furol Viscosity. ASTM International, West Conshohocken, PA 2005, www.astm.org

Examples

Example A from [20], SFS at 122ºF and 210ºF for ν122=300cSt, v210=100cSt

>>> T = unidades.Temperature(122, "F")
>>> "%0.1f" % SFS(T, 300)
'141.7'
>>> T = unidades.Temperature(210, "F")
>>> "%0.1f" % SFS(T, 100)
'48.4'
lib.petro.MuL_Singh(T, v100)[source]
Calculate kinematic viscosity of liquid petroleum fractions at low

pressure by Singh correlation, also referenced in API Procedure 11A4.1, pag 1031

Parameters:
Tfloat

Temperature, [K]

v100float

Kinematic viscosity at 100ºF, [cSt]

Returns:
vfloat

Kinematic viscosity at T, [cSt]

References

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

[31] Singh, B., Mutyala, S.R., Puttagunta, V.; Viscosity range from one test. Hydrocarbon Processing 69 (1990) 39-41

Examples

Example from [20], Sumatran crude at 210ºF

>>> T = unidades.Temperature(210, "F")
>>> "%0.3f" % MuL_Singh(T, 1.38).cSt
'0.705'
lib.petro.H_Riazi(S, CH)[source]

Calculate hydrogen content of petroleum fractions

Parameters:
Sfloat

Sulfur content, [%]

CHfloat

Carbon/hydrogen ratio, [-]

Returns:
Hfloat

Hydrogen content, [%]

Notes

A Simple mass balance discarting other elements composition than hydrogen, carbon and sulfur

References

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

lib.petro.H_Goossens(M, n, d20)[source]
Calculate hydrogen content of petroleum fractions using the correlation

of Goossens

Parameters:
Mfloat

Molecular weight, [-]

nfloat

Refractive index, [-]

d20float

Liquid density at 20ºC, [g/cm³]

Returns:
Hfloat

Hydrogen content, [%]

References

[40] Goossens, A.G.; Prediction of the Hydrogen Content of Petroleum Fractions. Ind. Eng. Chem. Res. 36(6) (1997) 2500-2504

Examples

Table 1 data for n-decane

>>> "%0.2f" % H_Goossens(142, 1.4119, 0.7301)
'15.45'
lib.petro.H_ASTM(Tb, SG, xa)[source]

Calculate hydrogen content of petroleum fractions

Parameters:
Tbfloat

Mean average boiling point, [ºR]

SGfloat

Specific gravity, [-]

xafloat

Aromatics mole fraction, [-]

Returns:
Hfloat

Hydrogen content, [%]

References

[29] Riazi, M. R.; Characterization and Properties of Petroleum Fractions.. ASTM manual series MNL50, 2005

[42] ASTM; Annual Book of Standards. ASTM International, West Conshohocken, PA, 2002

lib.petro.H_Jenkins_Walsh(SG, anilineP)[source]
Calculate hydrogen content of petroleum fractions using the correlation

of Jenkins-Walsh

Parameters:
SGfloat

Specific gravity, [-]

anilinePfloat

Aniline point, [K]

Returns:
Hfloat

Hydrogen content, [%]

References

[41] Jenkins, G.I., Walsh, R.E; Quick Measure of Jet Fuel Properties. Hydrocarbon Processing 47(5) (1968) 161-164

lib.petro.S_Riazi(M, SG, Ri, m)[source]

Calculate sulfur content of petroleum fractions

Parameters:
Mfloat

Molecular weight, [-]

SGfloat

Specific gravity, [-]

Rifloat

Refractivity intercept, [-]

mfloat

characterization factor, [-]

Returns:
Sfloat

Sulfur content, [%]

References

[39] Riazi, M.R., Nasimi, N., Roomi, Y.; Estimating Sulfur Content of Petroleum Products and Crude Oils. Ind. Eng. Chem. Res. 38(11) (1999) 4507-4512

Examples

S predicted in table 3 for a crude nº1

>>> "%0.2f" % S_Riazi(202, 0.837, 1.0511, -1.4849)
'1.19'

crude nº61

>>> "%0.2f" % S_Riazi(1484, 1.0209, 1.1611, 289.2786)
'2.85'
lib.petro.CombustionHeat(API, water=0, ash=0, S=0)[source]
Calculate gross and net heat of combustion at 60ºF for petroleum

fractions, referenced in API procedure 14A1.3, pag 1236

Parameters:
APIfloat

API Specific gravity, [-]

waterfloat

Weight fraction of water, [%]

ashfloat

Weight fraction of inerts, [%]

Sfloat

Weight fraction of inerts, [%]

Returns:
Hgrossfloat

Gross heat of combustion, [Btu/lb]

Hnetfloat

Net heat of combustion, [Btu/lb]

References

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

Examples

Fuel oil with 11.3ºAPI, 1.49%S, 1.67%ash, 0.3%water

>>> hg, hn = CombustionHeat(11.3, 0.3, 1.67, 1.49)
>>> "%0.0f %0.0f" % (hg.Btulb, hn.Btulb)
'18218 17222'
class lib.petro.Petroleo(**kwargs)[source]

Bases: newComponente

Class to define a heavy oil fraction with a unknown composition

Parameters:
Mfloat

Molecular weight, [-]

Tbfloat

Mean average boiling point, [K]

SGfloat

Specific gravity, [-]

APIfloat

API gravity, [-]

CHfloat

Carbon/hydrogen ratio, [-]

Ifloat

Huang parameter, [-]

nfloat

Refractive index, [-]

Kwfloat

Watson characterization factor, [-]

v100float

Kinematic viscosity at 100ºF, [m²/s]

v210float

Kinematic viscosity at 210ºF, [m²/s]

Hfloat

Hydrogen content, [-]

Sfloat

Sulfur content, [-]

Nfloat

Nitrogen content, [-]

Ncfloat

Fraction carbon number, [-]

curveTypestring

Name of curve data in curve input: D86, TBP, SD, D1186, EFV

T_curvelist

Boiling point temperature, [K]

X_curvelist

Volume or weight distillation fraction array

P_curvefloat

Distillation data pressure, [Pa]

fit_curvearray

Array of fit parameter of curve distillation [To, A, B]

Methods

Viscosity_Index()

Método de calculo del indice de viscosidad, API procedure 11A6.1, pag 1083

__call__(**kwargs)

Call self as a function.

calculateMethod(method)

Calculate method of properties and save to avoid other iteration

calculo()

Calculate procedure with common functionality and define the properties don't defined by the method The child class must implement the specific calculate procedure and call this method it is necessary to finish definition

isCalculable()

1 - Tb y SG 2 - M y SG 3 - Tb y I 4 - M y I 5 - Tb y CH 6 - M y CH 7 - v100 y I 8 - Nc (opción muy poco precisa) 9 - curva de destilación

pr

tr

Notes

The calculated instance has the necessary calculated properties to be used in the flowsheet as hypotethical component.

The definition can be with several input parameters:

  • Distillation data (TBP or other). This is the prefered and accurate method to define the pseudocomponent.

  • Any combination of physical properties (Tb, SG, M, I, n, CH, v100)

  • Nc as only paramter to calculata all the other propeties, this is the less accurate method and it’s not recommended.

Refractive index is equivalent as input parameter to Huang parameter. Watson characterization factor is equivalent to SG or boiling temperature API gravity is equivalent to SG as input paramter

Examples

Example from [20], procedure 2B1.1

>>> X = [0.1, 0.3, 0.5, 0.7, 0.9]
>>> D86 = [149, 230, 282, 325, 371]
>>> D86_K = [unidades.F2K(t) for t in D86]
>>> oil = Petroleo(curveType="D86", X_curve=X, T_curve=D86_K)
>>> "%.0f %.0f %.0f %.0f %.0f" % (        oil.VABP.F, oil.MABP.F, oil.WABP.F, oil.CABP.F, oil.MeABP.F)
'271 241 279 264 253'
kwargs = {'API': 0.0, 'CH': 0.0, 'H': 0.0, 'I': 0.0, 'Kw': 0.0, 'M': 0.0, 'N': 0.0, 'Nc': 0, 'P_curve': 101325, 'S': 0.0, 'SG': 0.0, 'T_curve': [], 'Tb': 0.0, 'X_curve': [], 'curveType': '', 'fit_curve': [], 'n': 0.0, 'name': '', 'v100': 0.0, 'v210': 0.0}
status = 0
_bool = False
msg = ''
definicion = 0
calculatedMethod = {}
CURVE_TYPE = ['D86', 'TBP', 'SD', 'D1186', 'EFV']
METHODS_PNA = ['Riazi (API)', 'Peng Robinson (1978)', 'Bergman (1977)', 'Van Nes (1951)']
METHODS_M = ['Riazi-Daubert (1987)', 'Riazi-Daubert (1980)', 'Lee-Kesler (1976)', 'Sim Daubert (1980)', 'Goossens (1971)', 'Twu (1983)']
METHODS_Tb = ['Riazi-Daubert (1987)', 'Riazi (Heavy fractions)', 'Rowe (1978)', 'Sancet (2007)', 'Silva-Rodríguez (1992)', 'Soreide (1989)']
METHODS_SG = ['Riazi-Daubert (1987)', 'Silva-Rodríguez (1992)']
METHODS_w = ['Edmister (1958)', 'Lee-Kesler (1976)', 'Korsten (2000)', 'Watansiri-Owens-Starling (1985)', 'Magoulas-Tassios (1990)']
METHODS_crit = ['Riazi-Daubert (1987)', 'Riazi-Daubert (1980)', 'Cavett (1962)', 'Lee-Kesler (1976)', 'Sim Daubert (1980)', 'Watansiri-Owens-Starling (1985)', 'Rowe (1978)', 'Standing (1977)', 'Willman-Teja (1987)', 'Magoulas-Tassios (1990)', 'Tsonopoulos (1986)', 'Twu (1983)', 'Sancet (2007)', 'Riazi (Heavy fractions)', 'Riazi-Alsahhaf (1998)']
METHODS_Vc = ['Riazi-Daubert (1987)', 'Riazi-Daubert (1980)', 'Sim Daubert (1980)', 'Watansiri-Owens-Starling (1985)', 'Twu (1983)', 'Hall-Yarborough (1971)', 'Riazi (Heavy fractions)', 'Riazi-Alsahhaf (1998)']
METHODS_n = ['Riazi-Daubert (1987)', 'Riazi (Heavy fractions)', 'Willman-Teja (1987)']
METHODS_H = ['Riazi', 'Goossens', 'ASTM', 'Jenkins-Walsh']
METHODS_Zc = ['Lee-Kesler (1975)', 'Salerno (1986)', 'Nath (1985)', 'Reid (1977)', 'Hougen (1952)']
__init__(**kwargs)[source]
isCalculable()[source]

1 - Tb y SG 2 - M y SG 3 - Tb y I 4 - M y I 5 - Tb y CH 6 - M y CH 7 - v100 y I 8 - Nc (opción muy poco precisa) 9 - curva de destilación

calculo()[source]

Calculate procedure with common functionality and define the properties don’t defined by the method The child class must implement the specific calculate procedure and call this method it is necessary to finish definition

tr(T)[source]
pr(P)[source]
_M()[source]

Molecular weight calculation

_critic()[source]

Critic pressure and temperature calculation

_Vc()[source]

Critic volume calculation

_f_acent()[source]

Acentric factor calculation

_Tb()[source]

Boiling temperature calculation

_SG()[source]

Specific gravity procedure calculation

_n()[source]

Refractive index procedure calculation

_CH()[source]

Carbon-Hydrogen procedure calculation

calculateMethod(method)[source]

Calculate method of properties and save to avoid other iteration

_Zc()[source]
_H()[source]
_D86_TBP(D86, reverse=False)[source]

Use the preferences to calcuate the TBP distillation curve from D86 with the desired method

_SD_D86(SD)[source]

Use the preferences to calcuate the D86 distillation curve from SD with the desired method

_PNA()[source]

Calculate the Paraffin-Naphthenes-Aromatics group composition

Viscosity_Index()[source]

Método de calculo del indice de viscosidad, API procedure 11A6.1, pag 1083

References