This code is a Fortran implementation of a 2D flow using projection method with FVM. Navier Stokes equations are solved for velocity and pressure fields. The rotational of velocity is also calculated, and the output data can be visualized with Ensight or Paraview.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
The code being implemented in Fortran 90, and Fortran being a compiled language, it requires a compiler such as GFortran.
In Ubuntu, Mint and Debian you can install GFortran like this:
sudo apt-get install gfortran
Alongside the GFortran compiler, the open-source platform for data analysis and visualization, ParaView, is also required and installed through the commands:
sudo apt-get update
sudo apt-get install paraview
Paraview is preferred compared to Ensight as it is free and open-source, so that everybody can use it.
For other Linux flavors, OS X and Windows, packages are available at:
https://gcc.gnu.org/wiki/GFortranBinaries for GFortran
https://www.paraview.org/download/ for ParaView
- '*.f90' files in which the main code, as well as the different subroutines are programmed.
- 'Makefile' to compile the code.
- In the directory 'Documents', there are 3 files in PDF format:
- 2 papers 'cavityflow.pdf' and 'ghia82.pdf', which treat of the lid driven cavity problem for incompressible flows.
- 'Program_presentation.pdf' which describes all the steps followed in the code implementation.
- Input numerical values for the mesh size and viscosity, in the file 'variables module.f90'.
! Parameters for reading data to be modified
integer ,parameter :: nx=11,ny=11,nz=1 ! nx and ny correpond to the number of cells in x and y direction
real*8 ,parameter :: nu = 1e-02, dt2 = 1e-04 ! nu is the fluid viscosity and dt2 is the initial timestep.
- Simulation parameters to be defined in the main program 'main.f90'.
!!! Parameters for the simulation
zeta=1.e-8 ! zeta and itmax for solving pressure matrix in ICCG2 subroutines
itmax=300
time = 0. ! initialize time of simulation
nstep = 20000 ! number of timesteps for the simulation
isto = 200 ! data stored every 'isto' steps
-
Use the Makefile to compile all the files and create the executable (run the command 'make' while being in the main directory of the program).
-
Launch the executable NS_lid_driven_cavity, which will create the mesh and run the discretised calculation on the latter.
-
Observe the different fields (u, v, p and omega) on the domain using Paraview. Ensight6 and Ensight Gold formats are normally supported by Paraview.
-
Remove the created files thanks to the commands 'make clean' and 'make cleanall'.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- David Cicoria - Initial work - DavidCico
See also the list of contributors who participated in this project.