Reduced-order modelling of equations of state using tensor decomposition for robust, accurate and efficient property calculation in high-pressure fluid flow simulations

https://doi.org/10.1016/j.supflu.2020.104938Get rights and content

Highlights

  • Accurate, fast and robust approximation of thermodynamic properties via ROM.

  • Universal wrapper of ROM for CFD codes, allowing fast implementation.

  • Excellent numerical properties and accuracy.

Abstract

Computationally efficient, accurate and robust Computational Fluid Dynamics (CFD) simulations involving thermodynamic properties from Equations of State (EOS) are hindered by limitations dictated by coupling strategies between EOS and CFD codes. This is a key aspect for a wide range of Chemical Engineering designs with special emphasis on those involving transcritical flows. We introduce a ROM approach based on a non-structured and sparse implementation of the Canonical Polyadic Decomposition of tensors that target abovementioned requirements. It reaches a similar speed with regards to direct use of the full equation of state and provides mean errors about 1 %–5 % without limiting accuracy. Its implementation is done in a standard and portable way, avoiding the need of additional implementation and an easy coupling with open and commercial CFD codes. The method is tested here for CFD but it can be directly applied in any process simulation tool.

Introduction

Equations of state (EOS) play a very important role in chemical engineering technology since thermodynamic fluid properties with low uncertainties are needed for a variety of industrial and scientific applications [1]. In the last twenty years, we have seen the integration of relatively complex EOS in commercial, open-source and in-house computational fluid dynamics (CFD) codes for a variety of applications [[2], [3], [4]]. This is an important technological challenge in the modelling and simulation of transcritical flows, where the use of equations of state is mandatory due to the enormous variation of thermodynamic properties when the Widom line is crossed [5].

A key aspect of the combination of EOS models and CFD codes is the computational implementation of thermodynamic properties calculations to be used by the CFD code. The traditional way is to use an ad hoc implementation of such EOS algorithms for computing density, heat capacity, enthalpy, etc. which is tested versus other already available implementation. Very often, the programming language employed is different in both implementations. Typically, very high-level programming languages are used in an early stage of research of a particular problem -prior to the set-up of the CFD problem- like MATLAB®, Python, Visual Basic or Process Simulators like ASPEN PLUS® or HYSYS ®. Normally, in this stage only global mass and energy balances are needed. When micro-scale information is demanded, a CFD simulation needs to be performed and such high-level implementation needs to be translated to C or C++ code, which are normally the languages used for computing in CFD. This is not a trivial task, and needs to be done carefully because of the appearance of numerical problems and other issues is often unavoidable. The EOS implementation for thermodynamic properties calculations in a CFD code needs to be robust since every function coded will be required to be called millions of times during a typical calculation. A single failure in a single function can cause the premature end of the CFD simulation with the additional loss of data. Besides, some EOS models are notoriously difficult to implement, such as multiparameter EOS [6] and associating fluid theory EOS [7]. In those cases, it is sometimes cumbersome to write robust, accurate and efficient density computation routines due to the non-linearity of the problem [8]. Because of that, many researchers advocate the use of cubic EOS, which are easy to work with and a cover very important range of applications [9]. Some open-source and commercial CFD codes have some EOS routines already implemented, such as OpenFOAM [10] and ANSYS Fluent®, which has a bridge to connect with the REFPROP library [11].

Existing research recognises the importance of this problem. For the analysis of supercritical mixing layers, Bellan’s group wrote some of the first codes integrating EOS and CFD [2,12,13]. In those works, the Peng-Robinson EOS [14] with van der Waals mixing rules is implemented in a FORTRAN Direct Numerical Simulation CFD code. The problem under consideration was the binary mixing of nitrogen and heptane, considering heptane is a surrogate of rocket fuel. Later, Meng and Yang developed a preconditioning scheme for the same problem based on partial mass properties and applied it with the SRK EOS [15]. The same authors [16] studied liquid oxygen injection in supercritical hydrogen streams also using a direct simulation with that preconditioning scheme.

In the chemical engineering community, many authors have addressed the problem of implementing EOS and CFD using different approaches. Most of the papers devoted to this issue develop an ad hoc implementation of the EOS. For instance, Sierra-Pallares et al. implemented the Peng-Robinson EOS with different mixing rules for the computational study of different applications of high–pressure technology as hydrothermal flames [17], supercritical antisolvent precipitation [18,19], nanoparticle synthesis [4,20] and hydrothermal drilling [21]. In all of the above, ANSYS Fluent software was used, and the EOS was implemented through User Defined Functions (UDF). Raghavan and Ghoniem used the Peng-Robinson EOS along with the Predictive Peng-Robinson 78 (PPR78) approach [22] to perform a direct numerical simulation of water – decane mixing at high-pressure with OpenFOAM software [23].

Other authors have opted for the implementation of wrappers of existing libraries. Vaquerizo and Cocero [24] developed a software bridge to connect the ASPEN PLUS® thermodynamic property engine with ANSYS Fluent ®. Both codes were linked through a complex routine involving Visual Basic, MATLAB and C languages, allowing the complete ASPEN PLUS® engine to be used by Fluent. In that paper, the IAPWS [25] and Peng-Robinson EOS were shown as test cases. Unfortunately, such implementation is not open-source and depends mainly on commercial software. Additionally, the authors do not specify if it is possible its use in a parallel computation. Very recently, Fadiga et al. [26] have developed CoolFOAM, which is a wrapper of CoolProp library for OpenFOAM for compressible fluid flow simulation of single component flows.

