A fluid simulator toolbox for teaching purposes
Go to file
2024-09-16 13:51:10 +02:00
BasicSolver Requested changes 2024-09-16 13:51:10 +02:00
EnhancedSolver EnhancedSolver port complete 2024-07-27 02:19:56 +02:00
PoissonSolver Reformat. Merge improved solvers. 2023-11-21 05:27:11 +01:00
.clang-format Add clang lsp configuration 2023-02-05 08:07:41 +01:00
.clang-tidy Add clang lsp configuration 2023-02-05 08:07:41 +01:00
.clangd Synchronize and Update variants. Prepare Assigment codes. 2024-01-08 10:26:43 +00:00
.gitignore Add red black solver 2023-06-17 07:35:05 +02:00
LICENSE Initial commit 2023-02-05 07:02:36 +01:00
README.md Update README.md 2023-02-07 16:08:48 +01:00

NuSiF-Solver

This is a broad collection of C implementations of Navier-Stokes Fluid simulator as described in this book by Michael Griebel et al.

Build

Every variant comes with a makefile. First configure the toolchain by editing the variabel TAG in config.mk. For the Intel tool chain set it to ICC, for LLVM clang using Open MPI set it to CLANG. If required adapt the respective flags and include and library paths in include_[CLANG|ICC].mk.

You can uncomment the -DVERBOSE line for additional dignostic output.

Build the code with:

$ make

Clean intermediate build products with:

$ make clean

Clean all build products with:

$ make distclean

The makefile provides the additional build targets:

  • $ make info: Output CFLAGS and the compiler version for documentation purposes.
  • $ make tags: Run ctags -R.
  • $ make format: Run clang-format on all source files.

Run

All examples come with two test cases:

  • dcavity: Lid driven cavity.
  • canal: Channel flow with inflow on one side.

To start a simulation for sequential implementations execute (here for CLANG toolchain):

$ ./exe-CLANG dcavity.par|canal.par

To start a simulation for parallel implementations execute (here for CLANG toolchain):

$ mpirun -np <NUMPROC> ./exe-CLANG dcavity.par|canal.par

Configuration options

Important option in the test case parameter files:

  • re: Desired reynolds number. Higher for a less viscous fluid and lower for a more viscous fluid.
  • imax, jmax, kmax: The resolution of the grid. Increase resolution for higher Reynolds numbers.
  • te: The final simulation time.
  • itermax: The number of maximum iterations performed in every Poisson pressure equation step.
  • eps: Stopping tolerance for the pressure equation solver.
  • omg: Relaxation parameter for SOR solver. Default is 1.7 to 1.9. For MPI parallel runs omega needs to be reduced to 1.3 to guarantee convergence.

The other parameters should not be changed.