All Projects → p-costa → SNaC

p-costa / SNaC

Licence: MIT License
A multi-block solver for massively parallel direct numerical simulations (DNS) of fluid flows

Programming Languages

fortran
972 projects
python
139335 projects - #7 most used programming language
Makefile
30231 projects
matlab
3953 projects
shell
77523 projects

Projects that are alternatives of or similar to SNaC

CaNS
A code for fast, massively-parallel direct numerical simulations (DNS) of canonical flows
Stars: ✭ 144 (+453.85%)
Mutual labels:  high-performance-computing, cfd, turbulence, fluid-dynamics, computational-fluid-dynamics, fluid-simulation
WABBIT
Wavelet Adaptive Block-Based solver for Interactions with Turbulence
Stars: ✭ 25 (-3.85%)
Mutual labels:  high-performance-computing, cfd, turbulence, fluid-dynamics
exadg
ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
Stars: ✭ 62 (+138.46%)
Mutual labels:  cfd, turbulence, fluid-dynamics, computational-fluid-dynamics
CFD
Basic Computational Fluid Dynamics (CFD) schemes implemented in FORTRAN using Finite-Volume and Finite-Difference Methods. Sample simulations and figures are provided.
Stars: ✭ 89 (+242.31%)
Mutual labels:  cfd, fluid-dynamics, computational-fluid-dynamics, fluid-simulation
shallow-water
Python model solving the shallow water equations (linear momentum, nonlinear continuity)
Stars: ✭ 78 (+200%)
Mutual labels:  fluid-dynamics, computational-fluid-dynamics, fluid-simulation
Fluid2d
A versatile Python-Fortran CFD code that solves a large class of 2D flows
Stars: ✭ 49 (+88.46%)
Mutual labels:  cfd, fluid-dynamics, fluid-simulation
hybridCentralSolvers
United collection of hybrid Central solvers - one-phase, two-phase and multicomponent versions
Stars: ✭ 42 (+61.54%)
Mutual labels:  cfd, fluid-dynamics, computational-fluid-dynamics
tlab
No description or website provided.
Stars: ✭ 19 (-26.92%)
Mutual labels:  cfd, turbulence
Kinetic.jl
Universal modeling and simulation of fluid dynamics upon machine learning
Stars: ✭ 82 (+215.38%)
Mutual labels:  cfd, fluid-dynamics
Fluid Simulation
Self advection, external force and pressure solve to a velocity field represented by a MaC grid.
Stars: ✭ 107 (+311.54%)
Mutual labels:  fluid-dynamics, fluid-simulation
sph opengl
SPH simulation in OpenGL compute shader.
Stars: ✭ 57 (+119.23%)
Mutual labels:  computational-fluid-dynamics, fluid-simulation
Shizuku
Real time simulation and rendering of free surface fluid
Stars: ✭ 22 (-15.38%)
Mutual labels:  fluid-dynamics, fluid-simulation
PyVLM
Vortex Lattice Method library written in Python
Stars: ✭ 33 (+26.92%)
Mutual labels:  fluid-dynamics, computational-fluid-dynamics
unstructured-finite-volume
Unstructured Finite Volume Solver for Partial Differential Equations
Stars: ✭ 26 (+0%)
Mutual labels:  fluid-dynamics, fluid-simulation
UnsteadyFlowSolvers.jl
Solvers for problems involving unsteady fluid flow
Stars: ✭ 18 (-30.77%)
Mutual labels:  fluid-dynamics, fluid-simulation
navier-stokes-webgl
Stable fluid simulation on GPU using WebGL.
Stars: ✭ 27 (+3.85%)
Mutual labels:  fluid-dynamics, fluid-simulation
stable-fluids
A minimal Stable Fluids inspired fluid solver with Python and NumPy.
Stars: ✭ 148 (+469.23%)
Mutual labels:  fluid-dynamics, fluid-simulation
TrainingTracks
Materials for training tracks for continua media - OpenFOAM, vortex method, and other
Stars: ✭ 59 (+126.92%)
Mutual labels:  cfd, computational-fluid-dynamics
NGA2
Object-oriented multi-mesh version of the classic reacting turbulent multiphase flow solver
Stars: ✭ 25 (-3.85%)
Mutual labels:  cfd, turbulence
UCNS3D
Unstructured Compressible Navier Stokes 3D code (UCNS3D)
Stars: ✭ 141 (+442.31%)
Mutual labels:  cfd, computational-fluid-dynamics

