Skip to content

second- /fourth-order finite-difference direct numerical simulation (DNS) solver with versatile viscous treatments

License

Notifications You must be signed in to change notification settings

GongZheng-Justin/Channel3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Channel3d

Channel3d is an efficient second- /fourth-order finite-difference direct numerical simulation (DNS) solver with versatile viscous treatments, also with the ability to handle different boundary conditions:

  • Versatile viscous treatments. The viscous term can be handled full implicitly, full explicitly, or partial implicitly
  • Have the ability to handle periodic, no-slip and free-slip boundary conditions
  • Second-order spatial accuracy in non-periodic directions, and fourth-order scheme is also available for periodic directions
  • FFT-based (FFTW used here) method is used for Pressure Poisson Equation (PPE)
  • Alternating Direction Implicit (ADI) method is adopted for Helmholtz equations
  • MPI parallelization by means of pencil distributed decomposition, using 2DECOMP&FFT

 Following picture shows the transition process from laminar to turbulent flow for open-channel case (Re_tau =180). The top half of the picture presents the normalized streamwise velocity field, and the bottom half shows the isosurface for Q vortex criterion value at Q+ = 80, colored by streamwise velocity.

Installation 💼

 During developing this solver, I often try my best to make it easy-to-understand and easy-to-use. As for compilation, present solver only has the following two prerequisites:

  • MPI
  • Gfortran/Intel Fortran (Supporting Fortran 2003 or higher version)

FFTW-3.3.8 library has been explicitly included in the directory ./src/ThirdParty/fftw/, so compiling and additional linking to external FFTW are avoided. After entering the folder Channe3d-master/ in terminal, you can compile the code as follows:

1. chmod a+x ./mymake.sh
2. ./mymake.sh
3. choose the correct compiler you use, and the executable you want to compile, following guidances printed in the terminal

 Yon can also compile the interpolateField code in the folder ./Tool/interpolateField/ by typing:

1. cd ./Tool/interpolateField
2. chmod a+x ./makeInterp.sh
3. ./makeInterp.sh
4. choose the correct compiler you use, and the executable you want to compile, following guidances printed in the terminal
5. cd ../..

 If the compiling process successfully, the executable file(s) channel2nd/channel4th will be appeared in the folder Channe3d-master/, and interpolateField will be included in the folder ./Tool/interpolateField/.

Usage 📖

 After compiling the code successfully, you can run the executable file like that:

mpirun -n [np] [exeName] [inputFile]

 Here:

  • np denotes the number of processors you use
  • exeName stands for specific executable file name, namely channel2nd or channel4th
  • inputFile is the name string for the input parameter file

 For instance, if you want to run the lid-driven cavity case, you can type the following words in your terminal:

mpirun -n 4 ./channel2nd ./Input/LidCavity.prm

Input file

 The input file examples are stored in the folder ./Input/. See ./doc/channel2nd_prm.md and ./doc/channel4th_prm.md for detailed descriptions to the input file for second-order and fourth-order scheme respectively.

A complete example

 See ./doc/Toturial_for_channel_turbulence_4th.pdf for a complete example to the wall-bounded turbulence at Re_tau =180 using fourth-order scheme, including the postprocessing, and verification.

To do list 💪

  • Fourth-order scheme options for non-periodic directions
  • Adding a passive scalar transport solver
  • Hybrid MPI/OpenMP parallelization and GPU acceleration
  • Channel3d presented here is a part of my integral project: CP3d, Channnel-Particle 3d, which is still under development, and will be open-source in the coming future. My ultimate aim for CP3d project is to develop an efficient and easy-to-use particle-laden flow solver, including one-way, two-way, and full four-way coupling methods, by combination with Basset history force model, discrete element method (DEM), and immersed boundary method (IBM).

Acknowledgements 👏

 Since Sep 2019, when I finally decided to develop my own CFD-DEM code from scratch, I have learnt quite a lot from the following really kind researchers (in alphabetical sequence):

  • Dr. Costa from University of Iceland, and his second-order DNS code CaNS, also his papers on IBM approach.
  • Dr. He from Iowa State University, and his fourth-order DNS solver HercuLES.
  • Prof. Ji from Tianjin University, on the fruitful discussion about the particle IBM method, and on the access to their in-house DNS/LES-Solid interaction code cgLES.
  • Dr. Laizet from Imperial College London, and their compact FD code Incompact3d.
  • Prof. Marchioli from University of Udine, on the fruitful and continuous discussion about one-way CFD-Particle coupling benchmark and on the access to their benckmark data.
  • Dr. Norouzi from University of Tehran, and his book Coupled CFD‐DEM Modeling: Formulation, Implementation and Applimation to Multiphase Flows, besides the attached DEM code.
  • Prof. Orlandi from Sapienza University of Rome, and his book Fluid flow phenomena: a numerical toolkit, besides the attached CFD code.
  • Dr. Tschisgale from Institute of Air Handling and Refrigeration, on the fruitful and continuous discussion about their IBM approach.
  • Prof. Zhao from Tsinghua university, on the one-way CFD-Particle coupling benchmark.
  • ......

 Without those researchers' help, I might do nothing but sleep in the dormitory all the days!!!:joy::joy::joy:
 Thanks so much again and again !!!

Contact and Feedback 📧

 If you have any question, or want to contribute to the code, please don't hesitate to contact me: Zheng Gong ([email protected])

About

second- /fourth-order finite-difference direct numerical simulation (DNS) solver with versatile viscous treatments

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published