How jviquerat/lbm works
Main Components
a) Core Components:
• Lattice System (D2Q9)
• Collision Operator (TRT)
• Boundary Conditions Handler (Zou-He)
• Numba-accelerated Computing Core
b) Application Layer:
• Simulation Apps (Cavity, Poiseuille, Turek, etc.)
• Factory Pattern Implementation
• Results Management
┌─ User Interface Layer ─────────────────┐
• start.py (Entry Point) │
• Configuration Management │
• ┬───────────────────────┘
• ↓
┌─ Application Layer ──────────────────┐
• ┌─ Factory ─────┐ ┌─ Apps ────────┐ │
• AppFactory │ │ - Cavity │ │
• ┘ │ - Poiseuille │ │
• Turek │ │
• Array │ │
• Step │ │
• ┬┘ │
• ┬──┘
• ↓
┌─ Core Simulation Layer ─────────────┐
• ┌─ Lattice ─────┐ ┌─ Physics ────┐ │
• D2Q9 Layout │ │ - TRT │ │
• Geometry │ │ - Zou-He BC │ │
• ┘ │ - IBB │ │
• ┘ │
• ┘
• ↕
┌─ Performance Layer ────────────────┐
• Numba Acceleration │
• Computational Optimizations │
• ┘
• ↕
┌─ I/O Layer ───────────────────────┐
• Results Storage │
• Visualization │
• Data Export │
• ┘
Important Elements to Highlight
a) Data Flow:
• How simulation parameters flow from the user interface through the application layer
• How computational results move through the system
• Feedback loop for visualization and analysis
b) Key Components:
• Core LBM components (lattice, collision, boundary conditions)
• Numba acceleration integration
• Relationship between different simulation apps
Implementation Details
• src/core/ contains the fundamental simulation components
• src/app/ houses the different application implementations
• src/utils/ provides supporting functionality
• src/plot/ handles visualization
Special Features to Note
• Factory pattern implementation for application management
• Modular design allowing easy addition of new simulation types
• Clear separation between core simulation logic and application-specific code
• Built-in benchmarking capabilities