项目介绍

takah29/2d-fluid-simulator 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,目前获得 144 个 Star、22 次 Fork。

仓库全名
takah29/2d-fluid-simulator
Star 数
144
Fork 数
22

README 摘要

2D Fluid Simulator 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 Setup Run the following command in an environment with the uv project management tool installed: GeForce GTX 1080 or higher recommended. Usage Boundary Condition 1,…

完整内容见 GitHub 原始 README 或本页 。

常见问题

2d-fluid-simulator 用什么语言开发?

主要使用 Python 编写,目前有 144 个 Star。

如何获取 2d-fluid-simulator 的源码?

可以直接克隆仓库:git clone https://github.com/takah29/2d-fluid-simulator.git,默认分支为 main;安装与运行步骤见仓库 README。

2d-fluid-simulator 最近还在维护吗?

仓库最近一次更新为 2025年8月23日,当前没有未关闭的 Issue;Star 数为 144,可作为社区活跃度的参考。

关于

2D incompressible fluid solver implemented in Taichi.

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

语言占比

Python

README

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

Setup

Run the following command in an environment with the uv project management tool installed:

uv sync

GeForce GTX 1080 or higher recommended.

Usage

  • Boundary Condition 1, ReynoldsNumber = 1000, dt = 0.0005, VorticityConfinement is Disable
    uv run main.py -re 1000 -dt 0.0005 -vc 0.0
    
    Press V key switches the flow visualization method. dt is automatically determined even if not specified, but should be small for divergence.
  • Boundary Condition 2, resolution = 800
    uv run main.py -bc 2 -res 800
    
    Boundary conditions can be specified from 1 to 6
  • Boundary Condition 3, ReynoldsNumber = 10^8, resolution = 800, VorticityConfinement = 10
    uv run main.py -bc 3 -re 100000000 -res 800 -vc 10
    
  • Help
    uv run main.py -h
    
  • for CPU
    uv run main.py -dt 0.0005 -cpu
    

Screenshots

Flow Visualization

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

Vorticity Confinement

  • Disable no_vorticity_confinement
  • Enable vorticity_confinement

References

评论

暂无评论