upstreamFoam: an OpenFOAM-based solver for heterogeneous porous media at different scales
Roberto Lange, Gabriel M. Magalhães, Franciane F. Rocha, Pedro V. S. Coimbra, Jovani L. Favero, Rodrigo A. C. Dias, Antonio O. S. Moraes, Mateus P. Schwalbert
A new OpenFOAM application to simulate multiphase flows in porous media is formulated and tested. The proposed solver combines the Eulerian multi-fluid formulation for a system of phase fractions with Darcy's law for flows through porous media. It is based on the multiphaseEulerFoam and includes models for reservoir simulation of the porousMultiphaseFoam, taking advantage of the most recent technologies developed for these well-established solvers. With such an innovative combination, we are able to simulate a system of any number of compressible phase fractions in reservoirs that rely on specialized models for relative permeability, capillary pressure, and time step selection. We successfully validate the solver for classical problems with analytical, semi-analytical, and reference solutions. A wide range of flows in porous media has been studied, demonstrating the potential of the solver to approximate complex multiphase problems.
One of the prevailing challenges in Computational Fluid Dynamics is accurate simulation of two-phase flows involving heat and mass transfer across the fluid interface. This is currently an active field of research, which is to some extend impaired by a lack of a common programming framework for implementing and testing new models. Here we present a new OpenFOAM based open-source framework allowing fast implementation and test of new phase change and surface tension force models. Capitalizing on the runtime-selection mechanism in OpenFOAM, the new models can easily be selected and compared to a…
A hybrid Eulerian-Lagrangian solver RYrhoCentralFoam is developed based on OpenFOAM to simulate detonative combustion in two-phase gas-liquid mixtures. For Eulerian gas phase, RYrhoCentralFoam enjoys second order of accuracy in time and space discretizations and is based on finite volume method on polyhedral cells. The following developments are made based on the standard compressible flow solver rhoCentralFoam in OpenFOAM: (1) multi-component species transport, (2) detailed fuel chemistry for gas phase combustion, and (3) Lagrangian solver for gas-droplet two-phase flows and sub-models for li…
The volume of fluid (VOF) method is a popular approach for multiphase flow modeling. The open-source computational fluid dynamics (CFD) software, OpenFOAM, implements a variety of VOF-based solvers and provides users a wide range of turbulence models. Since isothermal multiphase flows under the VOF framework belong to the variable-density incompressible flow category, the isothermal VOF-based solvers in OpenFOAM fail to use the correct turbulence models. varRhoTurbVOF is designed to solve this issue and with the hope to replace all the corresponding existing solvers in the future. With the obj…
This paper presents the development of a density-based solver suitable for cavitating flows in the OpenFOAM framework. In this solver, the thermodynamic equilibrium mixture approach is adopted to model the presence of and the phase transition between liquid and vapor phases. Using this approach, two cavitation models are implemented in a separate library, although more cavitation models can be easily added. The two are a temperature-dependent cavitation model and a barotropic cavitation model developed by Egerer et al. (2014). One of the main advantages of the solver is that it considers the c…
In this work, we study the implementation of electrically-driven flow (EDF) models in the finite-volume framework of $\text{OpenFOAM}^\circledR$. The Poisson-Nernst-Planck model is used for the transport of charged species and it is coupled to the Navier-Stokes equations, governing the fluid flow. In addition, the Poisson-Boltzmann and Debye-Hückel models are also implemented. The discretization method and the boundary conditions are carefully handled in order to ensure conservativeness of ionic species in generic meshes and second-order accuracy in space and time. The applicability of the dev…
Within OpenFOAM, we develop a pressure-based solver for the Euler equations written in conservative form using density, momentum, and total energy as variables. Under simplifying assumptions, these equations are used to describe non-hydrostatic atmospheric flow. For the stabilization of the Euler equations and to capture sub-grid processes, we consider two Large Eddy Simulation models: the classical Smagorinsky model and the one equation eddy-viscosity model. To achieve high computational efficiency, our solver uses a splitting scheme that decouples the computation of each variable. The numeri…
In this paper, the Immersed Boundary Method (IBM) proposed by Pinelli is implemented for finite volume approximations of incompressible Navier-Stokes equations solutions in the open source toolbox OpenFOAM version 2.2. Solid obstacles are described using a discrete forcing approach for boundary conditions. Unlike traditional approaches encompassing the presence of a solid body using conformal meshes and imposing no-slip boundary conditions on the boundary faces of the mesh, the solid body is here represented on the Eulerian Cartesian mesh through an ad-hoc body force evaluated on a set of Lagr…
Large eddy simulation (LES) has become the de-facto computational tool for modeling complex reacting flows, especially in gas turbine applications. However, readily usable general-purpose LES codes for complex geometries are typically academic or proprietary/commercial in nature. The objective of this work is to develop and disseminate an open source LES tool for low-Mach number turbulent combustion using the OpenFOAM framework. In particular, a collocated-mesh approach suited for unstructured grid formulation is provided. Unlike other fluid dynamics models, LES accuracy is intricately linked …
Application of a Pressured-Based OpenFOAM Solver for Rotating Detonation Engines
Korea Advanced Institute of Science and Technology(韩国科学技术院);New York University Abu Dhabi(纽约大学阿布扎比分校);Tandon School of Engineering, New York University(纽约大学坦登工程学院)
We outline the development of a general-purpose Python-based data analysis tool for OpenFOAM. Our implementation relies on the construction of OpenFOAM applications that have bindings to data analysis libraries in Python. Double precision data in OpenFOAM is cast to a NumPy array using the NumPy C-API and Python modules may then be used for arbitrary data analysis and manipulation on flow-field information. We highlight how the proposed wrapper may be used for an in-situ online singular value decomposition (SVD) implemented in Python and accessed from the OpenFOAM solver PimpleFOAM. Here, `in-…
GeoChemFoam is an open-source OpenFOAM-based numerical modelling toolbox that includes a range of custom packages to solve complex flow processes including multiphase transport with interface transfer, single-phase flow in multiscale porous media, and reactive transport with mineral dissolution. In this paper, we present GeoChemFoam's novel numerical model for simulation of conjugate heat transfer in micro-CT images of porous media. GeoChemFoam uses the micro-continuum approach to describe the fluid-solid interface using the volume fraction of fluid and solid in each computational cell. The ve…
We develop a high-fidelity numerical solver for the compressible Navier-Stokes equations, with the main aim of highlighting the predictive capabilities of low-diffusive numerics for flows in complex geometries. The space discretization of the convective terms in the Navier-Stokes equations relies on a robust energy-preserving numerical flux, and numerical diffusion inherited from the AUSM scheme is added limited to the vicinity of shock waves, or wherever spurious numerical oscillations are sensed. The solver is capable of conserving the total kinetic energy in the inviscid limit, and it bears…
A numerical model for simulating electro-vortical flows in OpenFOAM is developed. Electric potential and current are solved in coupled solid-liquid conductors by a parent-child mesh technique. The magnetic field is computed using a combination of Biot-Savart's law and induction equation. Further, a deflated PCG solver for the electric potential is implemented. Finally, a performance analysis is presented and the solver is validated against several test cases.
OpenFOAM computational fluid dynamics (CFD) solver for magnetohydrodynamic open cycles, applied to the Sakhalin pulsed magnetohydrodynamic generator (PMHDG)
A two-scale model is presented to simulate the dynamic ion transport and adsorption processes in porous electrodes used for capacitive deionization (CDI). At the pore scale, the Stokes equation governing water flow in porous CDI electrodes is solved using the lattice Boltzmann method and Nernst-Planck equations describing ion transport is solved using the finite volume method. The ion adsorption process is considered at the surface of carbon electrodes. At the continuum scale, Darcy equation and advection-diffusion equation governing water flow and solute transport through CDI cells are solved…
With the growth of available computational resource, CFD-DEM (computational fluid dynamics-discrete element method) becomes an increasingly promising and feasible approach for the study of sediment transport. Several existing CFD-DEM solvers are applied in chemical engineering and mining industry. However, a robust CFD-DEM solver for the simulation of sediment transport is still desirable. In this work, the development of a three-dimensional, massively parallel, and open-source CFD-DEM solver SediFoam is detailed. This solver is built based on open-source solvers OpenFOAM and LAMMPS. OpenFOAM …
This work presents a feature-rich open-source library for wall-modelled large-eddy simulation (WMLES), which is a turbulence modelling approach that reduces the computational cost of traditional (wall-resolved) LES by introducing special treatment of the inner region of turbulent boundary layers (TBLs). The library is based on OpenFOAM and enhances the general-purpose LES solvers provided by this software with state-of-the-art wall modelling capability. In particular, the included wall models belong to the class of wall-stress models that account for the under-resolved turbulent structures by …
A high-performance gas kinetic solver using multi-level parallelization is developed to enable pore-scale simulations of rarefied flows in porous media. The Boltzmann model equation is solved by the discrete velocity method with an iterative scheme. The multi-level MPI/OpenMP parallelization is implemented with the aim to efficiently utilise the computational resources to allow direct simulation of rarefied gas flows in porous media based on digital rock images for the first time. The multi-level parallel approach is analyzed in details confirming its better performance than the commonly-used …
Characteristics of Oscillating Flow in a Straight Tube with varying thickness of porous layer at the wall is studied. Results for two different porous layer is discussed and compared in terms of Velocity Profile, phase differences and radial position of maximum velocity over the cross-section. Present problem is modeled using Navier-Stokes Equation in clear medium at the core of tube while Darcy-BrinkmannForcheimmer Model is used for the outer porous layer. Solutions for these equations have been obtained using Finite Volume Method based 3D unstructured solver. Velocity profile obtained for tu…
Detailed chemistry-based computational fluid dynamics (CFD) simulations are computationally expensive due to the solution of the underlying chemical kinetics system of ordinary differential equations (ODEs). Here, we introduce a novel open-source library aiming at speeding up such reactive flow simulations using OpenFOAM, an open-source C++ software for CFD. First, our dynamic load balancing model DLBFoam (Tekgül et al., 2021) is utilized to mitigate the computational imbalance due to chemistry solution in multiprocessor reactive flow simulations. Then, the individual (cell-based) chemistry so…
Computational load imbalance is a well-known performance issue in multiprocessor reacting flow simulations utilizing directly integrated chemical kinetics. We introduce an open-source dynamic load balancing model named DLBFoam to address this issue within OpenFOAM, an open-source C++ library for Computational Fluid Dynamics (CFD). Due to the commonly applied operator splitting practice in reactive flow solvers, chemistry can be treated as an independent stiff ordinary differential equation (ODE) system within each computational cell. As a result of the highly non-linear characteristics of chem…
An open-sourced multiphase Darcy-Brinkman approach is proposed to simulate two-phase flow in hybrid systems containing both solid-free regions and porous matrices. This micro-continuum model is rooted in elementary physics and volume averaging principles, where a unique set of partial differential equations is used to represent flow in both regions and scales. The crux of the proposed model is that it tends asymptotically towards the Navier-Stokes volume-of-fluid approach in solid-free regions and towards the multiphase Darcy equations in porous regions. Unlike existing multiscale multiphase s…
Pure advection of a conservative scalar is relevant to several applications including two-phase flow. Successful numerical schemes must capture the sharp interface between the phases while maintaining a smooth (wrinkle-free) interfacial contour. Among other methods, algebraic schemes that are based on the addition of an extra artificial interface compression term to the scalar transport equation have gained recent popularity (e.g., OpenFOAM; porous media). While the approach offers unique flexibilities in spatiotemporal discretizations, common numerical treatments result in the wrinkling of th…
We present a flexible scalable open-source computational framework, named SECUReFoam, based on the finite-volume library OpenFOAM(R), for flow and transport problems in highly heterogeneous geological media and other porous materials. The framework combines geostatistical pre- and post-processing tools with specialised Partial Differential Equations solvers. Random fields, for permeability and other physical properties, are generated by means of continuous or thresholded Gaussian random fields with various covariance/variogram functions. The generation process is based on an explicit spectral …
acousticHelmholtzFoam: an MPI-parallel unstructured finite-volume solver for frequency-domain acoustics in heterogeneous two-phase media with perfectly matched layers
In the context of transpiration cooling, a 1D porous medium model consisting of a temperature system and a mass-momentum system is derived from the 2D/3D Darcy-Forchheimer equations. The temperatures of the coolant and the solid are assumed to be in local nonequilibrium. This system is analytically verified to have a unique solution. Transpiration cooling simulations are performed by a two-domain approach, coupling the assembled 1D porous medium solutions with 2D solutions of a hot gas flow solver. A comparison of results obtained by applying the 1D porous medium model with the temperature sys…
We present the novel numerical model GeoChemFoam, a multiphase reactive transport solver for simulations on complex pore geometries, including microfluidic devices and micro-CT images. The geochemical model includes bulk and surface equilibrium reactions. Multiphase flow is solved using the Volume-Of-Fluid method and the transport of species is solved using the Continuous Species Transfer method. The reactive transport equations are solved using a sequential Operator Splitting method, with the transport step solved using our OpenFOAM-based Computational Fluid Dynamics toolbox, and the reaction…
Multiparticle collision dynamics (MPCD) is a relatively new algorithm of fluid flow simulations that has been applied mostly to flows around simple objects. One might ask how it behaves in more complex flows. Therefore, we extend MPCD to simulate transport in porous media. For this, a particle-level drag force is introduced into the original algorithm. The force hinders the flow, which results in global resistance to flow and decrease of permeability. The extended algorithm is validated in the flow through a porous channel and compared with an analytical solution. Some basic properties of the …
Multiphase flow in porous media occurs in several disciplines including petroleum reservoir engineering, petroleum systems' analysis, and CO$_2$ sequestration. While simulations often use a fully implicit discretization to increase the time step size, restrictions on the time step often exist due to non-convergence of the nonlinear solver (e.g. Newton's method). Here this problem is addressed for the Buckley-Leverett equations, which model incompressible, immiscible, two-phase flow with no capillary potential. The equations are recast as a gradient flow using the phase-field method, and a conv…
Derivation of macroscopic models for advection-diffusion processes in the presence of dominant heterogeneous (e.g., surface) reactions using homogenisation theory or volume averaging is often deemed unfeasible due to the strong coupling between scales that characterise such systems. In this work, we show how the upscaling can be carried out by applying and extending the methods presented in literature. The approach relies on the decomposition of the microscale concentration into a reactive component, given by the eigenfunction of the advection-diffusion operator, the associated eigenvalue whic…
Detailed understanding of the coupling between fluid flow and solid deformation in porous media is crucial for the development biomedical devices and novel energy technologies relating to a wide range of geological and biological processes. Well established models based on poroelasticity theory exist for describing coupled fluid-solid mechanics. However, these models are not adapted to describe systems with multiple fluid phases or 'hybrid-scale' systems containing both solid-free regions and porous matrices. To address this problem, we present a novel computational fluid dynamics approach bas…