Skip to content

trace_ppm floors minus-state QPRES with small_dens instead of small_pres #86

Closed

Description

@WeiqunZhang

Severity: medium · Category: correctness · Fix order: 10 of 25 — fix this 10th.

Filenames are numbered in reverse fix order: 001 = fix last, 025 = fix first. This file is 016.

Location: Source/Hydro/Godunov/PPM.cpp:398

Based on commit 8f87fa8 (line numbers refer to that tree).

The defect

What is wrong — The PPM minus-state interface pressure is floored with small_dens instead of small_pres; the sibling plus-state code (line 295) correctly uses small_pres.

Why it matters

Any Godunov run with ppm_type=1 (2D or 3D, non-EB) where traced interface pressure drops below small_dens (default 1e-7, vs small_pres default 1e-200), e.g. blast wave expanding into near-vacuum: qm pressure at a face is clamped to 1e-7 while qp at the same face is clamped to 1e-200, producing a spurious one-sided pressure jump, direction-biased Riemann fluxes, and broken left-right symmetry.

Suggested fix

Swap the floor on line 398 to small_pres so the two halves of trace_ppm agree. Every other pressure clamp in the Godunov path already uses it: the plus state (PPM.cpp:295), both reference states (221, 327), all PLM interface states (Godunov_utils_3D.H:170/226/425/472, Godunov_utils_2D.H:172/226), and the Riemann solver (Hydro_riemann.H:48-56,157). small_dens here is a copy-paste slip from the QRHO clamp on the line above; git log -S puts it in the initial import (0656702), so it predates every regression baseline and no bisect will surface it.

Two things for the maintainer to decide. With the default small_pres = 1.e-200 this effectively removes the clamp, leaving the Riemann floor as the only near-vacuum guard — if a real floor is wanted, raise the small_pres input rather than clamping a pressure with a density parameter. And ppm_type=1 answers will shift in low-pressure regions, so re-run the near-vacuum case behind #70 with the fix in. No companion change is needed.

--- a/Source/Hydro/Godunov/PPM.cpp
+++ b/Source/Hydro/Godunov/PPM.cpp
@@ -395,7 +395,7 @@
       qm(ivp1, QPRES) = p_ref + (alphap + alpham) * csq_ref;
 
       qm(ivp1, QRHO)  = std::max( qm(ivp1, QRHO), small_dens);
-      qm(ivp1, QPRES) = std::max( qm(ivp1, QPRES), small_dens);
+      qm(ivp1, QPRES) = std::max( qm(ivp1, QPRES), small_pres);
 
       // transverse velocities
       qm(ivp1, QUT) = Ip[QUT][1] /*+ hdt * Ip_src[QUT][1]*/;

Floors the minus-state interface pressure with small_pres instead of small_dens, matching the plus-state twin at line 295 and the reference-state floors (lines 221/327) in the same routine. small_pres is already a parameter of trace_ppm, so no signature or call-site change. Density floor on the adjacent line is unchanged and still correctly uses small_dens.

Diff(s) are against 8f87fa8, written from the current source and verified only with git apply --check — never compiled, never run, never applied to the tree. Treat them as precise intent, not tested patches.

Verification evidence

F031 — confirmed (one verifier lens)

Lens 1 (refutation attempt): Line 398: qm(ivp1, QPRES) = std::max( qm(ivp1, QPRES), small_dens); vs line 295: qp(iv, QPRES) = std::max( qp(iv, QPRES), small_pres);. Defaults (CAMR_defaults.H): small_dens=1.e-7, small_pres=1.e-200. All twins (PLM in Godunov_utils_3D.H lines 170/226/425/472, ref-state floors at PPM.cpp 221/327) use small_pres for pressure. Hydro_riemann.H floors pl/pr with small_pres, which cannot undo the 1e-7 clamp on qm only — asymmetric left/right pressures reach the Riemann solve when traced p < 1e-7. Unfixed since initial commit; may relate to open issue #70 in near-vacuum flows.


Based on commit 8f87fa8, which is also the tree the audit verified against. From an automated audit of Source/, Tutorials/ and Util/. Audit finding id: F031. Reviewer unit(s): Godunov-3D, PPM+PLM, theme:2d-3d-parity, theme:box-bounds-args, theme:state-comp-indexing. Nothing here was compiled or run — the failure scenarios are code reasoning, so the reaching configuration above is the cheapest way to confirm or refute it.

Activity

  1. added a commit that references this issue on Aug 23, 2026
    6b3a6cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions