Skip to content

A "Hello World" introduction to Navier--Stokes: simple, 2D incompressible flow solver with 2nd-order finite differences

Notifications You must be signed in to change notification settings

kevzhong/HelloWorld-NavierStokes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HelloWorld-NavierStokes

Hello World to incompressible Navier--Stokes. The basic features of this solver are:

  • Two-dimensional flow
  • Second-order finite difference, staggered grid
  • Fractional-step method
  • Pressure-Poisson equation solved via FFTs
  • OpenMP acceleration
  • Fully explicit Euler time-integration
  • Uniform grid spacing

Various branches have been created in what is (generally) increasing order of implementation complexity:

  • main: Doubly-periodic domain, Pressure-Poisson equation solved via 2D FFTs
  • walls: Implementation of wall-boundary conditions in one direction. The Poisson equation is solved with 1D FFTs in the periodic x-direction and a tridiagonal inversion in the remaining wall-normal direction. A scalar field is also added so that 2D Rayleigh-Benard flow can be simulated.
  • implicit: Implicit time-stepping treatment of the diffusive terms using an Alternating Direct Implicit (ADI) approach or Helmholtz solver.
  • RK3: Implementation of RK3 sub-stepping. Wall-normal viscous terms are always treated implicitly, while an option is available to treat the wall-parallel terms implicitly.
  • non-uniform-grid: Grid-stretching in the wall-normal direction.
  • 3d: Full 3D Navier--Stokes, with a standard channel geometry configuration. Periodicity in xy and wall-normal grid-stretching in z. WIP

Fields are dumped as binary files. In the later branches, I have routines which dump additional XDMF instructions such that they can be conveniently imported into Paraview.

Dependencies

  • FFTW3
  • Fortran compiler
  • OpenMP

Acknowledgements

  • Dr. Naoki Hori for his overall guidance in kick-starting this project
  • My PhD advisor A/Prof. Daniel Chung, of which I have used his code as a reference for various intricacies related to incompressible flow solvers
  • The contributors to AFiD, which I have also used as a reference

About

A "Hello World" introduction to Navier--Stokes: simple, 2D incompressible flow solver with 2nd-order finite differences

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published