Skip to content
/ DRIP Public

Divergence-free Resolution with Iterative Poisson

Notifications You must be signed in to change notification settings

41pha1/DRIP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DRIP - Divergence-free Resolution with Iterative Poisson

A parallel CFD solver for 2D incompressible flow. It discretizes the Navier–Stokes equations on a staggered grid with finite differences, advances velocities in time, and enforces incompressibility via a pressure Poisson solve (SOR/CG), following the classic projection method. The discretization uses central differences with donor-cell stabilization for high Reynolds numbers.

Image Processing Pipeline

The graphic at the top summarizes how obstacle geometry is prepared before it enters the solver:

  • A → B: A grayscale input image is converted to a clean binary mask (foreground vs. background).
  • B → C: The binary mask is scaled to the target grid resolution, preserving aspect ratio.
  • C → D: Small defects are corrected and boundaries are labeled to generate a simulation-ready obstacle map.

This pipeline ensures the obstacle field is well-defined on the staggered grid and matches the resolution used by the flow solver.

Maze obstacle Maze obstacle

Highlights

  • Incompressible Navier–Stokes via projection method (pressure Poisson equation).
  • Finite differences on a staggered grid for velocity and pressure.
  • Iterative solvers: SOR and Conjugate Gradient for the Poisson system.
  • Stabilized convection using donor-cell blending for high-Re flows.
  • Parallel execution with MPI + OpenMP and optional CUDA kernels.

Visuals & Results

Scenario Preview Notes
Tesla valve (Re = 100,000) Tesla valve forward Forward flow forms a single fast stream, $\dot{V}=0.65$.
Tesla valve (Re = 100,000) Tesla valve backward Backward flow splits into two slower streams, $\dot{V}=0.33$.
Maze Maze CG solves the maze efficiently; SOR would require impractical iterations.
Airfoil sweep Airfoil A340 airfoil, one simulation per angle of attack.

How it works (short version)

  1. Spatial discretization: Finite differences on a staggered grid for $u$, $v$, and $p$.
  2. Time stepping: Explicit update of momentum terms to get preliminary velocities $F$, $G$.
  3. Projection: Enforce $\nabla \cdot \mathbf{u}=0$ via a pressure Poisson solve.
  4. Pressure correction: Update velocities with the pressure gradient.

Build & Run

Requirements

  • CMake 3.8+
  • MPI (e.g., OpenMPI)
  • CUDA toolkit (optional for GPU kernels)
  • GCC/G++ (configured in CMakeLists.txt)

Build

Use the provided script to build the MPI/CUDA-enabled executable:

Run (example)

The default run script uses MPI and a sample settings file:

You can switch the input by editing the settings file path, for example:

About

Divergence-free Resolution with Iterative Poisson

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages