Physical-Informed Neural Networks (PINNs) for Solving Shape Optimization Problems ()
1. Introduction
Shape optimization for the fluid flows is widely interested in the optimum designs [1]-[4]. To obtain minimum drag wing profiles [5] or minimum pressure drop diffusers [6], when striving for a decreased drag or pressure drop, the feasible design modifications have concerned adjusting selected parts of the boundary to the fluid region. Borrvall and Petersson [7] optimized the dissipated power of the stokes flow. Allaire et al. [8] minimized the compliance of elastic structure.
Let
and
be the velocity and pressure of the incompressible flow which is governed by the incompressible Navier-Stokes equations in a domain
. To obtain optimal shape in
, the purpose is to find an optimal shape
in certain admissible shape set
, satisfying
(1)
where
is constantly referred to as objective functional or cost functional. A typical choice of
used in this context is the total potential energy, which is given by
[4], which is used to represent the shear stress and influences the damage of fluid flows on the optimized shape surface [9]. In the framework of the model, the incompressible Navier-Stokes equations for the absence of body fluid forces is
(2)
where the parameter
is the viscosity of the fluid. The inflow boundary
and outflow boundary
are fixed during the optimization, where inflow velocity
is specified. The no-slip or free-slip boundary
is the concerned part for an optimized shape.
There are many numerical methods for solving the shape optimization problem Equations (1), (2). Among those methods, the phase-field method is an outstanding approach for various free boundary problems [10] [11], topology optimization for elastic structure [12] [13], and photonic devices [14] [15]. The phase field method stands out in its treatment of the interface as a physically diffuse thin layer. The interface is sharp conceptually but regularized numerically by a continuous function between zero and one. Due to the generation of the interface, mixing energy is introduced to govern the dynamics of the diffusive interface. Wallin [13] and Garcke [4] use the Ginzburg-Landau energy as the mixing energy over the interfacial layer, but the mixing energy can be dated back to Van Der Waals energy
.
Neural networks are mathematical approximations that have been effectively applied in various fields, including speech recognition and classification tasks [16]-[18]. Neural networks have been applied to multiple scientific problems, such as turbulence model design from data [19] and for simulating heat transfer problems [20]. Among the methods that use deep learning for scientific computing, Physics-Informed Neural Networks (PINNs) [21] is a popular approach for simulating physical problems. Leverage all the information available about the problem, such as the underlying PDEs, boundary conditions, physical properties, and known measurement data, to train a neural network that best approximates the model. These networks transform boundary-value problems into optimization problems, providing flexibility to include any constraint in the problem. PINNs have been applied to a variety of forward, inverse, and parameterized problems [20] [22] [23], including fluid dynamics problems.
The remainder of this paper is organized as follows. In the next section, we introduce the phase-field model and its shape sensitivity analysis. The architecture of the PINNs and the loss functions used in training are presented in Section 3. We present the experimental results in Section 4. Finally, we provide the conclusions in Section 5.
2. Phase-Field Model for Fluid Shape Optimization
The fundamental idea of the phase-field model is to assume that the interface is a diffusive thin layer, as shown in the figure of Figure 1. We define the phase-field function
over the whole design domain
to regularize numerically the sharp conceptually, which consists of three different parts of Figure 1: the material domain
with
, the void domain
with
, and a fictitious diffused interface
with
.
![]()
Figure 1. The shape optimization domain D.
In the framework of the phase-field method, Equation (2) should be extended to the design domain
. The basic idea of a porous medium approach [4] [7] [9] is to add the term
to Equation (2), then Equation (2) ‘interpolate’ between the steady-state Navier?Stokes equations where
and a virtual Darcy flows through a porous medium where
. Thus we get
(3)
where the parameter
penalizes the phase field. The boundary of
is also extended into three parts:
, where homogeneous boundary conditions are supposed for the fluid flow. The inflow boundary
and the outflow boundary
are fixed during the optimization.
To ensure that the velocity vanishes in the void domain
, an additional penalization term [4] is added to the objective function (1). Thus, the new objective function is rewritten as
(4)
The phase-field model for fluid shape optimization is to find a
to minimize the Van Der Waals free energy, given by
(5)
with the constraints of state Equation (3). the
characters are the width of the diffusive thin layer and
is responsible for the moving direction of interfaces. Following the suggestion of Takezawa in [12], it is
(6)
where
and
are two sets of basis functions. To fulfill the movement of the interface with a diffusive thin layer in the direction indicated by
,
and
,
are the necessary conditions.
Authors presented a new objective function (4) in reference [24], Then the adjoint equation of (3) is rewritten as follows
(7)
where
and
are the adjoint functions.
is the unit outward normal vector. The shape sensitivity of the objective function is given as follows
(8)
The gradient flow method
is used to find the minimum of the Equations (4) and (5). From this, it can be obtained the phase-field equation
(9)
Moreover, we can simplify the model in the steady state. In this paper, we consider the problem with steady state, i.e.
. So we can get the phase-field model for fluid shape optimization as follows: Find
satisfies
(10)
and boundary conditions
(11)
3. Numerical Methods
In this section, we present the numerical method for solving the shape optimization problem (10), (11). To gain a better understanding of neural networks, we consider a simple example of a one-layer neural network. If
is the input vector and
is the output vector to have dimensions
and
, respectively, the output can be expressed as
(12)
where
is a weight matrix of dimension
and
is a bias vector of dimension
. The activation function
is user-defined and can take various forms, such as a cosine or a hyperbolic tangent. This function is applied to each component of a vector
. By stacking multiple layers, we can establish a feedforward neural network as illustrated in Figure 2. The output of the network is then expressed as
(13)
where
and
represent the number of layers and all the parameters of the neural network, respectively. One can build a more complex neural network by changing the connections between the layers.
Denoted the differential operator about PDEs in regions
and
by
and
, the phase-field model can be expressed as
(14)
Once the problem has been described, the next step core is using a formulation of the physics-informed loss function to determine the optimal values for the parameter
. The loss function
, constructed by evaluating the residuals about the governing PDEs
and boundary conditions
, quantifies the network’s deviation from the physical laws encapsulated by the governing differential equations and are defined as follows
(15)
The aggregated loss function for the PINNs, combining these residuals, is given by
(16)
where
denote the number of collocation points in
and on
. And
is the discrete
norm. With the PINNs, we approximate the solution of the shape optimization problem using a feedforward neural network.
While various optimization methods could address this minimization problem, in the context of this work, we will only consider gradient-based optimization methods. Gradient-based methods leverage the property that the gradient of a function points in the direction of the function’s steepest. To minimize the function, one would generally move in the direction opposite to the gradient, with a step size proportional to a user-defined learning rate. Popular gradient-based methods include the Stochastic Gradient Descent (SGD), the Limited-memory Broyden-Fletcher-Goldfarb-Shanno method(L-BFGS) [25], and the Adaptive Moment Estimation method (Adam) [26]. The gradient is calculated using the back-propagation algorithm, which employs the chain rule and automatic differentiation to compute the partial derivatives of the output concerning the weights, the biases, and the network’s input.
Since the problem includes integral terms, we incorporate Gaussian integration in the training of PINNs to approximate the calculation of shape sensitivity (8). During the training process, we implement hard boundary conditions in the PINNs’ boundary conditions. This can prevent excessive void domain where
from causing trivial numerical solutions. The training flow chart of PINNs is shown in the following Figure 3.
4. Numerical Results
In this section, we first present an accuracy test of the algorithm by comparing the numerical results obtained from the PINNs with the exact solution. Our numerical algorithm exhibits excellent convergence properties for models with known exact solutions. Next, we conduct numerical simulations for practical problems, presenting the optimized forms of the pipeline under different boundary conditions.
4.1. Accuracy Test
In the two-dimensional shape optimization domain
, we take the following exact solution
(17)
This will be used to evaluate the accuracy and convergence behavior of the shape optimization problem. To enhance the training effectiveness, we will randomly select 81 points within
to construct the loss functions for
and
, which will be incorporated into the experimental model:
(18)
Substituting the numerical solution (17) into the model, we obtain the residual of the right-hand side term of the corresponding equation and set the parameters:
,
,
,
. We selected 2601 training points and 10,000 Gaussian points in
and solved the experimental results using PINNs with four layers, each containing fifty neurons. The Adam and L-BFGS optimizers will be used for 10,000 and 700,000 iterations, respectively, with a learning rate of
.
Figure 4(a) and Figure 4(b) are exact solution images, and Figure 4(c) and Figure 4(d) are numerical solution images. By observing the error images in Figure 4(e), Figure 4(f), and the loss value images in Figure 5, we can see that the numerical solutions converge to the exact solution with high accuracy.
![]()
(a) The exact solution for
(b) The exact solution for
![]()
(c)The numerical solution for
(d) The numerical solution for
![]()
(e) The error for
(f) The error for
Figure 4. The result of the accuracy test.
![]()
Figure 5. The loss value images of the PINNs.
4.2. The Shape Optimization Problem for Pipes
Now, we consider the design of a bend, and the purpose of designing work is to find an optimized connection between the inlet and outlet [27]. The domain is shown in Figure 6(a). Set the parameters:
,
,
,
. We selected 2601 training points and 10,000 Gaussian points in
and solved the experimental results using a PINN with four layers, each containing fifty neurons. The Adam and L-BFGS optimizers will be used for 10,000 and 200,000 iterations, respectively, with a learning rate of
. To avoid converging to a trivial solution, boundary conditions are handled as hard boundaries.
We find that the shape and loss in Figure 6(b), Figure 6(c) are in the same direction as those reported in the literature (see [27] and references therein) and exhibit excellent convergence performance.
(a) Pipe domain![]()
(b) Pipe numerical result (c) Pipe numerical loss
Figure 6. The pipe experiment.
As shown in Figure 7(a), we set the inlet to be twice that of the pipe experiment and conducted another expansion experiment for prediction. Set the parameters:
,
,
,
. We select 2601 training points and 10,000 Gaussian points and use PINNs with four layers, each containing fifty neurons. The Adam and L-BFGS optimizers will be used for 10,000 and 200,000 iterations, respectively, with a learning rate of
. To avoid converging to a trivial solution, boundary conditions are handled as hard boundaries. Figure 7(b) and Figure 7(c) present our results, showing that the model exhibits excellent convergence.
(a) Expansion domain![]()
(b) Expansion numerical result (c) Expansion numerical loss
Figure 7. The expansion experiment.
5. Conclusion
In this paper, we use PINNs with hard boundary conditions to solve the phase-field model for fluid shape optimization. The accuracy test and the pipe experiment show that the established phase-field model aligns well with results from the literature, and the convergence achieved is also accurate. Moreover, we provide the expansion experiment result, demonstrating that using PINNs with hard boundaries to solve the phase-field model is effective and feasible for fluid shape optimization problems.
Funding
This work was supported by the NSF of China (Grant No. 11901100) and the Natural Science Foundation of Fujian Province of China (Grant No. 2020J05111).