wang9174 / 2d-fluid-simulator

2D incompressible fluid solver implemented in Taichi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2D Fluid Simulator

baundary_condition_2_dye baundary_condition_2_norm

Features

  • Finite Difference Method (MAC Method)
  • Advection Scheme
    • Upwind Differencing
    • Kawamura-Kuwahara
    • CIP (Constrained Interpolation Profile)
  • Flow Visualization
    • Norm (Velocity) and Pressure
    • Pressure
    • Vorticity
    • Dye
  • Vorticity Confinement

Requirements

  • Python 3.9
  • Taichi 1.0

GeForce GTX 1080 or higher recommended.

Usage

  • Boundary Condition 1, Reynolds Number = 0.2, dt = 0.01
    python main.py -re 1.0
    Press V key switches the flow visualization method.
  • Boundary Condition 2, Reynolds Number = 100.0, resolution = 800, dt = 0.01
    python main.py -bc 2 -re 100 -res 800
  • Boundary Condition 3, Reynolds Number = 100.0, resolution = 800, dt = 0.01, no vorticity confinement, upwind scheme
    python main.py -bc 3 -re 100 -res 800 -vor_eps 0.0 -scheme upwind
  • Boundary Condition 3, Reynolds Number = 100.0, resolution = 800, dt = 0.01, no vorticity confinement, cip scheme
    python main.py -bc 3 -re 100 -res 800 -vor_eps 0.0
  • Boundary Condition 5, Reynolds Number = 100.0, dt = 0.01
    python main.py -bc 5 -re 100
  • Boundary Condition 6, Reynolds Number = 100.0, dt = 0.01
    python main.py -bc 6 -re 100
  • Help
    python main.py -h

For CPU

  • Boundary Condition 2, Reynolds Number = 100.0, resolution = 200, dt = 0.01
    python main.py -bc 2 -re 100.0 -res 200 -cpu

Screenshots

Flow Visualization

  • Norm and Pressure norm_and_pressure
  • Pressure pressure
  • Vorticity vorticity
  • Dye dye

Vorticity Confinement

  • eps = 0.0 no_vorticity_confinement
  • eps = 4.0 vorticity_confinement

References

About

2D incompressible fluid solver implemented in Taichi.


Languages

Language:Python 100.0%