YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Baseline Model for Solving Partial Differential Equations Using Deep Learning Overview
Physics-Informed Neural Networks (PINNs) have emerged as a promising Scientific Machine Learning (SciML) approach for solving partial differential equations without relying solely on traditional numerical discretization techniques. By embedding governing physical laws into the neural network training process, PINNs enable the direct approximation of continuous solution fields while satisfying the underlying conservation laws.
This notebook presents a baseline implementation of a PINN for Computational Fluid Dynamics (CFD). The objective is to establish a reproducible and extensible framework for solving fluid flow problems governed by the Navier–Stokes equations. The implementation is designed to serve as a foundation for future research in scientific machine learning, inverse problems, turbulence modeling, and neural operator methods.
Objectives
The objectives of this notebook are to:
Develop a baseline Physics-Informed Neural Network for CFD applications. Solve governing partial differential equations using automatic differentiation. Enforce physical constraints through governing equations, boundary conditions, and initial conditions. Demonstrate mesh-free approximation of velocity and pressure fields. Provide a reproducible benchmark implementation for future improvements and comparative studies. Background
Traditional Computational Fluid Dynamics relies on numerical discretization methods such as the Finite Difference Method (FDM), Finite Volume Method (FVM), and Finite Element Method (FEM). These methods require mesh generation, numerical solvers, and substantial computational resources, particularly for complex geometries or high-resolution simulations.
Physics-Informed Neural Networks offer an alternative paradigm in which the governing equations themselves become part of the optimization objective. Rather than learning solely from labeled datasets, the neural network minimizes the residuals of the governing equations while simultaneously satisfying prescribed boundary and initial conditions. This enables the model to produce physically consistent solutions even when limited observational data are available.
Problem Description
This notebook focuses on solving a benchmark incompressible fluid flow problem governed by the Navier–Stokes equations.
The neural network approximates a mapping from spatial and temporal coordinates to the corresponding flow variables, including the horizontal velocity, vertical velocity, and pressure.
The solution is obtained by minimizing a physics-informed loss function that combines the residuals of the governing equations with the errors associated with the imposed boundary and initial conditions.
Governing Physics
The governing equations consist of:
Conservation of mass (continuity equation) Conservation of momentum in the horizontal direction Conservation of momentum in the vertical direction
These equations ensure that the predicted solution satisfies the physical principles governing incompressible fluid flow.
Physics-Informed Learning
Unlike conventional supervised learning, PINNs do not require large labeled datasets generated from numerical simulations or experiments.
Instead, training relies on three categories of sample points:
Interior collocation points, where the governing equations are enforced. Boundary points, where prescribed boundary conditions are imposed. Initial condition points, where the initial flow state is specified.
The neural network is optimized so that all physical constraints are simultaneously satisfied throughout the computational domain.
Model Architecture
The baseline implementation uses a fully connected feed-forward neural network.
The network accepts spatial and temporal coordinates as input and predicts the corresponding flow variables. Multiple hidden layers with nonlinear activation functions enable the model to approximate complex solution manifolds while maintaining differentiability required for automatic differentiation.
The network parameters are optimized using gradient-based optimization techniques.
Loss Function
The training objective consists of three primary components:
Physics loss, representing the residuals of the governing partial differential equations. Boundary condition loss, ensuring compliance with prescribed boundary constraints. Initial condition loss, enforcing the initial state of the flow field.
The total loss is obtained by minimizing the weighted combination of these components throughout the training process.
Automatic Differentiation
Automatic differentiation is a key component of Physics-Informed Neural Networks.
Instead of approximating spatial and temporal derivatives numerically, derivatives are computed directly through the computational graph using backpropagation. This provides highly accurate gradient calculations while eliminating truncation errors associated with finite-difference approximations.
Automatic differentiation enables efficient computation of first-order and higher-order derivatives required by the governing equations.
Training Procedure
The training process consists of the following steps:
Generate interior, boundary, and initial condition sample points. Predict the flow variables using the neural network. Compute the residuals of the governing equations through automatic differentiation. Evaluate boundary and initial condition errors. Combine all loss components into a single optimization objective. Update the network parameters using gradient-based optimization. Repeat the process until convergence. Evaluation
The quality of the learned solution can be assessed using several quantitative metrics, including:
Physics residual loss Boundary condition loss Initial condition loss Relative L2 error Mean Absolute Error (MAE) Root Mean Square Error (RMSE)
When analytical or high-fidelity numerical solutions are available, these metrics provide an objective assessment of prediction accuracy.
Expected Outcomes
Upon successful training, the model is expected to:
Learn smooth and physically consistent velocity fields. Predict pressure distributions satisfying the governing equations. Preserve incompressibility throughout the computational domain. Produce low PDE residuals. Demonstrate stable convergence during optimization.
This implementation serves as a reliable baseline for benchmarking future PINN architectures and advanced Scientific Machine Learning methods.
Future Extensions
The baseline framework can be extended in several directions, including:
Adaptive collocation point sampling Residual-based adaptive refinement Extended Physics-Informed Neural Networks (XPINNs) Variational PINNs (VPINNs) Fourier Feature Networks Fourier Neural Operators DeepONets Domain decomposition techniques Hybrid PINN–Lattice Boltzmann frameworks Reynolds-Averaged Navier–Stokes (RANS) modeling Large Eddy Simulation (LES) Turbulence closure modeling Multi-GPU distributed training Mixed-precision optimization References Raissi, M., Perdikaris, P., & Karniadakis, G. E. (2019). Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics, 378, 686–707. Karniadakis, G. E., Lu, L., Perdikaris, P., Wang, S., & Yang, L. (2021). Physics-informed machine learning. Nature Reviews Physics, 3(6), 422–440. Cuomo, S., Di Cola, V. S., Giampaolo, F., Rozza, G., Raissi, M., & Piccialli, F. (2022). Scientific Machine Learning through Physics-Informed Neural Networks: Where We Are and What's Next. Journal of Scientific Computing. Wang, S., Sankaran, S., & Perdikaris, P. (2023). An Expert's Guide to Training Physics-Informed Neural Networks. Acknowledgements
This notebook is intended as a baseline implementation for researchers, students, and practitioners interested in Computational Fluid Dynamics and Scientific Machine Learning. It provides a reproducible starting point for developing more advanced PINN architectures and exploring physics-informed approaches for solving increasingly complex fluid dynamics problems.