SpectraSim Documentation
Parameter · 08 Mesh

Edge snapping

mesh.feature_snap Step 08 · Mesh

How the mesher pulls the mesh onto the sharp edges of the surface, above all the rims of the inlets and outlets. Implicit (default) finds the edges from the surface itself and keeps the port outlines on the CAD; explicit snaps to the feature-edge file made with the Feature angle.

Last updated

Theory

After castellation the mesh is a staircase of cubes; the snapping stage moves the boundary points onto the surface and, to keep corners and rims sharp, onto its edges. With implicit snapping (implicitFeatureSnap true) the mesher samples the surface near each boundary point and detects the edges geometrically; with explicit snapping (explicitFeatureSnap true) it snaps to the edges listed in the feature-edge (.eMesh) file (OpenFOAM user guide, 2026). The two are mutually exclusive: the program switches one on and the other off. The feature-edge file is used for the extra refinement level in both modes.

The difference matters for the flow through a port. A port whose rim points stay inside the CAD circle has a smaller meshed area; a fixed-velocity inlet then delivers less flow than intended, equation (1), and every velocity derived from it is off by the same ratio. A mass-flow or volume-flow inlet delivers the right flow whatever the mesh, but its velocity changes by the inverse ratio. The report compares each port's meshed area (the vector area of the patch) with its CAD area.

Equations

Qmesh=U Amesh=Qintended AmeshACADQ_{mesh} = U\,A_{mesh} = Q_{intended}\,\frac{A_{mesh}}{A_{CAD}}
(1)
wheremeaningunit
QmeshQ_{mesh}Volume flow a fixed-velocity inlet deliversm³/s
UUEntered inlet velocitym/s
AmeshA_{mesh}Vector area of the meshed port patchm²
ACADA_{CAD}Area of the port in the CADm²

Default and rule

Default
implicitMeasured
Rule

Implicit.

Source

Validation results:

  • Explicit snapping. Part of each port's rim stayed 1-5 mm inside the CAD circle, and the patch was staggered 5-10 mm out of plane. The inlet and outlet flow area of case V2 (a two-inlet single-chamber muffler with internal inlet and outlet tubes) was 0.012400 m² against 0.012862 m² in the CAD (96.4 %), and it did not converge with refinement (92.7 % and 94.1 % at 16 and 24 cells across). Neither boundary layers, multi-region snapping, a higher feature level nor more snapping iterations improved it.
  • Implicit snapping. The meshed area was 99.83-99.88 % of the CAD on V2 and 99.5-99.97 % on straight pipes, with planar port patches; layer coverage rose from 96.7 % to 98.2 %. The cost is a higher maximum skewness, 2.2 to 4.4, on 6 isolated boundary faces out of about 1 million, which quality gate 1 accepts.

Valid range implicit | explicit

Choice

Implicit or explicit.

Explicit

Expect the meshed port areas a few per cent below the CAD; a fixed-velocity inlet then delivers that much less flow. Check the "meshed vs CAD" areas in the report.

Skewness

Implicit snapping can leave a few highly skewed faces at sharp edges; gate 1 accepts up to 20 on at most 0.05 % of the faces.

References 1

  1. OpenCFD Ltd. (2026). OpenFOAM user guide. openfoam.com. Web page