Skip to content

hexmesh 0.6.0

Choose a tag to compare

@sigveka sigveka released this 12 Nov 23:34
· 301 commits to main since this release

Junction completeness.

  • Junctions: equal tees and equal laterals; tees offset off the main
    axis; angled PCF tees; shoe taps on ducts; twisted straights, and
    junctions at any roll. Every junction predicts its non-orthogonality
    before meshing. Tee meshes are the same with gmsh 4.12.1 and with
    the gmsh pip installs (4.15.2) to 1.1e-4 of the size; CI runs both.
  • From plant data: the snap tolerance is each model's own, set by
    its reader and documented; merge warns when two differ.
  • Sections: n_outer = 8, the 4-corner face cut along its grid
    lines.
  • Units and scale: hexmesh.units; plate tolerances relative to
    each face, so a tee builds down to 1:1000.
  • Docs: the gallery as three pages by family; four application
    examples; validation documented for people; hints on equipment and
    study errors.
  • Breaking: 15 error codes retired and sections.build_oh_circle8
    removed (each marked below); Tee's offset is a new parameter
    before branch, so pass branch= and later ones by keyword. Junction
    meshes move (by how much: each entry below).

A tee's circle reads go through sections.circle_radius (decision
0051; task 0151). Its backstop error is a new code,
shape_not_circular. A pipe tee's circular shells, and its branch
copying the main's, are stated 1.0 limits. Meshes unchanged.

Fixed: a tee's branch keeps its shells' given dR exactly (task
0155). A stack change on the branch line (insulation starting there)
was rejected, steel radius 0.0015000000000000013 vs 0.0015. Two
examples move by at most 1.6e-13 of their size.

merge warns when the two models' snap tolerances differ (task
0143): snap_tolerance_mismatch, naming both values, their sources and
the one kept (still the larger). The merge report records them.

Four application examples (tasks 0140, 0152, 0153, 0154).

  • rocket_injector_manifold: a liquid-oxygen ring closed on itself,
    eight injector legs, and an insulated feed line through a cavitating
    venturi; sized from NASA SP-125's worked example.
  • micromixer: the T-mixer engulfment benchmark's T (Bothe et al. 2006),
    in micrometres, then a mixing channel twisted one full turn.
  • subsea_pipeline: an insulated flowline read from a generated seabed
    survey of sand waves (read_bathymetry), turning up into a riser.
  • district_heating: a buried pre-insulated pipe with a square of near
    soil and a rectangle of far soil, both graded outward.
  • Gallery: an example may set GALLERY_COLOURS (material colours
    that mean something), and a cut-away may colour its faces by material
    ("by_material": True).

Fixed: read_bathymetry, subdividing a route, called float() on a
one-element array, deprecated in NumPy (task 0153).

Tee meshes move: interior faces are Stretch fillings (task 0145).

  • Why: with gmsh 4.15.2 (what pip install gives, built with OCC
    7.8.1) the tee's interior plate faces were different surfaces than
    with 4.12.1 (OCC 7.6.3): up to 1.5 % of the size. The junction's
    quality moved with them, and three tests failed in CI.
  • Change: a tee's interior faces are now Stretch B-spline fillings,
    as a wye's. Its wall faces are unchanged.
  • Effect: every tee and lateral mesh moves, by up to 3.3e-3 of the
    network's size (gmsh 4.12.1). Min scaled Jacobian is unchanged, and
    max non-orthogonality is equal or up to 3.4° better. The two gmsh
    versions now agree to 1.1e-4 of the size. The prediction's known
    optimism is now 3.7° (was 3.4°).
  • CI: tests run on gmsh 4.12.1 as well as on the version pip
    installs. Duct taps still use free plates: their meshes differ
    between the two versions by up to 8e-3 of the size.

