How sumukhashridhar/flug works
Project type and purpose
• Fluidchen is a C++ scientific computing application—a computational‐fluid‐dynamics (CFD) solver framework that evolves from a sequential implementation to a parallel MPI‐enabled solver.
• The code base is structured as a modular, pipeline‐style solver: it reads a “case” file, builds the computational grid and data structures, applies discretization, solves the pressure and velocity fields, and writes results (via VTK) to disk.
File‐structure analysis
• Top‐level:
• CMakeLists.txt, .gitlab‐ci.yml, Doxyfile, formatting tools → build, CI, and documentation infrastructure.
• / and src/ → core solver modules (headers and implementations).
• example_cases/ → input data sets (.dat) and reference geometry (.pgm).
• results/ → placeholder for output directories (e.g. VTK files).
• tools/ → formatting scripts.
• Key modules (in include/ and src/):
• Case: parameter parsing and scenario setup
• Domain, Grid, Cell: mesh and geometry representation
• Fields: velocity, pressure data structures
• Discretization: stencil coefficients, time stepping
• PressureSolver: Poisson solver (sequential or parallel)
• Communication: MPI wrappers for halo‐exchange (once parallelized)
README insights
• Describes external dependencies: GCC/Clang, CMake, VTK (for I/O), and OpenMPI (for parallel runs).
• Builds a single executable (fluidchen) that takes a .dat case file and generates VTK output.
Main components and interactions (to capture
a. Fluidchen Executable (CLI)
• Input: .dat case file
• Parses into a Case object
b. Case Module
• Defines physical and numerical parameters
• Selects geometry file if present
c. Domain & Grid Module
• Reads geometry (.pgm)
• Builds mesh cells
d. Fields Module
• Initializes velocity and pressure arrays
e. Discretization Module
• Assembles finite‐volume matrices
• Calls PressureSolver
f. PressureSolver Module
• Solves linear system (sequential or MPI)
• Uses Communication module for ghost exchange in parallel
g. I/O Layer
• VTK library integration → writes .vtk files per time step
h. External Services
• MPI runtime (when enabled)
• VTK library (compile‐time dependency)
Architectural patterns and principles
• Pipeline pattern: sequential stages (Setup → Discretize → Solve → Output).
• Modular separation by responsibility (parsing, mesh, solver, I/O).
• Strategy/Factory in Case to pick different flow scenarios.
• (Future) Master‐Worker communication for domain decomposition with MPI.