How ivanzanardi/hypersonicfoam works
Project type and purpose
• HypersonicFOAM is an open-source, C++-based suite of high-performance computational fluid dynamics (CFD) solvers built on the OpenFOAM framework.
• It comprises two main modules:
• hyStrath – the core library of object-oriented CFD components (finiteVolume, turbulenceModels, functionObjects, fvOptions, hTCModels, mhdModel, thermophysicalModels) plus solvers (hyFoam, hy2Foam, hy2MhdFoam) and utilities.
• hyPoliMi – an extension with a specialized supersonic reacting solver (rhoCentralReactingFoam) and case-management scripts.
File structure
• Top-level directories:
• hyStrath/
– applications/solvers & utilities/mesh generation: C++ executables and mesh tools.
– compilers/: build orchestration scripts (Allwmake).
– src/: modular libraries (turbulenceModels, finiteVolume, functionObjects, fvOptions, hTCModels, mhdModel, thermophysicalModels).
– run/: example cases with system, constant, 0.bak subdirectories, gnuplot and ParaView files.
– install-*.sh: installer scripts.
• hyPoliMi/
– applications/solvers/compressible/rhoCentralReactingFoam/: source, headers, Makefiles.
– run/: simplified example cases (shockTube).
– install.sh, run scripts.
Extract README insights
• Dependencies: OpenFOAM (v1706 for hyStrath, v1912 for hyPoliMi).
• Build instructions: Allwmake and install.sh drive parallel compilation.
• Features: plugin schemes (Kurganov, electron-ion models, mixing rules), extensions for magnetohydrodynamics.
a. Main components
• External dependency: OpenFOAM core libraries and runtime.
• Build system: Bash scripts (install-*.sh, Allwmake, Makefiles per module).
• Core libraries (hyStrath/src modules):
• finiteVolume
• turbulenceModels
• functionObjects
• fvOptions
• hTCModels
• mhdModel
• thermophysicalModels
• Solver executables: hyFoam, hy2Foam, hy2MhdFoam, rhoCentralReactingFoam (hyPoliMi).
• Utilities and mesh generators.
• Case-management: run/ directories, sample input files (0, constant, system), post-processing scripts (gnuplot, ParaView).
b. Relationships and interactions
• Build scripts invoke Makefiles in each module → compile core libraries → link solver executables.
• Solvers link against OpenFOAM APIs and core libraries.
• User runs install.sh → deploys executables.
• run/ scripts call solver executables with case directories → produce output fields.
c. Architectural patterns/design principles
• Modular, plugin-style C++ directories: each physics model lives in its own folder, with its own Make/options.
• Object-oriented inheritance for boundary conditions (fvPatchFields), solvers, numerics.
• Separation of concerns: core CFD kernels (finiteVolume) vs. physics extensions (hTCModels, mhdModel) vs. utilities.
• Consistent build pattern: Allwmake orchestrates per-module Makefiles.
d. Key technologies/frameworks
• C++ (OO patterns, templates).
• OpenFOAM library.
• GNU Make, custom Make/options.
• Bash scripts for installation and case execution.
• Gnuplot, ParaView for post-processing.
Detail
• That hyStrath’s utilities mesh generators feed mesh data into solvers.
• Parallelization parameter (<np>) passed through install scripts into Makefiles.