Synopsis

SNaC is CaNS spelled backwards, and is a multi-block code for massively parallel direct numerical simulations (DNS) of fluid flows. SNaC aims at combining the versatility of a multi-block DNS solver, with the FFT-based acceleration used in CaNS.

The solver is able to simulate the flow in any three-dimensional multi-block structured Cartesian grid. However, if the geometry has one homogeneous, 'extruded' direction with constant grid spacing, SNaC can use a very fast solver that exploits FFTs in this direction. This is SNaC's warp drive 🚀, as it yields a huge speedup in wall-clock time per time step.

Reference

P. Costa. A FFT-accelerated multi-block finite-difference solver for massively parallel simulations of incompressible flows. Comput. Phys. Commun. 271 : 108194 (2022) [DOI:10.1016/j.cpc.2021.108194] [arXiv:2106.03583].

News

Features

Some features are:

  • Multi-block, three-dimensional parallelization
  • Hybrid MPI/OpenMP parallelization
  • FFT-based synthesis of the Poissonn equation along one direction
  • HYPRE library used to solve Poisson/Helmholtz equations
  • Parallel I/O using MPI I/O
  • A different canonical flow can be simulated just by changing the input files

Motivation

SNaC is meant to serve as a multi-block DNS code for fast, massively-parallel simulations of single-phase flows, and as a solid base solver on top of which more complex phenomena can be implemented, such as numerical methods for multiphase flows.

Method

The fluid flow is solved with a standard second-order finite-difference/-volume pressure correction scheme. Time is advanced with a three-step low storage Runge-Kutta scheme. Optionally, for increased stability at low Reynolds numbers, at the price of higher computational demand, the diffusion term can be treated implicitly.

Usage

Input files

The input files dns.in sets the physical and computational parameters, while the block files geo/block.??? setup block-specific parameters. In the examples/ folder are examples of input files for several canonical flows. See src/INFO_INPUT.md for a detailed description of the input files.

Files out1d.h90, out2d.h90 and out3d.h90 in src/ set which data are written in 1-, 2-, and 3-dimensional output files, respectively. The code should be recompiled after editing out?d.h90 files.

Build

The code should be compiled in src/. The prerequisites are the following:

  • MPI
  • HYPRE
  • OpenMP (optional)
  • FFTW (optional, in case FFT acceleration is used)

The Makefile in src/ should be modified in agreement to the installation paths of each library. Also, the following preprocessor options are available:

  • -D_TIMING : wall-clock time per time step is computed
  • -D_IMPDIFF : diffusion term of the N-S equations is integrated in time with an implicit discretization (thereby improving the stability of the numerical algorithm for viscous-dominated flows)
  • -D_SINGLE_PRECISION : calculation will be carried out in single precision (the default precision is double)
  • -D_FFT_?, with ? being X, Y or Z: will use FFTs to solve the Poisson equation in the direction in question.

Typing make run will compile the code and copy the executable snac and input file dns.in to a run/ folder.

Running the code

Run the executable with mpirun with a number of tasks and shared threads complying to what has been set in the input file dns.in (or in the geo/block.??? files in case of multi-block). Data will be written by default in a folder named data/, which must be located where the executable is run.

Visualizing field data

See src/INFO_VISU.md.

Notes

I appreciate any feedback that can improve the code. Also, feel free to send case files pertaining to flows not listed in the examples folder.

Please read the LICENSE file.

Contributors

Pedro Costa ([email protected])

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].