BECAS
BENELLI Federico Ezequiel
congresos y reuniones científicas
Título:
PyForFluids: A Python package for multicomponent fluid thermodynamic properties and phase equilibrium calculations
Autor/es:
FEDERICO BENELLI; MARIA CANDELARIA ARPAJOU; JUAN BAUTISTA CABRAL; MARTIN CISMONDI
Reunión:
Congreso; XII IBEROAMERICAN CONFERENCE ON PHASE EQUILIBRIA AND FLUID PROPERTIES FOR PROCESS DESIGN; 2022
Resumen:
PyForFluids (Python-Fortran-Fluids) is a Python package focused on the calculation ofmulticomponent fluids properties and phase equilibrium based on Equations of State (EoS). Itprovides a simple interface to work from a high level object oriented abstraction but alsoexploits the high performance Fortran code for the heavier calculations.Right now it includes the multifluid GERG-2008 EoS [1] and three cubic EoS (Peng-Robinson, Soave-Redlich-Kwong and RKPR) [2, 3, 4] are being implemented. All four equationsare explicit in the Helmholtz Free Energy.PyForFluids calculates multiple thermodynamic properties like speed of sound,isobaric heat, compressibility factor, entropy, enthalpy, etc. Besides that, biphasic equilibriumcalculations like flash, bubble and dew points are included, with phase envelopes tracing beingin current development.To realize complex calculations, PyForFluids takes advantage of the high performanceand speed of Fortran code. At the same time, it offers a user-friendly Python interface. Theintegration between these two programming languages is achieved thanks to numpy[5]module f2py[6]. Fortran was the chosen language due to both being faster for numericalroutines and an availability of legacy projects.50This package is designed with a collaborative and modular approach in mind, takingadvantage of an object oriented programming approach. To both see the inner workings of itand make changes/additions proposals all the code is available on an public repository atGitHub https://github.com/fedebenelli/pyforfluids. PyForFluids is made followingprogramming good practices standards for continuous integration. At each code addition ormodification, the package is tested with specific unit tests to assure the reliance of thecomputations. Also the documentation where each class and function is described isautomatically generated and hosted at https://pyforfluids.readthedocs.io with each update,where also a simple tutorial with the basic usage of the package can be found.[1] O. Kunz and W. Wagner. The GERG-2008 Wide-Range Equation of State for Natural Gasesand Other Mixtures: An Expansion of GERG-2004. Journal of Chemical & Engineering Data2012 57 (11), 3032-3091 DOI: 10.1021/je300655b[2] D. Y. Peng and D. B. Robinson, “A New Two-Constant Equation of State,” Ind. Eng. Chem.Fundam., vol. 15, no. 1, pp. 59–64, 1976, doi: 10.1021/i160057a011.[3] G. Soave, “Equilibrium constants from a modified Redlich-Kwong equation of state,”Chem.Eng. Sci., vol. 27, no. 6, pp. 1197–1203, 1972, doi: 10.1016/0009-2509(72)80096-4.[4] Development and application of a three-parameter RK–PR equation of state, MartínCismondi, Jørgen Mollerup, Fluid Phase Equilibria, Volume 232, Issues 1–2, 2005, Pages 74-89,ISSN 0378-3812, https://doi.org/10.1016/j.fluid.2005.03.020.[5] Harris, C.R., Millman, K.J., van der Walt, S.J. et al. Array programming with NumPy. Nature585, 357–362 (2020). DOI: 10.1038/s41586-020-2649-2. (Publisher link).[6] Peterson, P. (2009). F2PY: a tool for connecting Fortran and Python programs. InternationalJournal of Computational Science and Engineering, 4(4), 296–305.Keywords: Python, Software, Fortran, GERG.