Automated CFD Simulation Pipeline
- Automatic CFD Simulation Routine is an integrated pipeline that automates geometry import, mesh generation, BC assignment, solver configuration, and post-processing for reproducible high-fidelity simulations.
- The method employs modular scripting to automate case preparation, physiological parameter integration, and parallel execution using MPI, reducing manual error and setup time.
- Its extensible architecture supports rapid adaptation to diverse biomedical and engineering applications, ensuring efficient and accurate simulation outcomes.
An automatic CFD simulation routine is an integrated computational framework that orchestrates geometry import, mesh generation, boundary condition assignment, solver configuration, parallel execution, and result post-processing with minimal or no manual intervention. Such pipelines combine domain-specific automation tools, physiological or empirical parameter integration, customized solver configuration, and scripting for robust, reproducible, and efficient high-fidelity simulations—exemplified by systems such as CoronaryHemodynamics for coronary artery hemodynamics in OpenFOAM (Mao et al., 2 Jan 2025). The objective is to transition from labor-intensive, error-prone manual workflows to fully automated, end-to-end CFD pipelines suitable for advanced biomedical, engineering, or clinical applications.
1. Modular Architecture and Workflow Orchestration
CoronaryHemodynamics implements a modular pipeline composed of specialized stages executed in a sequential, script-driven workflow. Core modules include:
- casePreparer: Automates geometry cleaning, identifies boundary zones, and calculates Windkessel boundary condition (BC) parameters using physiological metrics.
- cartesianMesh: Employs cfMesh to generate body-fitted Cartesian meshes based on provided geometry and a user-configurable mesh parameter file (MeshInfo).
- initializeFields / changeDictionary: Bootstraps OpenFOAM field files (“0”-folders), injects derived BCs, and updates solver dictionaries (controlDict, fvSchemes, fvSolution).
- decomposePar: Automatically decomposes the domain for distributed-memory execution and MPI parallelization.
- simpleCoronaryFoam / pimpleCoronaryFoam: Custom solvers (steady-state SIMPLE or transient PIMPLE) integrating physiological outflow (Windkessel) and inflow (parabolic law) boundary conditions.
- Orchestration: All modules are invoked via a shell script (e.g.,
runCoronary.sh) with well-defined invocation order for steady or transient regime.
This structured approach guarantees rapid, reproducible, and expert-level simulation set-up from standard @@@@4@@@@ geometry inputs through to high-fidelity CFD outputs.
2. Automated Case Setup: Geometry Import and Mesh Generation
Geometry preprocessing is invoked via convention-based STL file import. Inputs follow strict naming (e.g., Cap_Aorta.stl, Cap_LAD_D1.stl, Wall_CoronaryTree.stl). The pipeline maps these to OpenFOAM patch names, parsing a GeometryFiles configuration.
Mesh generation uses cfMesh via the cartesianMesh application, driven by a MeshInfo file:
1 2 3 4 |
meshSize 0.0005; minFeatureSize 0.0001; nRefinement 3; surfaceSmoothing true; |
Mesh quality is enforced by cfMesh default constraints:
- Non-orthogonality < 65°
- Skewness < 4
- Aspect ratio < 10
The automated approach eliminates manual intervention in geometry cleaning, mesh sizing, and refinement application, ensuring robust spatial discretization congruent with complex vascular topologies.
3. Boundary Condition Configuration and Physiological Integration
CoronaryHemodynamics automates configuration of both the inlet (aorta) and multiple outlets (coronary arteries):
- Inlet: Parabolic velocity profile, with instantaneous flow rate prescribed by a waveform file (scaled_pulse_flow.flow). The velocity law is
- Outlets: Implements both two- and three-element Windkessel models governed by:
Outlet resistance and compliance parameters are derived automatically from patient metrics via Murray’s law and tabulated ratios.
Boundary condition code snippets are programmatically injected into OpenFOAM dictionary files, with all parameters either computed or auto-filled from templates.
4. Solver Configuration and Numerical Parameters
Solvers are tailored to the haemodynamic regime:
- Governing Equations: Newtonian, incompressible Navier–Stokes (steady or transient)
- Solvers:
simpleCoronaryFoamfor steady-state problems (SIMPLE loop)pimpleCoronaryFoamfor time-dependent simulations (PIMPLE loop)
- Numerical Controls: (From fvSchemes, fvSolution)
- Time-step s (transient)
- Primary residual convergence:
- Pressure: GAMG, DIC smoothing; Velocity: smoothSolver, DILU
- PIMPLE loop with 2 outer correctors, 3 correctors, 1 non-orthogonal corrector
Configuration files are generated and updated automatically, enabling rapid transition between solution regimes and direct adaptation to new vascular domains.
5. MPI Parallelization and High-Performance Execution
Full support for distributed execution across multiple cores is achieved via OpenFOAM’s decomposePar utility, configured in decomposeParDict:
1 2 |
numberOfSubdomains 8; method scotch; |
1 2 3 |
decomposePar mpirun -np 8 pimpleCoronaryFoam -parallel reconstructPar |
6. Automation Scripting, Extensibility, and Reproducibility
Every element is script-driven, typically via a shell driver such as runCoronary.sh. This script chains case preparation, mesh generation, field initialization, dictionary injection, parallel decomposition, simulation, and post-processing:
1 2 3 4 5 6 7 8 |
casePreparer cartesianMesh initializeFields changeDictionary decomposePar mpirun -np 8 pimpleCoronaryFoam -parallel reconstructPar foamToVTK |
7. Post-Processing and Output Management
Primary solution fields (pressure , velocity , wall shear stress) and time-series at boundary caps are automatically extracted and stored for analysis. Standard OpenFOAM probe functionObjects are used:
1 2 3 4 5 6 7 8 9 10 11 12 |
functions
{
outletProbe
{
type probes;
libs ("libsampling.so");
fields (p U);
probeLocations ((0.1 0 0) ...);
outputControl timeStep;
outputInterval 1;
}
} |
postProcessing/probes/ and time directories. Visualization is automated via ParaView or Python scripting, enabling rapid generation of figures such as wall shear stress maps:
1 2 3 4 5 6 7 |
from paraview.simple import * reader = OpenFOAMReader(FileName="case.foam") reader.MeshRegions = ['internalMesh'] Show(reader) ColorBy(reader, ('POINTS','wallShearStress')) Render() SaveScreenshot("WSS.png") |
In summary, an automatic CFD simulation routine as realized in CoronaryHemodynamics (Mao et al., 2 Jan 2025)—and generalizable to other vascular or physical domains—embeds robust automation at each pipeline stage: geometry acquisition, mesh generation, physiological boundary condition assignment, solver deployment, high-performance parallelization, and post-processing. By enforcing strict conventions, templated configuration, and script-driven workflow execution, the framework ensures reproducibility, extensibility, and efficiency, advancing both research and clinical simulation capabilities in hemodynamics.