Skip to content

bensmith95/Lid-Driven-Cavity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lid-Driven-Cavity

MATLAB code that solves the planar Navier-Stokes equations using the FMG-FAS algorithm of Smith (2023) for the Lid Driven Cavity problem.

The PDEs are in Streamfunction-Vorticity form, which decreases the dimension by one, but also makes boundary conditions difficult to implement (so some care and attention to detail is needed). These are then discretised via finite differences producing a large system of non-linear equations. As a full scale Newton method requires a huge amount of computational resources, iterative methods are needed. This code utilises a geometric multigrid method to solve large systems of non-linear equations in a reasonably quick manner by iterating on smaller/coarser grids and correcting the solutions on larger/finer grids. The full details are in Smith (2023).

To run the code in its current format simply download all the files into the same directory and then run LDC(Re) where Re is the Reynolds number. After the code runs, all the data will be saved to a file called LDC_Re=Re.mat. To view the results simply run figures.m. In order to test the consistency and accuracy of the code, some results from Ghia et al (1982) are attached in a spreadsheet.

About

MATLAB code that solves the planar Navier-Stokes equations using the FMG-FAS algorithm of Smith (2023) for the Lid Driven Cavity problem

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages