Numerical Investigation of Flow Past a Circular Cylinder using OpenFOAM
Development of a fully parameterised, block-structured meshing and automated simulation framework for incompressible bluff-body flow analysis in OpenFOAM.
- Reynolds numbers
- 20 to 4500
- Mesh topology
- Double O-Grid
- Blockage ratio
- 5.0%
Motivation
The study of flow around bluff bodies, particularly the circular cylinder, is a foundational pillar of applied fluid mechanics. In engineering, cylindrical cross-sections appear in offshore risers, heat-exchanger tubes, and marine mooring cables. The alternating pressure loading from periodic wake shedding can drive resonant structural vibrations—known as vortex-induced vibration (VIV)—which significantly impacts structural fatigue life.
However, computational studies of these flows are often limited by the immense manual effort required to generate consistent, high-quality meshes across various Reynolds numbers and resolutions. This project, completed during a research internship at the University of Split, resolves that bottleneck by developing a fully parameterised, block-structured meshing and case-automation framework in OpenFOAM. This infrastructure bridges the gap between traditional CFD and large-scale data generation, allowing rigorous verification of mesh independence, temporal convergence, and turbulence model sensitivities without manual intervention.
Methodology
To maintain total geometric consistency across the campaign, the computational domain and grid were completely analytically driven via OpenFOAM’s #calc macro within a central geometryProperties dictionary.
- Parametric Double O-Grid Topology: Instead of a standard single H-grid that introduces highly skewed cells near the cylinder wall, the near-body mesh was constructed using two concentric rings of four hexahedral blocks (a double O-grid). The inner ring resolves the viscous sublayer, while the outer ring acts as a transition buffer into the far-field H-grid.
- Continuous Mesh Grading: Cell counts and grading expansion ratios were derived mathematically from a matched interface cell width. This ensures smooth cell size continuity across all internal block boundaries.
- Three-Dimensional Base: Rather than a strict 2D empty planar assumption, the mesh resolves the spanwise direction with multiple cells (), establishing a genuine 3D framework ready for future Large Eddy Simulation (LES) extensions.
Automated Simulation Campaign Framework
A robust suite of Bash and Python scripts was engineered to handle unattended, fault-tolerant execution of massive parametric sweeps. A central cases.csv schema dictates physical states, temporal discretizations, solver binaries, and grid parameters.
The primary execution driver, runCases.sh, uses a template-copy architecture. It clones a pristine baseCase, injects the CSV parameters iteratively, executes blockMesh, parallelizes the domain with decomposePar, runs the solver via MPI, and finally reconstructs the data.
Essential Automation Commands
1. Campaign Execution (runCases.sh)
The main script automates execution over specified cores and case filters.
# Run the full campaign pipeline on 8 parallel cores
./runCases.sh --parallel 8
# Run only a specific Reynolds number case subset
./runCases.sh --parallel 8 --label case_Re500000
2. Case Cleanup (cleanCases.sh)
To clean previous simulation results and logs safely without damaging the baseCase:
# Clean all generated cases and logs
./cleanCases.sh --all
# Clean a specific case and results directory
./cleanCases.sh --label case_Re500000 --results
3. Post-Processing & Visualization (postProcess.py & touch_foam.sh)
To automate ParaView .foam initialization and Python-based data extraction (Strouhal number, , , ):
# Generate marker files for quick ParaView loading
./touch_foam.sh
# Run automated Python data extraction and plot generation
python3 postProcess.py
Results & Numerical Assessment
The framework’s capability was validated through rigorous, automated sensitivity assessments evaluating Reynolds numbers ranging from creeping flow to turbulent regimes.
- Low-Reynolds Validation: A baseline test at successfully matched reference analytical drag coefficients ( vs theoretical ), yielding an absolute error of just ~5.7%. The steady case yielded an error of just 0.2%.
- Numerical Scheme Sensitivity: We identified deep dependencies on temporal discretization. Adjusting the Crank-Nicolson blending coefficient from 0.2 to 0.8 at forced a systematic drift, highlighting the risk of overlooking temporal configuration during verification.
- Grid & Temporal Independence: At using
pimpleFoam, mesh refinement studies identified a “G3” mesh (96,000 cells) and a timestep of s as the optimal balance between computational overhead and force coefficient stabilization. Scaling from 4 to 6 cores on this mesh yielded a 44% reduction in execution time. - Turbulence Modelling (RANS): Standard simulations displayed correctly decreasing mean drag ( to ) from to . Conversely, the SST model evaluated at higher regimes () predicted abnormally high Strouhal numbers () and an artificially coherent 2D wake. This critical finding proved that solely swapping RANS closures cannot supplant the physical necessity of 3D modeling and spanwise vortex dislocation in higher transition regimes.
Ultimately, this parametric infrastructure paves a seamless, version-controlled runway for the future deployment of Three-Dimensional RANS and LES on high-performance computing clusters.
💻 View Repository on GitHub
Related Projects
Numerical Investigation of Particle Packing and Flow Dynamics in Fixed Bed Reactors
A comprehensive computational investigation integrating DEM and CFD to evaluate the hydrodynamic and thermal performance of packed bed reactors using hollow cylindrical and trilobe-shaped catalyst pellets.
On the Hydrodynamics of Foiling Craft: PID Control System Development
Development of a coupled CFD-PID control framework to regulate hydrofoil angle of attack for stable ride height and trim under steady, unsteady, and multiphase flow conditions.