Other works deal with the problem in a completely different way, approaching the EOS with a reduced order model (ROM). In this methodology, the different thermodynamic properties to be included in the CFD calculation are pre-computed using available software (commercial, open source or in-house codes) and then approximated by a reduced-order model, which is capable of reproducing the data accurately and fast. Several techniques are available, ranging from the use of deep neural networks to high order polynomial functions. Traxinger and Pfitzner used the Peng-Robinson EOS to train a deep neural network ROM able to reproduce with high accuracy density, enthalpy and heat capacity of nitrogen at high-pressure for a range of pressure and temperature [27] ideal for its use in a simulation of transcritical flow. Cardozo et al. [28] used a polynomial ROM to replicate the results of Sierra-Pallares et al. [18] study of supercritical antisolvent precipitation. In this case, density data for the mixture was fitted using polynomials in the range of temperature and pressure for the problem under study. Thus, ROM can be considered a data-driven approach to the problem of thermodynamic properties calculations. The ROM methodology is promising since it avoids the use of an ad hoc implementation of the EOS in the CFD code, allows for a direct density computation (non-iterative) and the ROM can be generated with state-of-the-art thermodynamics software, without further modification. In addition, the implementation in the CFD code can be unique for different EOS models and very often be much faster than the original EOS code. However, to the authors' knowledge, only the above-referenced papers deal with this problem and for very concrete cases. Thus, the specific objective of this paper is to present a novel methodology for robust, accurate and efficient EOS implementation in CFD codes using ROM for high-pressure, multicomponent transcritical flows. Our idea is based on the use of tensorial networks to approach the EOS data, which is generated using available libraries and later implemented in a CFD code using a universal wrapper. Several strategies can be found when facing tensor decomposition; among them, the most widely applied are Tucker Decomposition and Canonical Polyadic Decomposition. Both methods are non-intrusive, it means, they are performed on data and the system’s equations are not affected [29,30].

The library used in this paper falls into the second category: TWINKLE library [31] performs model reduction through Galerkin projection. Its main advantage is that it is focused in efficient ready-to-use reduced order model calculation and evaluation, and data analysis.

Section snippets

Tensor decomposition as reduced order model

As stated in the previous section, TWINKLE library is employed for ROM calculation. Since it is a non-intrusive approach, a design of experiments (DOE) must be previously performed.

The corresponding EOS is calculated for an interval of pressure and temperature according to the operating conditions defined in the next section if it is a pure fluid case; and component fraction or fractions for multi-component examples. Once the data is obtained, the computational parameters and discretization net

Test cases

To show the viability of the method, we have extracted from literature different single-phase flows of different substances (single-component and multi-component) as shown in Table 1. All of the cases under study correspond to trans-critical or supercritical flows, where the use of an EOS is mandatory. The maximum property variation is often found close to the critical point, thus providing a good stress test to the methodology proposed.

Nitrogen, heptane and water (cases A, B and C) are

General comments

A series of test cases have been enumerated in Table 1, their corresponding ROM is set-up using the common computational parameters stated on Sections 2 and 3 and the case-specific discretization nets along with the training data defined on Table 2. Under these considerations, ROM calculation is performed for several thermodynamic properties on data acquired through multi-parameter equations based on Helmholtz energy function (HEOS). To assess the prediction accuracy, Mean Absolute Percentage

Conclusions

It is possible to obtain a robust, fast and accurate ROM of thermodynamic models based on equations of state of arbitrary complexity via the use of a Canonical Polyadic Decomposition based on a Galerkin projection, with a convenient definition of the thermodynamic intervals and training data. The ROM implementation of thermodynamic properties solves the issue of finding the density from the EOS in each iteration, making a linearization of the non-linear problem in an alternative and extremely

Declaration of Competing Interest

The authors declare there is no conflict of interest.

Acknowledgements

The authors want to acknowledge Prof. Fidel A. Mato (University of Valladolid) his invaluable advice about the use of equations of state in this work.

References (37)

  • J. Sierra-Pallares et al.

    Numerical modelling of supercritical submerged water jets in a subcritical co-flow

    J. Supercrit. Fluids

    (2012)
  • I. De Marco et al.

    Interactions of phase equilibria, jet fluid dynamics and mass transfer during supercritical antisolvent micronization: the influence of solvents

    Chem. Eng. J.

    (2012)
  • R. Span

    Multiparameter Equations of State: An Accurate Source of Thermodynamic Property Data

    (2013)
  • N.A. Okong’o et al.

    Direct numerical simulation of a transitional supercritical binary mixing layer: heptane and nitrogen

    J. Fluid Mech.

    (2002)
  • G. Borghesi et al.

    A priori and a posteriori investigations for developing large eddy simulations of multi-species turbulent mixing under high-pressure conditions

    Phys. Fluids

    (2015)
  • J. Sierra-Pallares et al.

    Quantification of mixing efficiency in turbulent supercritical water hydrothermal reactors

    Chem. Eng. Sci.

    (2011)
  • I.H. Bell et al.

    Pure and pseudo-pure fluid thermophysical property evaluation and the open-source thermophysical property library coolprop

    Ind. Eng. Chem. Res.

    (2014)
  • J.O. Valderrama

    The state of the cubic equations of state

    Ind. Eng. Chem. Res.

    (2003)
  • Cited by (1)

    View full text