How gustavoverneck/lattelab works
Main Components
a. Application Entry Point:
• Main binary (src/main.rs) which initializes and controls the simulation flow.
b. LBM Core:
• Detail the simulation engine components contained in src/core. Break these down as follows:
• kernels.rs: Represents the mathematical kernels or collision/streaming operations crucial to LBM.
• lbm.rs: Contains the core LBM simulation logic implementing the fluid dynamics algorithms.
• mod.rs: Acts as the organization module for all core functionality.
• That these modules implement the key computational routines and simulation steps.
c. Utilities:
• Src/utils as the repository for supportive functions:
• terminal_utils.rs: Responsible for any CLI/terminal interaction, debugging, or logging outputs.
• velocity.rs: Likely handles computations related to velocity vectors or fluid dynamics properties.
• mod.rs: Organizes the utility functions and makes integration easier with the core simulation.
d. Supporting Components:
• Examples: The examples directory illustrates different simulation setups (e.g., liddriven_cavity.rs, taylor_green_vortex.rs). Represent these as sample clients interacting with the LBM Core.
• Documentation & Licenses: Although not code components, these support understanding, maintenance, and contribution.
Establish Relationships and Data Flow
• Examples as separate client nodes that demonstrate integration with the core simulation engine.
Architectural Patterns and Design Principles
• Modularity: Separate the core simulation logic (LBM Core) from utility helper functions (Utilities). This separation exemplifies clean modular design.
• Potential use of the MVC (or a similar separation of concerns) pattern where the simulation data (model) is manipulated by the LBM core and then processed or output via utilities/plotting.
• Extensibility points especially in the LBM Core where additional kernels or simulation methods might be integrated in future updates.
Relevant Technology & Frameworks
• That the project is built in Rust and relies on Rust’s package management and build system (Cargo).
• Planned support for OpenCL for GPU acceleration even if not immediately visible in the code structure. This could be represented as an external service/component that the LBM core might interact with in subsequent versions.