Physics-constrained DeepONet for Surrogate CFD models: a curved backward-facing step case

Authors: anas  jnini
harshinee  goordoyal
sujal  dave
flavio  vella
katharine h fraser
artem  korobenko
Venue: ICLR_cc_2024_Workshop_AI4DiffEqtnsInSci
Published: 2024-02-11 01:40:14

Abstract: The Physics-Constrained DeepONet (PC-DeepONet), an architecture that incorporates fundamental physics knowledge into the data-driven DeepONet model, is presented in this study. This methodology is exemplified through surrogate modeling of fluid dynamics over a curved backward-facing step, a benchmark problem in computational fluid dynamics. The model was trained on computational fluid dynamics data generated for a range of parameterized geometries. The PC-DeepONet was able to learn the mapping from the parameters describing the geometry to the velocity and pressure fields. While the DeepONet is solely data-driven, the PC-DeepONet imposes the divergence constraint from the continuity equation onto the network. The PC-DeepONet demonstrates higher accuracy than the data-driven baseline, especially when trained on sparse data. Both models attain convergence with a small dataset of 50 samples and require only 50 iterations for convergence, highlighting the efficiency of neural operators in learning the dynamics governed by partial differential equations.

Main paper: 
 introduction: 
 Computational fluid dynamics (CFD) is commonly used for engineering design, in sectors ranging from automotive to aeronautics, biomedical engineering and energy production. CFD offers a more affordable option than experimental testing and allows for the evaluation of a wider range of designs from a fluid dynamic perspective. However, running high-accuracy simulations can be prohibitively expensive. Recently, various researchers have studied the use of data-driven and physics-informed machine learning to solve fluid dynamics problems.Data-driven methods to create CFD surrogates include fourier neural operators (1) , deep operator networks (2) and UNets (3). Lu et al. introduced the DeepONet, a deep neural operator framework, to learn linear and non-linear operators (function to function mapping) between small datasets (2). This framework is based on the universal approximation theorem for operators. Shukla et al. used DeepONets to create a surrogate for flow around airfoils which was significantly faster than traditional CFD methods . (4) .Physics-informed neural networks (PINNs), first introduced by Raissi et al. (5) , aim to solve supervised learning tasks while respecting any given law of physics described by general nonlinear partial differential equations. They can be applied to fluid dynamics problems, as flows are modeled by the incompressible Navier-Stokes equations:EQUATIONρ ∂u ∂t + ρ(u • ∇)u = -∇p + µ • ∇ 2 u + f b (2)where u is the continuum velocity, p is the pressure, µ is the dynamic viscosity and f b the resultant of the body forces (such as gravity and centrifugal forces) per unit volume acting on the continuum. PINNs have been used as surrogate models for CFD as they are able to predict flows for cases where little/no data is available (5; 6; 7). Moreover, solving the Navier-Stokes equations implies solving three sets of equations simultaneously: continuity (Eq 1), conservation of momentum (Eq 2) and boundary conditions. Several works have investigated embedding the boundary conditions or the divergence constraint imposed by the continuity equation directly by suitably modifying the network architecture, (8; 9; 10).In this paper, the use of deep operator networks (DeepONet), proposed by Lu et al. (2) , is explored to create a surrogate for predicting flow over curved backward-facing steps (BFS) with different parameterised curves.Embedding fundamental principles, like the continuity equation, directly into the structure of neural networks can enhance the efficacy of cutting-edge neural operator models by narrowing down the potential solution space for our models (8) . We propose a Physics-Constrained DeepONet (PC-DeepONet), an architecture that exactly satisfies the continuity equation (Eq 1). We show, through numerical experiments, that the proposed architecture increases the accuracy for the surrogate model, converging in only a few iterations with sparse training data.We investigate the use of PC-DeepOnets through the lens of the backward-facing step (BFS). The BFS is a benchmark model that demonstrates important features such as flow separation, vortex evolution and re-attachment (11) . The BFS has been studied by multiple researchers, especially in the fields of aerospace (12; 13; 14) and biomechanics (15; 16; 17) . The curved BFS has been chosen for this study as in addition to displaying the same flow characteristics as the BFS, its separation region is sensitive to the boundary layer near the curved wall (18) , making it suitable for learning the operator mapping between the shape of the curve and the resulting flow. Furthermore, curved surfaces are common in engineering applications, for example in aerodynamic bodies, blades, curved ducts and pipes, cylinders, and diffusers (18) . 
