Skip to content

Add Sod shock tube tutorial case - #91

Open
PraptiPatra wants to merge 1 commit into
su2code:developfrom
PraptiPatra:feature/sod-shock-tube
Open

PraptiPatra wants to merge 1 commit into
su2code:developfrom
PraptiPatra:feature/sod-shock-tube

Conversation

@PraptiPatra

@PraptiPatra PraptiPatra commented Dec 2, 2026 •

Copy link
Copy Markdown

Proposed Changes

  • Adds a new tutorial case under compressible_flow/Sod_Shock_Tube/ for the Sod shock tube problem (unsteady 1D Riemann problem).
  • Includes the configuration file and a 400-cell mesh for the unsteady compressible inviscid simulation (explicit Runge-Kutta, ROE + MUSCL with the VENKATAKRISHNAN_WANG limiter).
  • Provides a restart CSV (solution_flow_00000.csv) containing the piecewise-constant initial condition, since the two initial states cannot be specified directly through the configuration file.
  • Includes Python scripts to regenerate the mesh and initial condition (make_mesh.py, make_ic.py), compute the exact solution and the error (compare_exact.py), and reproduce the scheme, limiter and mesh-convergence studies shown on the tutorial page (run_study.py, plot_study.py).

The case runs in a few seconds and matches the exact solution closely, with a density L1 error of 2.16 × 10⁻³ kg/m² on the 400-cell mesh.

Related Work

Since TestCases/tutorials.py runs the tutorials in SU2's CI, I'm happy to open a follow-up PR in su2code/SU2 adding a regression entry for this case if that would be useful.

Unsteady 1D Riemann problem (Sod 1978) solved with the compressible Euler
solver on a one-cell-high strip, with explicit Runge-Kutta time stepping
and ROE + MUSCL + Venkatakrishnan-Wang.

- sod.cfg, sod_400.su2: configuration and 400-cell mesh
- solution_flow_00000.csv: discontinuous initial condition as an ASCII
  restart file (SU2 has no config option for a two-state initial state)
- make_mesh.py, make_ic.py: regenerate the mesh and initial condition
- compare_exact.py: exact Riemann solution and L1 density error
- run_study.py, plot_study.py: scheme, limiter and mesh-convergence study

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bigfooted

Copy link
Copy Markdown
Contributor

Since TestCases/tutorials.py runs the tutorials in SU2's CI, I'm happy to open a follow-up PR in su2code/SU2 adding a regression entry for this case if that would be useful.

Yes, please add it to the tutorial regression tests. When that PR is up, we can merge this one and couple it together.

@PraptiPatra

Copy link
Copy Markdown
Author

Thanks for the review! I've opened [su2code/SU2#3057 · Add Sod shock tube tutorial to…], which adds the case to TestCases/tutorials.py. It runs the full 1000 time steps (about 1.4 s on 2 ranks) and checks the final density residual; I verified it locally with the regression harness.

PraptiPatra added a commit to PraptiPatra/SU2 that referenced this pull request Dec 3, 2026
Adds the Sod shock tube case (su2code/Tutorials#91) to TestCases/tutorials.py.
The test runs the full 1000 explicit time steps (about 1.4 s on 2 ranks) and
checks the physical time and the density RMS residual at the last step.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants