Skip to content

make_eb_converging_nozzle is an axisymmetric (lathe) geometry that only makes sense in 3D, but it compiles and runs in DIM=2 and silently builds an unrelated geometry; the shipped converging_nozzle.inp is 3D while SodPlusSphere's GNUmakefile is DIM=2 #122

Closed

Description

@WeiqunZhang

Severity: low · Category: eb
Locations: Source/EB/eb_converging_nozzle.cpp:28-54, Source/EB/embedded_boundaries.cpp:54-57, Exec/SodPlusSphere/converging_nozzle.inp:10-12,58-62, Exec/SodPlusSphere/GNUmakefile:5
Based on commit 17997db (line numbers refer to that tree).

The defect

The nozzle is built as translate(rotate(lathe(PlaneIF), 90deg, axis 1), ...) intersected/unioned with two
x-axis cylinders (eb_converging_nozzle.cpp:28-52). In 3D this is correct: LatheIF maps
(x,y,z) -> f(hypot(x,y), z) (amrex/Src/EB/AMReX_EB2_IF_Lathe.H:30-38), giving a cone about the z axis, and
rotate(..., 1) turns that axis onto x. In 2D the same AMReX classes have different semantics:
LatheIF evaluates f(hypot(x,y), 0) (a revolution about the origin, i.e. concentric circles) and
RotationIF ignores the axis argument and rotates in the xy plane (AMReX_EB2_IF_Rotation.H:35-49).
So a DIM=2 executable given CAMR.geometry = converging-nozzle runs without any diagnostic and produces a
geometry that has nothing to do with a nozzle (the "cone" degenerates into a disc-like region centred at the
translated origin, clipped by the two infinite channels).

The only shipped input for this geometry, Exec/SodPlusSphere/converging_nozzle.inp, is a 3D case
(amr.n_cell = 72 48 48, geometry.prob_lo = 0 -6 -6), but Exec/SodPlusSphere/GNUmakefile:5 says DIM = 2,
and CI compiles this directory in both 2D and 3D without ever running the nozzle input. A user who does
make && ./CAMR2d...ex converging_nozzle.inp gets the 2D nonsense with no warning (AMReX reads only the first
two entries of the 3-component geometry keys).

Why it matters

Silent wrong geometry: the run proceeds, writes plotfiles and a vfrac field, and only a look at that field
reveals that the nozzle is absent.

How to reach it

Exec/SodPlusSphere, default GNUmakefile (DIM=2, USE_EB=TRUE), ./CAMR2d.gnu.MPI.EB.ex converging_nozzle.inp.

Suggested fix

Refuse the geometry outside 3D (and document that converging_nozzle.inp needs DIM=3).

--- a/Source/EB/eb_converging_nozzle.cpp
+++ b/Source/EB/eb_converging_nozzle.cpp
@@ -14,6 +14,10 @@
  ********************************************************************************/
 void make_eb_converging_nozzle (const Geometry& geom, int required_coarsening_level)
 {
+#if (AMREX_SPACEDIM != 3)
+  amrex::ignore_unused(geom, required_coarsening_level);
+  amrex::Abort("CAMR.geometry = converging-nozzle is an axisymmetric (lathe) geometry and requires DIM = 3");
+#else
   amrex::Real d_inlet = 8;
   amrex::Real l_inlet = 24;
   amrex::Real l_nozzle = 5;
@@ -52,4 +56,5 @@
   auto polys = amrex::EB2::makeUnion(main, nozzle_exit);
   auto gshop = amrex::EB2::makeShop(polys);
   EB2::Build(gshop, geom, required_coarsening_level, required_coarsening_level);
+#endif
 }

(git apply --check OK.)

Activity

  1. added a commit that references this issue on Nov 17, 2026
    e082e76
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