Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

go-fluid-simulation

A high-performance fluid simulation library written in Go.

This project provides reusable fluid dynamics algorithms and simulation components for scientific computing, engineering, computer graphics, and physics-based applications. It focuses on building efficient, modular, and production-ready fluid simulation systems implemented in pure Go with minimal external dependencies.


✨ Features

  • Grid-Based Fluid Simulation
  • Particle-Based Fluid Simulation
  • Navier–Stokes Solvers
  • Incompressible Flow
  • Advection Methods
  • Pressure Solvers
  • Boundary Conditions
  • Surface Reconstruction
  • Smoke Simulation
  • Water Simulation
  • Multiphase Fluids
  • Performance Optimization

📦 Milestones

M1 — Mathematical Foundations

Objective: Build the core mathematical framework required for fluid simulation.

Key Deliverables

  • Vector Mathematics
  • Matrix Operations
  • Numerical Integration
  • Finite Difference Methods
  • Linear Solvers

M2 — Grid System

Objective: Implement structured grid data structures for fluid simulation.

Key Deliverables

  • Uniform Grids
  • Staggered MAC Grids
  • Cell Utilities
  • Grid Sampling
  • Interpolation

M3 — Advection

Objective: Implement fluid transport algorithms.

Key Deliverables

  • Semi-Lagrangian Advection
  • MacCormack Advection
  • BFECC Advection
  • Velocity Advection
  • Scalar Advection

M4 — Pressure Solver

Objective: Enforce incompressibility using pressure projection.

Key Deliverables

  • Poisson Solver
  • Conjugate Gradient
  • Jacobi Solver
  • Pressure Projection
  • Divergence Computation

M5 — Boundary Conditions

Objective: Implement boundary handling for realistic simulations.

Key Deliverables

  • Solid Boundaries
  • Open Boundaries
  • Periodic Boundaries
  • Obstacle Handling
  • Collision Detection

M6 — Fluid Solvers

Objective: Build complete incompressible fluid solvers.

Key Deliverables

  • Stable Fluids
  • Navier–Stokes Solver
  • PIC
  • FLIP
  • APIC

M7 — Particle Systems

Objective: Develop particle-based simulation methods.

Key Deliverables

  • Particle Emitters
  • Particle Advection
  • SPH
  • Neighbor Search
  • Particle Collision

M8 — Surface Reconstruction

Objective: Generate fluid surfaces from simulation data.

Key Deliverables

  • Signed Distance Fields
  • Marching Cubes
  • Surface Mesh Generation
  • Level Sets
  • Surface Normals

M9 — Smoke & Gas Simulation

Objective: Simulate gaseous fluids.

Key Deliverables

  • Smoke Simulation
  • Density Fields
  • Temperature Fields
  • Buoyancy Forces
  • Vorticity Confinement

M10 — Water Simulation

Objective: Simulate realistic liquid behavior.

Key Deliverables

  • Free Surface Simulation
  • Splash Effects
  • Wave Generation
  • Foam Generation
  • Water Rendering Utilities

M11 — Performance Optimization

Objective: Improve computational performance and scalability.

Key Deliverables

  • Parallel Processing
  • SIMD Optimizations
  • Memory Pooling
  • Cache Optimization
  • Benchmark Suite

M12 — Stable Release v1.0

Objective: Deliver the first production-ready release.

Key Deliverables

  • Stable Public API
  • Comprehensive Documentation
  • Example Applications
  • Unit Testing
  • Benchmark Results
  • Release Notes

📁 Project Structure

go-fluid-simulation/
├── benchmarks/
├── cmd/
├── docs/
├── examples/
├── internal/
├── pkg/
│   ├── advection/
│   ├── boundary/
│   ├── grid/
│   ├── math/
│   ├── particles/
│   ├── pressure/
│   ├── rendering/
│   ├── smoke/
│   ├── solver/
│   ├── surface/
│   └── water/
├── testdata/
└── LICENSE

🎯 Goals

  • Pure Go implementation
  • Minimal external dependencies
  • Modular architecture
  • High-performance computation
  • Cross-platform compatibility
  • Production-ready APIs
  • Comprehensive documentation
  • Extensive testing and benchmarking
  • Educational reference implementation

🚀 Planned Algorithms

Fluid Dynamics

  • Stable Fluids
  • Navier–Stokes Solver
  • PIC
  • FLIP
  • APIC
  • SPH

Numerical Methods

  • Finite Difference
  • Poisson Solver
  • Conjugate Gradient
  • Jacobi Iteration
  • Multigrid Methods

Surface Reconstruction

  • Level Sets
  • Marching Cubes
  • Signed Distance Fields

Smoke Simulation

  • Density Advection
  • Temperature Simulation
  • Buoyancy
  • Vorticity Confinement

Water Simulation

  • Free Surface
  • Splash Generation
  • Foam Simulation
  • Wave Propagation

🤝 Contributing

Contributions are welcome.

You can contribute by:

  • Reporting bugs
  • Requesting new features
  • Improving documentation
  • Optimizing simulation algorithms
  • Adding new numerical methods
  • Writing tests and benchmarks

Please open an issue before submitting large changes.


📄 License

This project is licensed under the MIT License.

About

A high-performance Go library for fluid simulation and computational fluid dynamics (CFD) algorithms.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors