This paper investigates a numerical code-coupling technique to tackle multiphysics and multiscale simulations using state-of-the-art software packages that typically address some specific modeling domain. The coupling considers the in-house FEM code FEMuS and the FVM code OpenFOAM by exploiting the MED library from the SALOME platform. The present approach is tested on a buoyancy-driven fluid flow within a square cavity, where the buoyancy force constitutes the coupling term. In uncoupled scenarios, momentum and temperature equations are solved in both FEM and FVM codes without data exchange. In the coupled setting, only the OpenFOAM velocity and the FEMuS temperature fields are solved separately and shared at each time step (or vice versa). The MED library handles the coupling with ad hoc data structures that perform the field transfer between codes. Different Rayleigh numbers are investigated, comparing the outcomes of coupled and uncoupled cases with the reference literature results. Additionally, a boundary data transfer application is presented to extend the capabilities of the coupling algorithm to coupled applications with separate domains. In this problem, the two domains share interfaces and boundary values on specific fields as fluxes are exchanged between the two numerical codes.
The volume of fluid (VOF) method is a popular technique for the direct numerical simulations of flows involving immiscible fluids. A discrete volume fraction field evolving in time represents the interface, in particular, to compute its geometric properties. The height function method (HF) is based on the volume fraction field, and its estimate of the interface curvature converges with second-order accuracy with grid refinement. Data-driven methods have been recently proposed as an alternative to computing the curvature, with particular consideration for a well-balanced input data set generation and symmetry preservation. In the present work, a two-layer feed-forward neural network is trained on an input data set generated from the height function data instead of the volume fraction field. The symmetries for rotations and reflections and the anti-symmetry for phase swapping have been considered to reduce the number of input parameters. The neural network can efficiently predict the local interface curvature by establishing a correlation between curvature and height function values. We compare the trained neural network to the standard height function method to assess its performance and robustness. However, it is worth noting that while the height function method scales perfectly with a quadratic slope, the machine learning prediction does not.
The volume of fluid (VOF) method is a popular technique for the direct numerical simulations of flows involving immiscible fluids. A discrete volume fraction field evolving in time represents the interface, in particular, to compute its geometric properties. The height function method (HF) is based on the volume fraction field, and its estimate of the interface curvature converges with second-order accuracy with grid refinement. Data-driven methods have been recently proposed as an alternative to computing the curvature, with particular consideration for a well-balanced input data set generation and symmetry preservation. In the present work, a two-layer feed-forward neural network is trained on an input data set generated from the height function data instead of the volume fraction field. The symmetries for rotations, reflections, and the anti-symmetry for the phase swapping have been considered to reduce the number of input parameters. The neural network, establishing a correlation between curvature and height function values, can efficiently predict the local interface curvature. We compare the trained neural network to the standard Height Function method to assess its performance and robustness.
In this paper, the optimal control theory is applied to a temperature optimization problem by coupling finite element and finite volume codes. The optimality system is split into the state and adjoint system. The direct problem is solved by the widely adopted finite volume OpenFOAM code and the adjoint-control equation using a variational formulation of the problem with the in-house finite element FEMuS code. The variational formulation of the problem is the natural framework for accurately capturing the control correction while OpenFOAM guarantees the accuracy of the state solution. This coupling is facilitated through the open-source MED and MEDCoupling libraries of the SALOME platform. The code coupling is implemented with the MED libraries and additional routines added in the FEMuS and OpenFOAM codes. We demonstrate the accuracy, robustness, and performance of the proposed approach with examples targeting different objectives using distributed and boundary controls in each case.
In this work, we present a numerical approach for solving optimal control problems for fluid heat transfer applications with a mixed optimality system: an FEM code to solve the adjoint solution over a precise restricted admissible solution set and an open-source well-known code for solving the state problem defined over a different one. In this way, we are able to decouple the optimality system and use well-established and validated numerical tools for the physical modeling. Specifically, two different CFD codes, OpenFOAM (finite volume-based) and FEMuS (finite element-based), have been used to solve the optimality system, while the data transfer between them is managed by the external library MEDCOUPLING. The state equations are solved in the finite volume code, while the adjoint and the control are solved in the finite element code. Two examples taken from the literature are implemented in order to validate the numerical algorithm: the first one considers a natural convection cavity resulting from a Rayleigh–Bénard configuration, and the second one is a conjugate heat transfer problem between a fluid and a solid region.
This paper investigates a numerical code coupling technique to tackle multi-physics and multi-scale simulations using state-of-the-art software packages that typically address some specific modeling domain. The coupling considers the in-house FEM code, FEMuS, and the FVM code OpenFOAM, by exploiting the MED library from the SALOME platform. The present approach is tested on a buoyancy-driven fluid flow within a square cavity, where the buoyancy force constitutes the coupling term. In uncoupled scenarios, momentum and temperature equations are solved both in FEM and FVM codes without data exchange. In the coupled setting, only the OpenFOAM velocity and the FEMuS temperature fields are solved separately and shared at each time step (or vice versa). The MED library handles the coupling with the addition of suitable ad-hoc data structures that perform the field transfer between codes. Different Rayleigh numbers are investigated, comparing the outcomes of coupled and uncoupled cases with reference literature results. Additionally, a boundary data transfer application is presented to extend the capabilities of the coupling algorithm to coupled applications with separate domains. In this problem, the two domains share interfaces and boundary values on specific fields as fluxes are exchanged between the two numerical codes.