SpectraSim Documentation
Parameter · 08 Mesh

Interior point

mesh.location_in_mesh Unit: m Step 08 · Mesh

A point inside the fluid that tells the mesher which side of the surface to keep (locationInMesh). The program computes it; it is shown as a red dot in the model view. It cannot be typed.

Last updated

Theory

The mesher refines the background box around the surfaces, cuts the cells the surfaces cross, and then keeps only the region of cells reachable from the cell that contains the interior point (OpenFOAM user guide, 2026). If that cell lies on the wrong side of the surface, the OUTSIDE of the muffler is meshed instead, and the mesh can still pass every cell-quality check.

The program therefore picks the point as far as possible from every surface:

1. It samples the bounding box of the combined surface (its centre and 1,500 random points). 2. It keeps the points that a ray-cast test finds inside the closed surface. 3. It measures each point's distance to the outer skin and to every internal and perforated wall. 4. It takes the point with the largest clearance, equation (1).

A point closer to a wall than about one background cell can land in a background cell that the wall cuts, and the mesher may then keep the wrong side.

Generate mesh always computes the point again for the exported surfaces, so a point computed earlier with "Compute verified interior point" is a preview. If the mesher still reports that the point is not inside the mesh, the program computes another well-centred point (one of the five with the largest clearance) and meshes once more.

Quality gate 1 then checks that the mesh is the fluid: no face may remain on the background box's own patch, and the mesh volume must agree with the volume enclosed by the exported surface, equation (2).

Equations

xin=arg⁡max⁡xk∈Ω min⁡s d(xk,Γs)\mathbf{x}_{in} = \arg\max_{\mathbf{x}_k \in \Omega} \ \min_{s} \ d(\mathbf{x}_k, \Gamma_s)
(1)
wheremeaningunit
xin\mathbf{x}_{in}Chosen interior pointm
xk\mathbf{x}_kSampled points (box centre and 1,500 random points) that test insidem
Ω\OmegaVolume enclosed by the combined surface-
Γs\Gamma_sOuter skin and each internal or perforated wall-
ddShortest distance from the point to that surfacem
∣Vmesh−VCAD∣VCAD≤0.03\frac{\lvert V_{mesh} - V_{CAD} \rvert}{V_{CAD}} \le 0.03
(2)
wheremeaningunit
VmeshV_{mesh}Total volume of the mesh (checkMesh)m³
VCADV_{CAD}Volume enclosed by the exported combined surfacem³

Default and rule

Default
computed: the sampled interior point farthest from every surfaceComputed by the programMeasured
Rule

Computed for every mesh.

Source

The clearance rule and the volume check address an observed failure mode: with a smaller background box, a point 24 mm from a chamber wall made the mesher mesh the box around the muffler (1.73 m³ instead of 0.174 m³). A quality check without the volume test accepted that mesh, and the flow solver then failed on the leftover background patch. The 3 % volume tolerance is the program's own choice; a wider tolerance of 10 % leaves room for a wrong-side mesh to pass. The retry with a different point covers a mesher error observed on a real run at a point that the ray-cast test had verified to be inside.

Valid range inside the fluid; mesh volume within 3 % of the enclosed volume

Read only

The point is computed; it is shown in metres in the model's own coordinates.

Gate 1

Fails when faces remain on the background box or the mesh volume is more than 3 % off the enclosed volume. The Mesh step then proposes computing the point again.

Watertight surface

The ray-cast test needs a closed combined surface; an open surface stops with a message to fix the geometry gaps.

References 1

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