SpectraSim Documentation
Wizard step

Mesh

Sets how the flow domain is meshed, builds the mesh with Generate mesh, judges it against the solver's quality limits and saves it; the run solves on the saved mesh. The step holds one container per physics that is on: the CFD mesh and the acoustic finite-element mesh, each with its own Generate button, progress, Stop and quality table, over one shared model view.

Last updated

What this step does

Flow mesh. The flow mesh is made with OpenFOAM's blockMesh and the mesher (OpenFOAM user guide, 2026): a box of cubic background cells is refined near the surfaces (castellation), snapped onto the surfaces and edges, and lined with prism layers on the walls. The settings fall into four groups:

  • Mesh size: Mesh sizing (curvature or uniform), Cells across a pipe diameter and Fineness. Curvature sizing (default) takes every size from the model: a background cell from the hydraulic diameter of the fluid volume, and walls refined where they curve until about NN cells fit across each pipe.
  • Edges: Feature angle (which surface edges are sharp features) and Edge snapping (how the mesh is pulled onto them; implicit keeps the port areas on the CAD).
  • Boundary layer: Wall treatment (wall function or resolved wall), Target y+, Number of prism layers and Expansion ratio. With curvature sizing and the wall function, the first layer is planned from the target y+y^+ at the fastest port, and the number of layers is reduced until the stack fits.
  • Interior point: Interior point, computed so that the mesher keeps the fluid and not the space around the model.

Before meshing, the step shows the estimated cell count. Generate mesh runs blockMesh, surfaceFeatureExtract, the mesher, createPatch / topoSet (when there are perforated walls or packings) and checkMesh, all serially and in a separate work folder; the live line shows the stage and the cell count. Only a finished mesh replaces the saved one, so a stopped or failed generation keeps the previous mesh. The model view can switch between the CAD and the mesh surface, and "View in ParaView" opens a clipped view of the volume mesh.

Acceptance table (quality gate 1). The mesh passes when:

  • maximum non-orthogonality is at most 70°, or at most 80° when the faces above 70° are no more than 0.01 % of all faces;
  • maximum skewness is below 4, or at most 20 when the offending faces are no more than 0.05 % of all faces;
  • at least 80 % of the wall faces keep one or more prism layers;
  • no face remains on the background box, and the mesh volume is within 3 % of the volume enclosed by the exported surface.

Advisory rows never fail the gate: the estimated wall y+y^+ against the limit of the wall treatment, layers built against requested (80 %), thickness achieved (70 %) and the layer coverage of each port rim (90 %). A failed mesh is saved for viewing with a "What to change" list, giving the first setting to try for each failed check as read from the logs. There is no automatic retry, except one new interior point when the mesher reports that the point is not inside the mesh.

Using the saved mesh. The run uses the saved mesh when its exported surfaces are those of the current case and its patches (names and types) match the boundary conditions; otherwise Start run asks whether to mesh again. A saved mesh made with other mesh settings is still used, with a note in the run log.

Acoustic mesh. With acoustics on, an "Acoustic mesh" container sets the second-order tetrahedral mesh of the acoustic model, made with Gmsh (Geuzaine and Remacle, 2009): Elements per wavelength, Maximum element size, Minimum element size, Curvature factor and Maximum element growth rate. Generate acoustic mesh builds it in the separate mesh program and saves it in the working folder; only a finished mesh replaces the saved one, and it survives a restart and travels in the project file. The element size is hmax=c/(fmaxN)h_{max} = c / (f_{max} N), with cc the lowest sound speed of the medium, fmaxf_{max} the top of the frequency range and NN the elements per wavelength. Nodes are placed on the CAD surface, so every CAD face is represented by curved elements.

The acoustic run uses the saved mesh. Without one, the run generates and saves it first. The saved mesh is *stale* when the sound speed or the frequency range now asks for smaller elements than the mesh has, when a mesh size setting changed, or, for a medium mapped from the CFD, when a newer CFD solution exists. A mesh with elements smaller than needed is still current. The step and the Start run click then offer two choices: Remesh generates a new mesh; Keep the mesh as is runs on the saved one, and the acoustic mesh-resolution gate judges it at the current fmaxf_{max}, scaling the elements per wavelength by (c/cbuilt)/(fmax/fbuilt)(c/c_{built})/(f_{max}/f_{built}); it warns below 5 and fails below 4. A changed model (CAD, face assignment, packing regions) makes the saved mesh unusable, and the run replaces it. The reference pipe of the insertion loss always builds its own mesh. In a queue or command-line run nobody is asked: a stale mesh is regenerated.

Source

The quality limits are those of quality gate 1 and of the mesh quality dictionary the program writes: the mesher snaps against 65° non-orthogonality and skewness 4, and the layer stage against 70°.

The 80° limit for isolated faces is based on case V1 (a 2.0 m multi-chamber muffler with a perforated pipe and three absorptive packings), whose perforated-wall faces reached 75.5-76.5° whatever the mesh settings.

Timing on case V3 (a two-inlet single-chamber muffler like V2, with smaller main ports; curvature sizing, default settings, serial, 810,593 cells): 280 s through Generate mesh against 263 s for the same dictionaries run by hand, of which the mesher took 254 s.

Valid range

Meshing is serial

the mesher runs on one core; parallel meshing crashed on thin and tight shapes. The solver still runs in parallel.

Time

Serial the mesher took 300-530 s per million final cells on eight meshes; the time limit of the generation scales with the estimated cell count.

Fields in this step 15

FieldSymbolUnitDefault
Cells across a pipe diameterNN8
Curvature factorfcf_cauto: 0.3 (about 21 elements around a circle)
Edge snappingimplicit
Elements per wavelengthNλN_\lambdaauto: 10
Expansion ratiorrauto: 1.2 (wall function), 1.15 (low-Re)
Feature angleθinc\theta_{inc}°60°
FinenessFF3
Interior pointxin\mathbf{x}_{in}mcomputed: the sampled interior point farthest from every surface
Maximum element growth rateggauto: 1.4
Maximum element sizehmaxh_{max}mmauto: c / f_max / N (N = elements per wavelength)
Mesh sizingcurvature
Minimum element sizehminh_{min}mmauto: maximum element size / 20
Number of prism layersnnauto: 6 (curvature, wall function, reduced to fit), 3 (uniform, wall function), 12 (low-Re)
Target y+y+y^+30 (wall function), 1 (low-Re)
Wall treatmentwall function

References 2

  1. Geuzaine, C. and Remacle, J.-F. (2009). Gmsh: a 3-D finite element mesh generator with built-in pre- and post-processing facilities. International Journal for Numerical Methods in Engineering, 79(11), 1309-1331. DOI 10.1002/nme.2579
  2. OpenCFD Ltd. (2026). OpenFOAM user guide. openfoam.com. Web page