method: 
 In this study, a DeepONet is applied to learn the operator mapping between functions that parameterize the geometry of the BFS slopes and the flow field evaluated on the output grid. The DeepONet was chosen as it works well for learning functions between parameterised inputs and their corresponding outputs. An illustration of the geometry of choice can be found in Appendix A.1(Figure 2 ). The walls illustrated as solid lines were fixed while the curvature of the slope (dotted blue line) was varied.The slope was parameterised using non-uniform rational B-spline (NURBS) which are used as mathematical representations of curves and surfaces. Using this method, curves can be parameterised using control points, weights, knot vector and degree of polynomial. Background information on NURBS can be found in (19) . For the current study, the backward-facing curve is defined by a third degree (cubic) NURBS function with four control points, equal weights and a constant knot vector. The two control points at each end of the slope, marked as orange dots in Figure 1 , are fixed. The other two control points, marked as green dots in Figure 1 , are fixed along their respective y-axes and their x-coordinates are varied evenly between -0.25 and 1.25 to generate 50 different slope shapes. The x-coordinate of each control point is fed as one of the inputs to the network. As the y-coordinate is unchanged, there is no need to have this as an input.FreeFEM++ (20) was used to generate training data for flow over the curved BFS. FreeFEM++ uses the finite element method to solve the incompressible Navier-Stokes equations (Eq 1, 2) over the domain, by discretizing it into finite elements. For solution control, the incompressible flow solver combined a number of numerical techniques, such as an implicit scheme for time-stepping, finite element spatial discretization, and iterative solvers for managing the resulting linear systems. To ensure accurate representation of physical phenomena, stabilization techniques such as the SUPG (Streamline Upwind/Petrov-Galerkin) method ( 21), which is particularly beneficial for handling convection-dominated flows, was employed. The simulations were run for 2D unstructured meshes, each comprising approximately 50000 elements, across 50 distinct geometries. Uniform boundary conditions were applied to all simulations. The flow was modeled as incompressible, with a fixed Reynolds number of 1000.The baseline DeepONet, as proposed by Lu et al. ( 2) consists of two sub-networks: a branch network and a trunk network as illustrated in Figure 3 in Appendix A.1. The input to the branch network consists of the x-coordinates of the control point pair for each geometry configuration. Hence, the size of the input to the branch net is the number of geometries x 2. The trunk net takes as input the output sensors: the spatial coordinates of the output mesh. The size of the input to the trunk net is therefore the number of sensors x dimensions. Three separate DeepONet networks with the same architecture were trained to predict the horizontal velocity (U), vertical velocity (V) and pressure(P) fields. For the PC-DeepONet, this architecture was extended by incorporating the approach proposed by Richter et al. (8) to make the velocity field divergence free .The output of an individual DeepONet can be expressed as follows:EQUATIONWhere ϕ a collection of basis functions that map functions from spatial coordinates to output functions, and α are a collection of coefficients that learn mappings from the parametrized slope control points to the output functions. Considering the two individual DeepONet output b(x, y) as a vector field with components b u (x, y) and b v (x, y) corresponding to the velocities u and v, we have:EQUATION)With this vector field, a skew-symmetric matrix A is constructed from the Jacobian of b and its transpose:EQUATIONwhere J b is the Jacobian matrix of b with regards to the trunk input. The final divergence-free velocity field v is represented by this divergence:EQUATION)By construction, the divergence of A is zero due to the properties of the skew-symmetric matrix, ensuring that the predicted velocity field is divergence-free, which aligns with the continuity condition.Our model's implementation and optimization were conducted using the PyTorch framework. Training was executed on a dataset comprising 50 distinct geometries. For each geometry, we performed a mesh mapping to a target geometry to obtain a unique mesh using bi-cubic interpolation. 1000 output sensors were then randomly positioned across the mesh in points away from the slope to train the model. Since the mapping is done from function to function rather than from vector to vector, the model does not have to be trained on all the points in the domain and can learn the representation more efficiently with fewer sampled points. The DeepONet was then able to extrapolate for individual geometries, even in unseen domains. We illustrate this resolution-free capability of DeepONets by infering on a mesh with 50000 points, as shown in Figures 4 and 5in Appendix A.1.The optimization of the network parameters was performed using the Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) algorithm. This particular optimizer was chosen to address vanishing gradient issues that arise when training DeepONets with hyperbolic tangents (tanh). Only 50 iterations were needed to achieve convergence for both architectures. The hyperparameters used for both DeepONet models are displayed in Table 1 . To evaluate the model's performance, we used the Mean Squared Error (MSE) loss function and assessed the relative L 2 error between the predicted and actual sensor data. 
results and discussion: 
 We report the performance of the vanilla DeepONet and the PC-DeepONet models in Table 2 . The PC-DeepONet, shows superior performance in both training and validation phases.Both models were tested on unseen domains and geometries. The outputs from the trained models on a case from the validation set are displayed in Figure 4 and 5 in Appendix A.1. Both architectures achieved convergence within a limited number of iterations. The PC-DeepONet, with its enforced continuity condition, demonstrates superior accuracy with sparse data. We note that these results were obtained under conditions of smooth, laminar flow. We anticipate that for turbulent flows, the advantage of the PC-DeepONet will become more pronounced. Despite the resolution free-nature of neural operators, analysis of the Figures 4 and 5 reveals that errors cluster near boundary layers, likely due to under-sampling in the regions close to the slope, where points cannot be sampled in a common mesh. Future investigations will explore masking approaches to incorporate this information in the training and incorporating hard boundary conditions in the architecture. 
conclusion and future work: 
 In this study, we introduce PC-DeepONets, an architecture that incorporates knowledge of the physics of fluid flow into the DeepONet to improve on data-driven learning. By enforcing the divergence constraint imposed by the continuity equation in the DeepONet framework, we observe significant improvements in accuracy for surrogate modeling with sparse data. Using PC-DeepONet, we successfully learned operational mappings between parameterized geometric configurations and flow field variables (U, V, and P).Moving forward, integrating additional impositions by constraining boundaries and integrating additional information from the physics could potentially improve the performance of PC-DeepONets in capturing complex flow phenomena like turbulence for higher Reynolds numbers.  
 
 Appendix:  


Decision: The reviewer marks this as a clear accept and I agree. I encourage the authors to clarify the motivation of the physics constraints in the basis in the camera-ready version.

Reviews: review: title: title: A novel approach for using DeepONets with a convincing application
main_review: main_review: The paper is well motivated and showcases a convincing application of its proposed novel approach. It does lack a bit in terms of the details of the method, it would have been useful to get a deeper understanding of the way the physics constrained are introduced into the basis.