Skip to content

Python code for solving Napier Stokes equation using finite volume method in the scenario of Lid driven flow. The quasi Rhie Chow algorithm has been implemented to arrive at the solution.

Notifications You must be signed in to change notification settings

Souritra-Garai/Lid-Driven-Flow-CFD-Simulation

Repository files navigation

Lid-Driven-Flow-CFD-Simulation

Here is the flow of fluid particles close to the steady state - Flow Animation

Python code for solving Napier Stokes equation using finite volume method in the scenario of Lid driven flow. The Quasi Rhie Chow algorithm has been implemented to arrive at the solution.

Code requires the following python libraries to be installed -

  • Numpy
  • Matplotlib

The main code to obtain the solution is written in the jupyter notebook - Lid_Driven_Cavity.ipynb The scripts -

  • Boundary_Conditions.py has methods for defining the boundary velocities and pressures using ghost cells.
  • Discretized_Terms.py has methods to estimate the convection term, diffusion term and pressure gradient terms in the finite volume method approach in a collocated grid.
  • Pressure_Poisson_Equation_Solver.py as the name suggests contains methods for solving the pressure Poisson equation required in correction steps of Quasi Rhie Chow algorithm.
  • Quasi_Rhie_Chow.py contains method to perform a complete iteration of Quasi Rhie Chow algorithm - the predictor and the corrector steps.
  • TDMA_Solver.py contains class definition for a solver to solve tridiagonal matrix equations.

The scripts to visualize the solution are -

  • Streamplots.py plots streamlines at steady state of for the the lid driven flow.
  • Flow_Animation.py creates a video animation showing the flow of fluid particles till steady state is reached.

Here is the streamplot at steady state for a 40 by 40 grid - Streamplot

About

Python code for solving Napier Stokes equation using finite volume method in the scenario of Lid driven flow. The quasi Rhie Chow algorithm has been implemented to arrive at the solution.

Topics

Resources

Stars

Watchers

Forks