# Applying Physics-Informed Neural Networks to Solve Navier–Stokes Equations for Laminar Flow around a Particle

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Methods

#### 2.1. Navier–Stokes Equations

#### 2.2. Automatic Differentiation

#### 2.3. PINNs Framework

_{NS}in Equation (5), which represents the aggregate of residuals across all training points in the computational domain.

_{NS}is the loss function of Navier–Stokes equations. R

_{mass}, R

_{x-mom}, and R

_{y-mom}are the residuals of Equations (1)–(3), respectively (mass conservation, x-momentum, and y-momentum equations). N

_{p}is the total number of training points in the fluid domain. The residual is calculated as the l

_{2}norm of each equation, as expressed in Equation (6).

_{NS}is minimized (ideally to zero), each predicted solution at every individual point within the fluid domain complies with the governing equations. Consequently, the predicted values of u, v, and p are one possible set within an infinite array of solutions to the PDE.

_{pI}, N

_{pO}, and N

_{pW}are the number of boundary points on the inlet, outlet, and wall. R

_{inlet}, R

_{outlet}, and R

_{wall}are the residuals of inlet, outlet, and wall boundary conditions. The total loss function J

_{total}is the summation of both Navier–Stokes loss and the boundary conditions loss, as shown in Equation (8):

#### 2.4. Investigated Domain

^{3}across all cases, while the dynamic viscosity is set at 0.2, 0.05, and 0.02 Pa·s, respectively. The viscous heat is neglected in this study.

#### 2.5. Drag Force Coefficient

_{d}is defined as Equation (11):

_{d}represents the drag force applied to the particle in the streamwise direction, which, in this instance, corresponds to the x-direction. The drag force consists of two components in the low-Re flow regime, namely pressure-driven drag force and viscous drag force, as graphically depicted in Figure 4, where r is the radius of the circular particle and $\overrightarrow{n}$ is the unit normal vector of the particle. In conventional CFD using Finite Volume Method, the fluid-solid interaction force can be easily obtained by calculating the total force exerted on all surrounding fluid grids adjacent to the particle wall, as shown in Equation (12):

_{cell}is the volume of each grid adjacent to the particle wall. However, due to the nature of the PINNs, which utilize a point-based system, this methodology cannot be applied as there is no fluid grid volume. As a result, the drag force is determined by numerically integrating the pressure p and the stress tensor τ on the surface of the particle.

**Pressure drag force**

**Viscous drag force**

#### 2.6. CFD Validation

^{−5}. The CFD simulation is performed on an Intel i9-10940X at 3.3 Ghz.

## 3. Results

^{−7}, around 140,000 iterations.

## 4. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Iskhakov, A.S.; Dinh, N.T. Physics-integrated machine learning: Embedding a neural network in the Navier-Stokes equations. Part I. arXiv
**2020**, arXiv:2008.10509. [Google Scholar] - Karniadakis, G.E.; Kevrekidis, I.G.; Lu, L.; Perdikaris, P.; Wang, S.; Yang, L. Physics-informed machine learning. Nat. Rev. Phys.
**2021**, 3, 422–440. [Google Scholar] [CrossRef] - Raissi, M.; Karniadakis, G.E. Hidden physics models: Machine learning of nonlinear partial differential equations. J. Comput. Phys.
**2018**, 357, 125–141. [Google Scholar] [CrossRef] - Qian, E.; Kramer, B.; Peherstorfer, B.; Willcox, K. Lift & learn: Physics-informed machine learning for large-scale nonlinear dynamical systems. Phys. D
**2020**, 406, 132401. [Google Scholar] - Wu, J.-L.; Xiao, H.; Paterson, E. Physics-informed machine learning approach for augmenting turbulence models: A comprehensive framework. Phys. Rev. Fluids
**2018**, 3, 74602. [Google Scholar] [CrossRef] - Kashinath, K.; Mustafa, M.; Albert, A.; Wu, J.L.; Jiang, C.; Esmaeilzadeh, S.; Azizzadenesheli, K.; Wang, R.; Chattopadhyay, A.; Singh, A.; et al. Physics-informed machine learning: Case studies for weather and climate modelling. Philos. Trans. R. Soc. A
**2021**, 379, 20200093. [Google Scholar] [CrossRef] [PubMed] - Wang, J.-X.; Wu, J.; Ling, J.; Iaccarino, G.; Xiao, H. A comprehensive physics-informed machine learning framework for predictive turbulence modeling. arXiv
**2017**, arXiv:1701.07102. [Google Scholar] - Wang, J.-X.; Wu, J.-L.; Xiao, H. Physics-informed machine learning approach for reconstructing Reynolds stress modeling discrepancies based on DNS data. Phys. Rev. Fluids
**2017**, 2, 34603. [Google Scholar] [CrossRef] - Karimpouli, S.; Tahmasebi, P. Physics informed machine learning: Seismic wave equation. Geosci. Front.
**2020**, 11, 1993–2001. [Google Scholar] [CrossRef] - Fuks, O.; Tchelepi, H.A. Limitations of physics informed machine learning for nonlinear two-phase transport in porous media. J. Mach. Learn. Model. Comput.
**2020**, 1, 19–37. [Google Scholar] [CrossRef] - Sun, L.; Gao, H.; Pan, S.; Wang, J.-X. Surrogate modeling for fluid flows based on physics-constrained deep learning without simulation data. Comput. Methods Appl. Mech. Eng.
**2020**, 361, 112732. [Google Scholar] [CrossRef] - Jin, X.; Cai, S.; Li, H.; Karniadakis, G.E. NSFnets (Navier-Stokes flow nets): Physics-informed neural networks for the incompressible Navier-Stokes equations. J. Comput. Phys.
**2021**, 426, 109951. [Google Scholar] [CrossRef] - Rao, C.; Sun, H.; Liu, Y. Physics-informed deep learning for incompressible laminar flows. Theor. Appl. Mech. Lett.
**2020**, 10, 207–212. [Google Scholar] [CrossRef] - Gao, H.; Sun, L.; Wang, J.-X. PhyGeoNet: Physics-informed geometry-adaptive convolutional neural networks for solving parameterized steady-state PDEs on irregular domain. J. Comput. Phys.
**2021**, 428, 110079. [Google Scholar] [CrossRef] - Ranade, R.; Hill, C.; Pathak, J. DiscretizationNet: A machine-learning based solver for Navier–Stokes equations using finite volume discretization. Comput. Methods Appl. Mech. Eng.
**2021**, 378, 113722. [Google Scholar] [CrossRef] - Baydin, A.G.; Pearlmutter, B.A.; Radul, A.A.; Siskind, J.M. Automatic differentiation in machine learning: A survey. J. Marchine Learn. Res.
**2018**, 18, 1–43. [Google Scholar] - Verma, A. An introduction to automatic differentiation. Curr. Sci.
**2000**, 78, 804–807. [Google Scholar] - Kingma, D.P.; Ba, J. Adam: A method for stochastic optimization. arXiv
**2014**, arXiv:1412.6980. [Google Scholar] - Zhu, C.; Byrd, R.H.; Lu, P.; Nocedal, J. Algorithm 778: L-BFGS-B: Fortran subroutines for large-scale bound-constrained optimization. ACM Trans. Math. Softw. (TOMS)
**1997**, 23, 550–560. [Google Scholar] [CrossRef]

