This project is a computational fluid dynamics (CFD) solver written in Rust and post-processed with matplotlib, using the SIMPLE algorithm with a collocated grid to integrate the 2D incompressible steady Navier-Stokes equations. This project is based on the lectures by Dr. Sandip Mazumder. It can solve three cases: the lid-driven cavity flow, the pipe flow with a velocity inlet/gauge pressure outlet, and the backward facing step flow.
To run this project, you need to have Rust, Python 3 and matplotlib installed on your system. To run the solver for a specific case, use the following command:
cargo run --release -- -c <case>
where <case>
can be one of lid_driven_cavity
, pipe_flow
, backward_facing_step
. The solver uses a uniform mesh of size --help
or -h
flag.
The lid-driven cavity flow is a classic benchmark problem for CFD. It consists of a square domain with all the boundaries being solid walls. The top wall moves in the x-direction at a constant speed while the other walls are stationary. The flow is governed by the incompressible Navier-Stokes equations:
where
The boundary conditions are:
To validate the results of the lid-driven cavity flow solver, we compare them with the experimental data of Ghia et al. 1 for Reynolds number 100.
The pipe flow is another benchmark problem for CFD. It consists of a rectangular domain with a velocity inlet at the left boundary and a gauge pressure outlet at the right boundary. The flow is governed by the same incompressible Navier-Stokes equations as the lid-driven cavity flow.
The boundary conditions are:
where
The Reynolds number based on the inlet velocity and the height is defined as:
To validate the results of the pipe flow solver, they're compared with the analytical solution of the Poiseuille flow, in which the u velocity profile and the pressure drop are given by:
where
The backward facing step flow is a more complex problem for CFD. It consists of a rectangular domain with a step at the bottom wall.
The boundary conditions are:
where
The Reynolds number based on the inlet velocity and the total height is defined as:
Footnotes
-
U. Ghia, K. N. Ghia, and C. T. Shin, "High-Re solutions for incompressible flow using the Navier-Stokes equations and a multigrid method," Journal of Computational Physics, vol. 48, no. 3, pp. 387-411, 1982. ↩