An interactive, lightweight 2D Potential Flow and Pressure Field solver built purely in native MATLAB OOP.
Modeling fluid mechanics via the full Navier-Stokes equations from scratch often results in numerical explosion due to non-linear convective acceleration terms. This application solves the fundamental Pressure-Poisson Equation (
By calculating the steady-state pressure field across a user-defined grid, the simulation recovers the 2D velocity vector field via momentum gradient descent.
We solve the 2D Poisson equation for pressure
Where the synthetic source term driving the flow is defined as:
Using second-order central finite differences over step sizes
Velocity vectors
- Dual Numerical Engines: Switch instantly between a Direct Solver (LU Decomposition) and an Iterative Solver (Gauss-Seidel) to observe trade-offs in memory vs. convergence speed.
-
Asymptotic Sparse Assembly: The coefficient matrix
$A$ is pre-allocated as a MATLABsparse()data type. This allows the app to solve thousands of simultaneous equations instantly without triggering MATLAB memory limits. -
Strictly Bound Dirichlet Walls: Outer boundary nodes are locked to
$P = 0$ , guaranteeing a well-posed matrix that cannot become singular. - Zero Dependencies: Written entirely in Vanilla MATLAB. Requires no extra Toolboxes (e.g., no PDE Toolbox or CFD Toolbox needed).
-
Clone this repository or download
FluidFlowSimulatorApp.m. -
Open MATLAB and navigate to the directory containing the file.
-
In the MATLAB Command Window, instantiate the application:
FluidFlowSimulatorApp
| Name | GitHub |
|---|---|
| Prakhar Gupta | @PrakharG8651 |
| Arun Chauhan | @Arun-Chauhan-24 |
| Prince Meena | @xenoz27 |
| Aman Agrawal | @Amanag185 |
| Aadi Chhajed | @Aadi-Chhajed |
| Rajinder Kumar | @raman9728152450 |
| Abhishek Parth | @Abhishek-Parth |
| Ankit Kumar Saini | @ankitkumar971 |
