← All projects

Scientific Machine Learning

3D PINN for Pipe Flow

A physics-informed neural network for the 3D Navier–Stokes equations in a pipe, with exact wall and outlet conditions, written from scratch in NumPy with its own automatic differentiation.

Course
Fluid Mechanics I
Term
Spring 2025
Team
Individual project
Tools
  • Python
  • NumPy
  • SciPy

Overview

Can a PINN recover the development of laminar flow in a pipe from the governing equations alone, and how close does it get to the exact fully developed solution?

Approach

  1. Inputs (r cos θ, r sin θ, z), so every field is periodic in θ and regular on the axis; residuals in Cartesian form.
  2. No-slip and outlet-pressure conditions imposed exactly by distance functions; a blunt inlet profile that is compatible with the wall.
  3. Re = 10, chosen so that the flow develops inside the pipe and a valid exact reference exists.
  4. 4 × 50 tanh network; 3000 Adam iterations, then four L-BFGS rounds on resampled points.

Results

Hagen–Poiseuille, centreline velocity at z = 42.002 vs 2 (0.10 %)
Hagen–Poiseuille, pressure gradient−1.6026 vs −1.6 (0.16 %)
Friction coefficient vs 16/Re1.6032 vs 1.6 (0.20 %)
Mass conservation along the pipeQ/(πR²U) between 0.9992 and 1.0016
Entrance length vs Durst et al. (2005)1.75 vs 1.83 (4.6 %)
GeometryR = 1, L = 5
Reynolds number10
Network4 hidden layers × 50 neurons, tanh
Training≈ 40 min on two CPU cores
Residual RMS, z > 20.0052

From the report

Axial-velocity profiles at four stations against the Poiseuille profile.
Axial-velocity profiles at four stations against the Poiseuille profile.
Wall friction coefficient along the pipe, approaching 16/Re.
Wall friction coefficient along the pipe, approaching 16/Re.
Centreline pressure against the fully developed solution.
Centreline pressure against the fully developed solution.