Junction plates' tolerances are relative to the face (task 0139).

  • Every plate filling hexmesh makes passes tol3d and tol2d as a
    fraction of the face's extent (tol3d 1e-3, walls 1e-6; tol2d 1e-4)
    instead of gmsh's absolute defaults. tol2d, documented as
    parametric, turned out to act as a length.
  • Junction meshes move slightly: interior nodes of 11 of the 31
    examples by up to 5.2e-5 of the network's size; cell counts and
    minimum quality unchanged. Gallery regenerated.
  • A network scaled down keeps its cells and quality: the README tee
    builds down to 1:1000 (0.1 mm main radius; it failed below 1:33), and
    its nodes match the full-size mesh exactly at 1:2 and 1:4. Below about
    1:30 OCC's own fixed tolerance still moves junction nodes, by up to
    0.6 % of the size.

Validation documentation for people (task 0144).

  • validation/README.md is now a guide: what to install (OpenFOAM v2406
    by Docker, Apptainer or an installed copy), what each case costs, how
    to run one, how to read recheck's verdicts, and how to send results
    back.
  • Every validation driver takes --openfoam RUNNER, and
    HEXMESH_OPENFOAM now reaches all of them. Eight of them ignored the
    variable before. Without it, each driver's default is unchanged.
  • Every option of the drivers and of python3 -m validation.volunteer
    has help text. The volunteer page gains Before you start, and
    volunteers can run check on their own file before sending it.
  • CONTRIBUTING: most -m openfoam tests need an installed OpenFOAM;
    with Docker only they skip.

The snap tolerance is the model's, set by its reader (task 0138).

  • NetworkModel.snap_tolerance (metres) and snap_source: ends closer
    than it are one point when the model is built (or 1e-4 of the model's
    size, if larger). read_pcf(snap_tolerance=…) sets it (default 0.11",
    as before), and the import log keeps it for replay and undo;
    read_bathymetry sets the default; merge keeps the larger.
  • The build report says where the tolerance came from: tol_source
    ("given", "relative", "reader pcf", "default").
    describe(model) shows it.
  • GUIDE: How ends are connected: the snap tolerance: what it does
    and doesn't do, where 0.11" comes from, and when and how to change it.
  • Meshes unchanged: the default is the same.

The gallery is three pages, by family (decision 0050; task 0142).

  • docs/GALLERY.md is now a short landing page. docs/gallery/FEATURES.md
    groups the feature examples by family (bends, reducers and profiles,
    junctions, sections and transitions, layers, grading and resolution,
    building networks), each with links to its API sections and the
    validation cases that cover it, with their status and last run (date
    and hexmesh commit). docs/gallery/APPLICATIONS.md lists each
    application with the fittings it uses, linked to their family.
    docs/gallery/VALIDATION.md holds the validation cases and the
    coverage matrix.
  • hexmesh.examples.FAMILIES holds the families. The module paths
    (hexmesh.examples.fittings.…) are unchanged.
  • Validation feature tags gain reducer, elbow, closure and switch
    (no case covers them yet; the coverage matrix says so).

A junction face OCC refuses is retried (task 0141).

  • A tee at direction [-1, 0, -1.2246e-16] (−sin π, from trigonometry)
    failed to fill: OCC's plate filling refuses one face at a rounding-level
    change of its input. The plate is now retried at a tolerance relative
    to the face (1e-6, then 1e-3 of its size). Faces that built before
    are unchanged, so no mesh changes.

n_outer = 8 is the 4-corner mesh, cut (decision 0005; task 0088).

  • The face is the n_outer = 4 face cut along its middle grid lines:
    four core blocks around the centre, two per ring patch. Its nodes and
    cells are the 4-corner mesh's (1e-10 R in faces and one-layer sweeps;
    see the task for multi-layer slabs and second order). Every sweep
    takes it, with circular and O-H rectangular layers; junctions and the
    H layout still need 4. n_outer = 12 is rejected
    (section_not_supported).
  • Breaking: build_oh_circle8 (one 8-sided centre patch, never meshable) is gone;
    sections.build_oh_split builds the face.
  • Assembly.corrections has a sub_partition entry: the nodes set to
    the 4-corner mesh's (gmsh's own fill of a sub-patch misses it by up to
    ~1e-4 R).
  • The section period is 90° for a circle at every n_outer (decision
    0010), in PipeSpec.period and the signature; first_cell= and
    rectangle stacks take n_outer = 8.
  • n_outer = 4 meshes are unchanged (every example, byte for byte).

