Skip to content

GongZheng-Justin/CP3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CP3d

CP3d (Channel-Particle 3d) is a comprehensive Euler-Lagrange solver for the direct numerical simulations of particle-laden flows.

  • Have the ability to perform one-way, two-way, interface-unresolved four-way, and interface-resovled four-way coupling regime.
  • For the fluid sub-solver, both the second-order and four-order finite difference discretization are available, in company with three viscous term treatment approaches: i.e., fully-implicit, partial-implicit, and fully-explicit.
  • Four boundary conditions (BCs) are available in CP3d for the velocity terms, including the periodic, no-slip, slip, and convective outflow conditions. However, only two types of boundary condition are needed for the pressure term: periodic or Neumann BCs (∂p/∂xi=0 for non-periodic directions).
  • For the discrete-element-method (DEM) solver, both linear and non-linear contact force models can be used, and the collision time can be also adaptive.
  • The immersed boundary method (IBM) is used in interface-resolved simulation, and totally three IBM coupling approaches are included.
  • In order to improve the numerical accuracy of the computational Basset history force, a third-order exponential approximation method is proposed in interface-unresolved four-way regime.
  • An averaged lubrication force model is proposed for the short-range hydrodynamic interaction.
  • The volume integration approach is also modified to adapt the staggered mesh configuration.
  • The resulting solver is able to simulate large scale cases of billions of grid points with millions of moving particles in interface-resolved four-way regime using only hundreds of computational cores.
  • MPI parallelization by means of pencil distributed decomposition. In order to improve the parallel efficiency, we propose a new 2D pencil-like parallel configuration with totally 6 different pencil arrangements.

How to cite CP3d?

  • Z. Gong, Z. Wu, C. An, B. Zhang, X. Fu, CP3d: A comprehensive Euler-Lagrange solver for direct numerical simulation of particle-laden flows, Computer Physics Communications, 286 (2023) 108666. https://doi.org/10.1016/j.cpc.2023.108666.
  • Z. Gong, G. Deng, C. An, Z. Wu, X. Fu, A high order finite difference solver for simulations of turbidity currents with high parallel efficiency, Computers and Mathematics with Applications, 128 (2022) 21–33. https://doi.org/10.1016/j.camwa.2022.09.024.
  • Z. Gong, X. Fu, A pencil distributed direct numerical simulation solver with versatile treatments for viscous term, Computers and Mathematics with Applications, 100 (2021) 141–151. https://doi.org/10.1016/j.camwa.2021.09.003.

Overview of the solvers 📖

 There are totally 6 solvers in CP3d:

Solver Note
dem The pure DEM solver
channel2nd The pure 2nd order DNS solver
channel4th The pure 4th order DNS solver
channelLPT One- and two-way DNS-LPT coupling solver
channelDEM Interface-unresolved DNS-DEM coupling solver
channelACM DNS-DEM-IBM coupling solver

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.10 library has been explicitly included in the directory ./src/ThirdParty/fftw/, but it is strongly recommended to recompile FFTW-3.3.10 for the first use. After entering the folder CP3d-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

Usage 📘

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

mpirun -n [np] [exeName] [inputFile1] [inputFile2]

 Here:

  • np denotes the number of processors you use
  • exeName stands for specific executable file name, namely channel2nd or channel4th
  • inputFile1 is the name string for the 1st input parameter file
  • inputFile2 is the name string for the 2nd input parameter file, if any

 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/CFD_2nd/LidDrivenCavity.prm

The following table provides examples to run CP3d after compilation:

Solver Tying in terminal
dem mpirun -n 8 ./dem ./Input/DEM/DEM_Settling.standard
channel2nd mpirun -n 8 ./channel2nd ./Input/CFD_2nd/TurbCha0180_2nd.standard
channel4th mpirun -n 8 ./channel4th ./Input/CFD_4th/TurbCha0180_4th.standard
channelLPT mpirun -n 8 ./channelLPT ./Input/CFDLPT_OneWay/Channel4th_LPT.oneway ./Input/CFDLPT_OneWay/LPT_Channel4th.oneway
channelDEM mpirun -n 8 ./channelDEM ./Input/CFDDEM/ParticleFalling/ChannelDEM_falling.case01 ./Input/CFDDEM/ParticleFalling/DEMChannel_falling.case01
channelACM mpirun -n 8 ./channelACM ./Input/ParticleFalling/SphereCate.cfd1 ./Input/ParticleFalling/SphereCate.acm

Input file

 The input file examples are stored in the folder ./Input/.

Benchmarks 🚤

One-way coupling

Two-way coupling

Interface-unresolved four-way coupling

Interface-resolved four-way coupling

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.
  • Prof. Meiburg from University of California, Santa Barbara.
  • 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 (gongzheng_justin@outlook.com)