Skip to content

Shock over a cylinder ​

IDGroupMilestoneBackendsFigureRegression
V6EulerM1 (#35), M3 (#47)CPU, FNLyesshock-cylinder-ib

Case and scope ​

A Mach 2 planar shock runs into a cylinder imposed by the immersed boundary, in a channel with slip walls. The flow has no closed form, but the setup is mirror symmetric about y=0.5, and so is the exact solution. The oracle asserts what the setup guarantees: the refinement, the symmetry and the positivity of the fluid.

The case exercises every immersed-boundary piece together: the distance function, the eikonal extrapolation into the solid (Jacobi sweeps) and the Euler-wall inversion, the cut spacing of the fluid cells next to the surface, the solid masks of the Runge–Kutta stages, and the solid AMR marker with the coarse–fine reflux of the refined ring.

What the case catches:

  • any defect that breaks the symmetry: indexing and ordering errors in the distance function, the eikonal extrapolation, the cut spacing or the solid marker, stencils reading the wrong ghost, data races. A wrong wall law that is itself symmetric is not caught;
  • a solid marker that misses blocks: every block crossed by the surface must be refined;
  • loss of positivity next to the surface.

Models and numerics ​

ItemChoiceCode
Equationscompressible Euler, ideal gas, γ=1.4models
Space, wenoWENO5 (weno-u-5) flux splitting on characteristic variablescompute_residuals_weno, adam_flume_cpu_object.F90
Space, weno-riemannWENO5 interpolation (characteristic), HLLC, the 6th-order flux correction with the WENO-weight sensorcompute_residuals_riemann, adam_flume_cpu_object.F90; compute_riemann_hllc, adam_flume_euler_library.F90
TimeSSP Runge–Kutta, 3 stages (runge-kutta-ssp-33), CFL 0.5adam_rk_object.F90
Immersed boundaryanalytical circle, Euler wall (bc_type = 2), n_eikonal = 2 Jacobi sweepscompute_phi_analytical_circle, evolve_eikonal, invert_eikonal, adam_ib_object.F90; numerics
AMRinit-time solid marker (blocks crossed by the surface refined once), reflux at the 2:1 facesmark_by_solid, adam_flume_common_object.F90; accumulate_coarse_flux, accumulate_fine_flux, adam_flux_register_object.F90; numerics
Boundariesinflow at xmin, extrapolation at xmax, inviscid walls in yset_boundary_conditions, adam_flume_cpu_object.F90; boundary conditions
FNL backendthe same kernels on the deviceadam_flume_fnl_object.F90

Initial and boundary conditions ​

ItemValue
Domain[0,1]2, z null
Gridoctree (the 2:1 reflux restriction needs two tangential axes), 64 blocks of 16×16×4 cells (base spacing 1/64), the blocks crossed by the cylinder surface refined once (delta_fine = 0.0078125); measured: 176 blocks, 96 crossed by the surface, 32 coarse–fine faces
Ranks2
Cylindercentre (0.5,0.5), radius 0.13, axis z; its surface crosses the block faces x=0.375 and 0.625 at a shallow angle
Post-shock state, x≤0.2 and inflow(ρ,u,p)=(3.7333,1.25,4.5) (Mach 2 shock)
Pre-shock state, x>0.2(ρ,u,p)=(1.4,0,1) (sound speed 1)
Initial conditionriemann-problem, two regions, amr_iterations = 1
Boundariesxmin inflow (post-shock state), xmax extrapolation, y wall-inviscid, z extrapolation
Final timet=0.25 (the shock has passed the cylinder; 270 steps)

Input files ​

FileRole
src/tests/flume/verification/shock-cylinder/shock-cylinder.inithe case ([solids], [solid_1] definition = analytical_circle, an [amr] solid marker)
src/tests/flume/verification/shock-cylinder/check.shV6 (--np N, --legs v6; FLUME_EXE selects the backend), mirror tolerance 10−10
src/tests/flume/verification/shock-cylinder/shock_cylinder_oracle.pythe refinement, mirror-symmetry and fluid-sanity checks; --compare for two runs
src/tests/flume/verification/riemann-flux/check.sh --legs cylinderthe same case on weno-riemann
src/tests/flume/verification/make_doc_figures.py (fig_cylinder)the figure, from the HLLC work directory of riemann-flux/
bash
cd src/tests/flume/verification/shock-cylinder && ./check.sh                  # CPU
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh                   # FNL
cd ../riemann-flux && ./check.sh --legs cylinder                              # weno-riemann HLLC

Results ​

Shock over a cylinder

Density with the block outlines (the refined ring on the surface) and Mach number at t=0.25, weno-riemann HLLC.

CheckBoundweno, CPUweno, FNLHLLC, CPUHLLC, FNL
crossed blocks refinedallpasspasspasspass
relative asymmetry about y=0.510−101.2⋅10−114.8⋅10−124.9⋅10−121.9⋅10−12
min ρ, min p in the fluidpositive, finitepositivepositive1.365, 0.968positive
CPU against FNL, relative, every field—1.1⋅10−11

Related cases: Conservation across AMR seams checks the reflux this case relies on; the regression case shock-cylinder-ib freezes the input at 120 steps.

Findings ​

  • The radius 0.13 makes the surface cross block faces at a shallow angle, so fluid and solid cells face each other across block faces. The case therefore depends on the all-solids ϕ summary in the ghost cells: with the former interior-only summary the solution moves by 3.9⋅10−2.
  • Both flux paths keep the symmetry to round-off and the fluid positive; HLLC is the more symmetric of the two.
  • The symmetry check is blind to a wrong but symmetric wall law; the case verifies the immersed-boundary plumbing, not its accuracy.