A tee branch with its own wall cell (decision 0028; task 0131).

  • Tee(branch_first_cell=…) or branch_mprg=: the branch port's core
    grading, blended from the main's along the branch run. Stored as
    branch_mprg; refined(k) nests it. Pipe tees with a smaller branch
    only (branch_grading_unsupported otherwise). Without it, meshes are
    unchanged.
  • Tee.strategies is per port pair: the branch pair also allows
    grading-only class 2.
  • GUIDE: the grading-only Reducer after a branch, and the fittings
    table's Reducer row (grading may change, since task 0027).

Two errors say where and what to do (decision 0042; task 0129).

  • A SplinePipe that bends tighter than the pipe names the place: arc
    length, point, and the segment points[i]–points[i+1]; where is
    {"field": "points", "index": i} (was {"field": "radius"}, which a
    spline doesn't have), or end_tangent when that causes it. The hint
    names the point to move. Bends keep their wording.
  • toward_off_allowed: the hint gives a working straight,
    Straight(L, n_layers=n), instead of Straight(…, twist=X).

Length units (decision 0047; task 0128).

  • hexmesh.units: m, cm, mm, um, inch, ft, plain floats in
    metres (radius=13.25 * mm). Not re-exported from hexmesh. The
    PCF reader, the interchange tolerance floor and the agent's advice take
    their constants from it; meshes unchanged.
  • Docs and the agent's describe now say lengths are metres: units
    is {"length": "m", …} (was "as given"), as hexmesh isn't
    scale-free (GUIDE, Current limitations).

One density per network, said up front (decision 0003 note
2026-11-10; task 0132).

  • README, GUIDE ("One density per network", with a worked example) and
    API.md state that nang and each layer's nrad are the same in every
    pipe of a connected network, what that costs, and what to do instead.
  • A count change across a fitting (switch_class_not_declared, class 2
    beyond grading, or class 3) no longer names "a density switch" or "a
    topology switch (decision 0003)", which don't exist: the message says
    no fitting makes the change, and the error now carries a hint. Code,
    where and value unchanged.

Equal tees (decision 0043 amendment 2026-11-10; task 0122).

  • Tee(branch_radius=R), the branch as wide as the main, builds: the
    oriented junction cube (Bošnjak et al. 2024), every block a transfinite
    hex. Square and centred only: an equal lateral is
    equal_lateral_angle_below_min (limits.EQUAL_LATERAL_ANGLE_MIN, 90°),
    an offset tee_offset_out_of_range. run_length=None resolves the
    length the cube needs (1.27 R bare); shorter is run_length_too_short.
  • Meshed min corner SJ 0.511 at nang 8, 0.305 at 48; checkMesh v2406
    passes. The crease where branch and main meet misses the wall by
    3.7 % R at nang 8 (1.1 % at 32). First order only:
    mesh(order=2) rejects it, as it does the wye.
  • Breaking: equal_tee_unsupported is gone: PCF equal tees are read as Tee, and
    the README's example error is now an insulated equal tee too short for
    the junction.
  • New example fittings.equal_tee.
  • A PCF junction too short for its layout (run_length_too_short,
    branch_length_too_short) now hints in the file's terms (tasks 0122,
    0125): which of the component's points to move (its END-POINTs, its
    BRANCH1-POINT, a Y piece's BRANCH1- and BRANCH2-POINTs), how far they
    are from its CENTRE-POINT and how far the junction needs them, or to
    thin its insulation; not run_length=None.
  • A reduced tee's predicted-quality hint is in plain words (task 0125):
    "a run of X m or more each side of the centre reaches it (now Y)" and
    "no run length reaches it", so a PCF user can act on it too. Codes
    unchanged.
  • Above limits.EQUAL_TEE_NANG_CLEAN (48) an equal tee warns in
    validate(), before gmsh (task 0127): its meshed SJ falls with nang
    (0.293 at 64, measured; unmeasured above 64), which the predicted SJ
    doesn't see.

