Skip to content

Computational fluid dynamics library written in Rust

License

Notifications You must be signed in to change notification settings

1n0r1/flow2d-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flow2d-rs

Computational fluid dynamics library written in Rust

flow2d_rs.mp4

Backward facing step

backward facing step

Cylinder cross flow

cylinder cross flow

Lid-driven cavity

lid-driven cavity

Features

  • 2D viscous incompressible Newtonian fluid flow
  • Solve Navier-Stokes equations using Euler's Method on staggered grid
  • Solve Poisson equation with Successive Over-relaxation method
  • Calculate and visualize pressure, speed and stream function
  • Different types of boundary conditions:
    • Moving no-slip boundary condition
    • Free slip boundary condition
    • Inflow and outflow condition
  • Planned features:
    • Contour plot for stream function
    • Free boundary value simulation
    • HDF5 data export
    • Use other method to solve Poisson equation (possibly Multigrid)
    • Optimize to run on GPU
    • Energy/Heat flow simulation
    • Extension to 3D
  • The theory and algorithm can be found in Numerical simulation in fluid dynamics: a practical introduction[1]

Quick start

  git clone https://github.com/1n0r1/flow2d-rs.git
  cd flow2d-rs
  cargo run --example gui

Refer to ./src/presets.rs for setting up other simulations.

Use this in your project

Add flow2d_rs as a dependency in your Cargo.toml

flow2d_rs = "0.1.0"

Dependencies

  • Rayon - to parallelize computation

References

[1] Michael Griebel, Thomas Dornseifer, and Tilman Neunhoeffer. 1998. Numerical simulation in fluid dynamics: a practical introduction. SIAM

About

Computational fluid dynamics library written in Rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages