-
Notifications
You must be signed in to change notification settings - Fork 1
Home
shaia edited this page Mar 4, 2026
·
3 revisions
Welcome to the CFD Library wiki! This is a 2D/3D Computational Fluid Dynamics framework implemented in C.
- Getting Started - Installation and first simulation
- Solver Guide - Available solvers and when to use them
- Output System - VTK and CSV output configuration
- Examples - Walkthrough of example programs
- Architecture - Library design and internals
- 2D/3D structured grids - Uniform and stretched grid generation
- Multiple solvers - Explicit Euler, Projection Method, RK2 (Heun's method), SIMD, OpenMP, and GPU variants
- Flexible output - VTK for visualization, CSV for data analysis
- Pluggable architecture - Easy to add new solvers
- Cross-platform - Windows, Linux, macOS support
#include "cfd/api/simulation_api.h"
int main() {
// Create 100x100 2D simulation on unit square (nz=1 for 2D)
simulation_data* sim = init_simulation(100, 100, 1, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0);
// Register VTK output every 10 steps
simulation_register_output(sim, OUTPUT_VELOCITY_MAGNITUDE, 10, "velocity");
// Run 100 time steps
for (int step = 0; step < 100; step++) {
run_simulation_step(sim);
simulation_write_outputs(sim, step);
}
free_simulation(sim);
return 0;
}| Solver | Type | Best For |
|---|---|---|
explicit_euler |
CPU | Learning, debugging |
explicit_euler_optimized |
CPU+SIMD | Large grids on modern CPUs |
explicit_euler_omp |
CPU+OpenMP | Multi-core CPU acceleration |
projection |
CPU | Accurate pressure-velocity coupling |
projection_optimized |
CPU+SIMD | Production simulations |
projection_omp |
CPU+OpenMP | Multi-core production simulations |
rk2 |
CPU | Second-order temporal accuracy |
rk2_optimized |
CPU+SIMD | High-accuracy large grids |
rk2_omp |
CPU+OpenMP | High-accuracy multi-core |
explicit_euler_gpu |
GPU | Very large grids with NVIDIA GPU |
projection_jacobi_gpu |
GPU | High-performance GPU simulations |
- API Reference: Available on GitHub Pages (Doxygen-generated)
- Code Coverage: Available on GitHub Pages
- Check the Examples for common use cases
- Review the API documentation
- Open an issue on GitHub for bugs or questions