What hexmesh changes in gmsh's mesh (decision 0046 rule 5; task 0123).

  • Assembly.corrections, after mesh(): for every fitting, the wall
    nodes projection moved and the second-order wall nodes placed (count,
    largest move absolute, in wall radii and in edge lengths), or "none",
    and the elements hexmesh wrote (0 today). In QualityReport.corrections
    and its printed table, and in the CLI's build result.
  • Notices: Assembly.notices (HexmeshNotice, not a warning) from
    validate(), and notices in the CLI's validate result. The one
    notice, elements_written_by_hexmesh, waits for task 0124's opt-in.
  • limits.CORRECTION_MIN_MOVE (1e-9 wall radii): the smallest move the
    record counts.
  • second_order_arc_nodes (task 0130; decision 0046 amendment
    2026-11-10): a bend's high-order nodes placed on its arcs at
    order=2, in the same form. A bend at order 2 no longer says "none".
  • Second order is verified with FEniCSx (task 0077) on straights, bends
    and tees (Hex27); API.md and GUIDE say so, and what it isn't verified
    for.

Volunteer runs (decision 0044; task 0119).

  • python3 -m validation.volunteer: list, prepare, run, collect
    and check, so someone with cluster time can run a held validation
    level and send back one .contrib.json, checked mechanically (schema,
    mesh hash, the level's own numbers, the stored level) and merged with
    the contributor's credit. validation/VOLUNTEERS.md is generated from
    the cards; the helical pipe's Re 3000, nang 24 level is the first.
  • OpenFOAM runners: path (OpenFOAM already loaded) and
    apptainer:<image> (unverified until a first run), and the native
    runner's bashrc from HEXMESH_OPENFOAM_RC. require_version refuses
    another OpenFOAM version (openfoam_version_mismatch).

Shoe taps on ducts (decision 0031 stage 4; task 0063).

  • Tee(angle=…) on a rectangular main: the branch leans downstream, its
    hole the branch section cut by the face (stretched by 1/sin α; an
    exact ellipse for a round branch). Rectangular, round and full-width
    taps, either face, O-H and H mains. Walls stay exact, with no node
    projection. angle=90 meshes exactly as before.
  • The room checks measure the hole's acute end, with hints;
    run_length=None resolves it. Below about 45° the quality tiers warn,
    naming a larger angle.
  • Breaking: angle_on_duct_tap is retired; an angle outside (0, 90] raises
    tee_angle_out_of_range, as on pipes.

Twisted straights, and junctions at any roll (decision 0031 stage 3;
task 0062).

  • Straight(twist=…) rotates the section about the axis, linearly from
    inlet to outlet, with a station per axial layer: every node is on an
    exact station face. Shells, ducts, grading and stack_changes work.
    twist=0 meshes exactly as before.
  • Limits (proposed to design): the roll per axial layer warns above
    STRAIGHT_TWIST_WARN (15°) and raises above STRAIGHT_TWIST_MAX (30°,
    twist_per_layer_above_maximum), naming the n_layers that passes.
    The wall shear (twist per length) is predicted before GMSH
    (section_quality.twist_quality) and goes through the usual SJ and
    non-orthogonality tiers, naming the length or twist that passes.
  • A Tee or Wye with toward= between the period's rolls now twists
    the untwisted Straight before it by the rest, and the stored network
    holds both numbers. Otherwise add() names the twist needed and where.
  • PCF: a set-on at an odd roll twists its host's upstream piece.

Offset taps (decision 0031 stage 2; task 0061).

  • Tee(offset=…) moves the branch axis off the main axis, along the
    main's right after the roll, for tees and laterals. The saddle is the
    exact intersection of the offset cylinders. offset=0 meshes exactly
    as before (bit-identical nodes).
  • Breaking for a call by position only: offset sits after angle,
    so a branch, face, … given by position now lands one parameter
    early. Pass them by keyword (every example and test does).
  • Range: |offset| + branch_radius < R, and |offset| ≤ limits.TEE_MAX_OFFSET_RATIO × branch_radius (1.0, proposed to
    design). Past h = r OCC's face fills fail erratically. Both raise
    tee_offset_out_of_range. Duct taps reject offset
    (offset_on_duct_tap).
  • Quality falls slowly with the offset: at 90°, r/R 0.5, the predicted
    min SJ is 0.258 at h/R 0 and 0.209 at 0.4.
  • PCF: offset set-ons (TOSO, TORF) now build, their offset measured
    from the branch straight. Tangential ones (TTSO, TTRF) are
    rejected by the offset range. Breaking: seton_offset_unsupported is retired;
    seton_offset_branch names a set-on without a branch straight, or
    whose branch axis misses its centre.

Hints for equipment and study errors (decision 0040; task 0111).

  • 14 of the drum's 23 errors and 8 of the study file's 18 now carry a
    hint saying what to change. Examples: the axial range a shell nozzle
    fits in, the largest head offset, a Klöpper head's radii for a
    torispherical drum, and "rename 'paramters' to 'parameters'". Messages
    are unchanged.
  • Breaking: 12 codes retired. A block layout that breaks its own rules
    (topology, cell counts, binding) is a bug in a fitting, not the user's
    input, so it is now an InternalError (internal_invariant) asking
    for a report. No shipped fitting reaches these errors: they come only
    from hand-built layouts. The retired codes: block_vertices_not_distinct,
    block_division_conflict, block_grading_conflict,
    block_division_missing, block_layout_empty, block_vertex_unplaced,
    block_face_shared, block_port_face_unused,
    block_port_face_interior, block_port_faces_unbound,
    block_h_core_in_ring and port_roll_not_a_period. block_inverted
    stays a LayoutError.

Junctions predict non-orthogonality (decision 0031; task 0104).

  • validate() predicts a tee's, a duct tap's or a wye's worst
    non-orthogonality before GMSH, from its block layout. It warns above
    OUTLINE_NONORTH_WARN (70°) and rejects above OUTLINE_NONORTH_MAX
    (80°) with the new code predicted_nonorth_above_maximum. The message
    names the block and what lowers it.
  • The prediction can be up to 3.4° optimistic at r/R ≥ 0.6, so
    mesh() also checks each junction's meshed non-orthogonality on the
    same tiers, as for switches. It adds a warning only where the
    prediction didn't already give one.
  • The wye only warns, as for its scaled Jacobian, until its layout
    redesign.
  • New warnings on existing networks. Every wye warns (72–82°), so
    these examples now warn: fittings.wye, fittings.junction_walls
    (its 30° wye, 81.8°), sections.insulated_network,
    networks.bifurcation_tree and applications.cooling_channels.
    Tees with r/R about 0.3 and narrow-face duct taps also warn. No
    example newly errors.

The network builder reads angled tees (decision 0031; task 0103).

  • A PCF TEE whose branch leans becomes a lateral, Tee(angle=…), at
    the angle measured between the branch and the downstream run. Set-ons
    (TEE-SET-ON, OLET) lean the same way, and their host is split
    around the run the lean needs.
  • Within 1° of square a tee is a plain 90° tee, as before. Every
    existing network builds the same assembly.
  • The Tee rejects what it can't mesh at validate(), by its quality
    tiers. The message gives the angle, the smallest r/R that passes
    there and the file's line: a 35° lateral needs r/R 0.876.
  • tee_branch_angled now means a branch leaning upstream of the
    build direction, which no Tee builds. Its hint is to build from the
    other end (inlet=). The code stays.