This repo contains the code for numeric simulation for the flow around a cylinder in a 2D context. The project was powered by the 'OpenFOAM' framework.
- The programme aims to simulate the flow around a cylinder in a 2D context, using DNS (Direct Numerical Simulation) method.
- The computational domain is a 2D square with consomisable size (can be set in the
blockMeshDict
file, i.e.length
variable). - The cylinder is located at the center of the domain, its diameter can be set in the
blockMeshDict
file, i.e.small_r
variable. - Boundary conditions:
- No-slip condition is set for the wall, including the cylinder surface and the upper and lower boundaries.
- The inlet is has a constant velocity, and the outlet is set to have zero pressure condition.
- OpenFOAM 11
- Paraview 5.1.0
blockMesh
decomposePar
mpirun -np 4 pimpleFoam -parallel
reconstructPar
foamToVTK
or Simply run the ./Allrun
script.
Please run ./Allclean
before each run to clean the previous results.
The computational domain is devided into 4 subdomains. With finer mesh near the cylinder and the wall to provide more accurate results.
The following animation shows the velocity field of the DNS simulation. The intial velocity is 1.0 m/s. The diameter of the cylinder is 0.1 m.
Additional pre-run files can be found in the results
folder.