**Figure 3.**Sample points in the domain. Red points are the inlet, green points are the wall, blue points are the interior points, and yellow points are the outlet.

**Figure 6.**Result comparisons of CFD and PINNs of flow passing around a 2D circular particle at Re = 5. (

**a1**) Velocity contour of CFD at Re = 5; (

**a2**) velocity contour of PINNs at Re = 5; (

**b1**) pressure contour of CFD at Re = 5; (

**b2**) pressure contour of PINNs at Re = 5; (

**c1**) velocity vectors of CFD at Re = 5; (

**c2**) velocity vectors of PINNs at Re = 5.

**Figure 7.**Result comparisons of CFD and PINNs of flow passing around a 2D circular particle at Re = 20. (

**a1**) Velocity contour of CFD at Re = 20; (

**a2**) velocity contour of PINNs at Re = 20; (

**b1**) pressure contour of CFD at Re = 20; (

**b2**) pressure contour of PINNs at Re = 20; (

**c1**) velocity vectors of CFD at Re = 20; (

**c2**) velocity vectors of PINNs at Re = 20.

**Figure 8.**Result comparisons of CFD and PINNs of flow passing around a 2D circular particle at Re = 50. (

**a1**) Velocity contour of CFD at Re = 50; (

**a2**) velocity contour of PINNs at Re = 50; (

**b1**) pressure contour of CFD at Re = 50; (

**b2**) pressure contour of PINNs at Re = 50; (

**c1**) velocity vectors of CFD at Re = 50; (

**c2**) velocity vectors of PINNs at Re = 50.

**Figure 9.**Result comparisons of CFD and PINNs of flow passing around a 2D elliptical particle at Re = 20. (

**a1**) Velocity contour of CFD; (

**a2**) velocity contour of PINNs; (

**b1**) pressure contour of CFD; (

**b2**) pressure contour of PINNs; (

**c1**) velocity vectors of CFD; (

**c2**) velocity vectors of PINNs.

Viscous Drag Coeff. | Pressure Drag Coeff. | Total Drag Coeff. | ||||
---|---|---|---|---|---|---|

CFD | PINNs | CFD | PINNs | CFD | PINNs | |

Re = 5 | 3.78 | 3.34 | 5.09 | 5.53 | 8.87 | 8.87 |

Re = 20 | 1.19 | 1.06 | 1.92 | 1.86 | 3.12 | 2.92 |

Re = 50 | 0.61 | 0.55 | 1.32 | 1.28 | 1.94 | 1.83 |

Hardware | CFD | PINNs |
---|---|---|

Intel i9-10940X 3.3 Ghz (CPU) | 2 min | 16 h |

Nvidia Tesla P100-16 GB (GPU) | / | 1.5 h |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Hu, B.; McDaniel, D.
Applying Physics-Informed Neural Networks to Solve Navier–Stokes Equations for Laminar Flow around a Particle. *Math. Comput. Appl.* **2023**, *28*, 102.
https://doi.org/10.3390/mca28050102

**AMA Style**

Hu B, McDaniel D.
Applying Physics-Informed Neural Networks to Solve Navier–Stokes Equations for Laminar Flow around a Particle. *Mathematical and Computational Applications*. 2023; 28(5):102.
https://doi.org/10.3390/mca28050102

**Chicago/Turabian Style**

Hu, Beichao, and Dwayne McDaniel.
2023. "Applying Physics-Informed Neural Networks to Solve Navier–Stokes Equations for Laminar Flow around a Particle" *Mathematical and Computational Applications* 28, no. 5: 102.
https://doi.org/10.3390/mca28050102