Skip to main content

Cylinder

⚠️ NOTE: These are advanced workflow examples showing direct solver access, stability analysis, and specialized control. They do NOT use the standard RL interface.

Looking for standard RL examples? See Getting Started for env.reset() / env.step() interface.


Flow around a circular cylinder is a canonical benchmark in fluid mechanics and flow control.

Physical Description

Configuration:

  • Circular cylinder (radius = 0.5) in 2D
  • Uniform inflow from left (U∞ = 1.0)
  • Reynolds number Re = 100 (default)

Actuation:

  • Jet blowing/suction (Cylinder class): Two 10° jets at ±90° from stagnation point
    • Used in: solve-steady.py, unsteady.py, step_input.py, pressure-probes.py
  • Rotary control (RotaryCylinder class): Tangential velocity on cylinder surface
    • Used in: run-transient.py, pd-control.py, pd-phase-sweep.py, lti_system.py

Note: Both actuation types can suppress vortex shedding, but use different physical mechanisms.

Quick Start

1. Basic Vortex Shedding

Run uncontrolled flow at Re=100 to observe natural vortex shedding:

python run-transient.py

What it does: Simulates uncontrolled cylinder flow showing oscillating lift/drag from vortex shedding Outputs: Checkpoints for restart, console shows CL/CD time series Prerequisites: None

2. Find Steady State

Solve for the unstable steady state at Re=100 using Newton iteration:

python solve-steady.py

What it does: Computes unstable equilibrium (saddle point) for stability analysis Outputs: output/cylinder_Re100_steady.h5, Paraview files Prerequisites: None

3. Observe Instability Growth

Two-stage simulation: steady solve + perturbed transient:

python unsteady.py

What it does: Demonstrates transition from steady state to limit cycle (vortex shedding) Outputs: Time series, Paraview animations Prerequisites: None (computes steady state internally)

4. Stability Analysis

Compute eigenvalues/eigenmodes using Arnoldi iteration:

python stability.py

What it does: Linear stability analysis - finds growth rates and frequencies Outputs: Eigenvalues (growth rate, frequency), eigenvectors Prerequisites: Optional checkpoint from solve-steady.py (or computes internally)

5. Apply PD Control

Suppress vortex shedding using feedback control:

python pd-control.py

What it does: Demonstrates feedback control (off→on) to stabilize unstable flow Outputs: Time series showing oscillation suppression Prerequisites: REQUIRED - Must run run-transient.py first for checkpoint


MPI Parallelization: All scripts support parallel execution:

mpirun -np 4 python <script-name>.py

Complete Script Reference

ScriptPurposeKey FeaturesPrerequisites
solve-steady.pyCompute steady-state flowNewton solver, Reynolds rampingNone
unsteady.pySteady→unsteady transitionTwo-stage: Newton + transientNone
run-transient.pyBasic time integrationSimple vortex shedding demoNone
stability.pyLinear stability analysisEigenvalues, eigenmodes (direct/adjoint)Optional steady checkpoint
step_input.pySystem identificationStep response for control designNone
pressure-probes.pyPoint measurementsDemonstrates sparse sensingNone
pd-control.pyFeedback controlPD controller with on/off phasesRequires run-transient.py checkpoint
pd-phase-sweep.pyController tuningSweeps phase angles for optimal gainRequires run-transient.py checkpoint
lti_system.pyModel linearizationExtracts base flow + control influenceNone