Phase 3

Meshing

The mesh is the bridge between geometry and the solver. Its quality determines whether the solver produces accurate results, converges in reasonable time, or fails. This phase covers the metrics that define mesh quality, how to set element sizes efficiently, the mesh methods available in Mechanical, and how to diagnose and resolve failures.

3.1  Mesh Quality Metrics

Ansys Learning Hub: Mechanical Getting Started: Basics ↗ · 8 hr · E-learning

Three metrics appear in the Mesh Metrics panel and drive most quality decisions:

Skewness[1]
Measures deviation of an element from its ideal shape. Range: 0 (perfect) to 1 (degenerate). Target: mean below 0.25 and maximum below 0.9. Elements above 0.9 trigger solver warnings and produce inaccurate results at those locations.
Orthogonal quality[2]
Measures alignment between element face vectors and element-to-element vectors. Range: 0 (worst) to 1 (ideal). Target: minimum above 0.1 as an absolute floor, above 0.2 for structural applications at stress concentrations.
Aspect ratio
Ratio of the longest to shortest dimension of an element. Target: below 10 for most elements. Thin-feature elements (solder joints, TIM layers, adhesive) may reach 20–30 without causing problems if the long axis is aligned with the thermal or stress gradient direction.

The Mesh Metrics histogram (View → Mesh Metrics in Mechanical) shows the distribution of quality values across all elements. The distribution shape matters more than the single worst element. A small number of poor elements in an otherwise excellent mesh is a different situation from a mesh with a skewness distribution shifted toward 0.7. Address systematic distributions, not isolated outliers.

3.2  Global vs. Local Sizing Strategy

Set the global element size coarse, then refine only where the gradient is highest. A coarse global size with targeted local refinements almost always outperforms a uniformly fine mesh — it preserves element count where accuracy is not needed while concentrating resolution where it is.

The cost of over-refinement: element count scales as (refinement factor)³ in 3D. A 2× refinement produces 8× more elements. A 3× refinement produces 27×. Set the global size to 2–5× the smallest important feature, then refine selectively.

Local refinement tools

  • Body sizing: sets a maximum element size on a selected body. Use on components that need higher accuracy than the global mesh (solder joints, TIM layers, heatsink fins).
  • Face sizing / Edge sizing: refines at specific boundary condition faces or stress concentration edges (holes, fillets, mounting pad edges).
  • Body of Influence: a virtual volume body that forces refinement inside its boundary regardless of what geometry is inside. Use for regions that need refinement but have no convenient face to size on.
  • Mesh refinement: applies additional refinement passes after the initial mesh. Use as a post-solve check — refine in the high-gradient region and compare results to verify convergence.

The highest gradient is not always at the smallest feature. A large structural member with a stress concentration at a mounting hole requires refinement at the hole, not at decorative surface detail elsewhere on the body.

Example — wall-mount bracket: targeting refinement to the mounting holes

A wall-mount bracket for a 30 kg enclosure: 400 mm × 200 mm × 6 mm cast aluminium with four M8 mounting holes at the corners and a central cable pass-through slot.

Sizing strategy:

  1. Global size: 8 mm. Gives one element through the bracket thickness. Covers all geometry. Element count: ~18,000. Goal is geometry problem detection, not accurate results.
  2. Face sizing at the four M8 hole edges: 1 mm. These are the highest-stress locations under the gravity + seismic load — the constraint is applied here and the stress gradient is steepest at the hole boundary.
  3. Body of Influence around each hole: 10 mm sphere, 2 mm size. Transitions the 1 mm hole mesh to the 8 mm global mesh over a short distance, without requiring manual face sizing on every adjacent face.
  4. No refinement at the cable slot. The slot is remote from the load path (the mounting holes carry all reaction force) and the slot edge stress is not a design-limiting quantity.

Result: targeted mesh has 42,000 elements vs 310,000 elements for a uniform 1 mm mesh. Peak stress at the mounting holes differs by less than 3% between the two meshes. The targeted approach is 7× faster to solve with equivalent accuracy at the critical location.

3.3  Mesh Methods

Patch-conforming tetrahedral (default)[3]
Produces tetrahedral elements on any geometry without restriction. Works on imported assemblies, complex shapes, and all geometry that Check Geometry passes. The standard choice for electronics assemblies. Element accuracy per element is lower than hex, but the ease of setup and robustness compensates for most applications.
Multizone[4]
Produces hex elements in sweepable regions and tet elsewhere. Better accuracy per element for prismatic geometries — heatsink fins, connector bodies, fastener standoffs. Requires the geometry to be decomposable into sweepable regions. Worth the additional SpaceClaim preparation time when these components are critical to the result.
Sweep[5]
Structured hex through a single sweep direction. The most accurate element type for thin-feature bodies: solder joints, adhesive layers, TIM, laminates. Requires a simple, prismatic body (source face, target face, clean sweep path). Apply selectively to the critical thin-feature bodies — not to the whole model.

General guidance: use patch-conforming tet for the full assembly. Apply sweep or multizone selectively to the components where element accuracy matters most (solder joints, laminates, heatsink fins). Investing time in hex meshing for the entire model rarely produces results that justify the preparation effort for electronics assemblies.

Example — heatsink fins and meter housing conductors: matching method to geometry

Two components that benefit from non-default meshing:

Heatsink fins (cast-Al, 40 mm high, 1.5 mm thick, 5 mm pitch): the fin body is prismatic — a constant cross-section swept along the fin height. Apply Multizone to the fin bodies. The result is hex elements aligned with the fin height direction, which is also the primary thermal gradient direction. Hex elements aligned with the gradient require approximately 60% fewer elements than tet to achieve the same gradient resolution in the fin cross-section.

Meter housing conductors (circular cross-section, 12 mm diameter): round conductors mesh poorly with tet — the circular cross-section produces high aspect-ratio elements near the centre. Apply Sweep using the circular face as the source. The sweep generates hex elements aligned with the current flow direction (axially), which is also the direction of the current density gradient in the DC conduction solve.

Assembly body: patch-conforming tet for the housing, fasteners, and air region. These have complex imported geometry that is not sweepable.

Element count comparison for one conductor cross-section: patch-conforming tet produces ~1,200 elements at worst-case skewness 0.71. Sweep produces 480 elements at skewness 0.02 — 2.5× fewer elements and 35× better quality at the same conductor body.

3.4  Inflation Layers

Inflation adds layers of progressively refined elements near a surface.[6] The purpose differs between fluid and structural analyses.

In Icepak fluid domains

The thermal and velocity boundary layer at a solid-fluid interface has a steep gradient that a coarse mesh cannot resolve. Without inflation, the near-wall temperature gradient is smeared across a large element, and the convective heat transfer coefficient at that surface is underestimated. Junction temperature predictions are systematically low. Apply inflation to all solid-fluid interfaces in Icepak fluid domains.

Inflation settings: first layer height calculated from the expected boundary layer thickness at the relevant Reynolds number; growth rate 1.2; target 5–10 layers through the boundary layer region.

In structural analyses

Inflation through thin structural features — solder joints, adhesive layers, laminates — ensures adequate element count through the thickness. The minimum for reliable through-thickness stress is three elements. Apply inflation with a "total thickness" specification to fill the feature depth regardless of its actual dimension.

Example — heatsink CFD domain: inflation settings for forced convection

A cast-Al heatsink: fins 40 mm high, 1.5 mm thick, 5 mm pitch. Forced convection at 2 m/s inlet velocity. Hydraulic diameter of a fin channel: Dh = 2 × (1.5 × 3.5)/(1.5 + 3.5) = 2.1 mm. Re ≈ 290 — laminar flow.

Inflation setup at the fin surfaces:

  1. First layer height: 0.05 mm. Targets y+ ≈ 1 for laminar near-wall resolution. The thermal boundary layer in a 2 m/s, 40 mm long fin channel is developing and thin — the first layer must be inside the viscous sublayer.
  2. Growth rate: 1.2. Each layer is 1.2× the previous. Conservative enough to avoid quality problems at the transition to the bulk mesh.
  3. Number of layers: 8. The eighth layer reaches approximately 0.22 mm, at which point the bulk mesh elements are 1 mm. Aspect ratio at the last inflation layer: ~4.5. Acceptable.
  4. Applied to: all fin faces, fin tips, and heatsink base plate — all solid-fluid interfaces.

Without inflation at these settings, the near-wall temperature gradient is smeared over the first 1 mm element. The computed heat transfer coefficient at the fin surface is underestimated by approximately 30–40%, and junction temperature predictions are correspondingly non-conservative.

3.5  Diagnosing Mesh Failure

When the mesher fails, read the error message before changing anything. The message window identifies the failure mode. The "Go to Problem" option in the message window highlights the offending face or edge in the viewport.

Diagnostic workflow:

  1. Open the message window (Home → Messages or the warning flag in the status bar).
  2. Right-click the error → Go to Problem. The view jumps to the failing geometry.
  3. Identify the cause: sliver face? gap? very small edge? near-zero-angle surface?
  4. Return to SpaceClaim and fix the specific feature.
  5. Re-generate the mesh.

Most mesh failures trace to five geometry problems: faces smaller than the target element size, edges shorter than the target size, gaps between mating bodies, thin slivers from import or defeaturing, and re-entrant corners at near-zero angles. These are all SpaceClaim repairs, not mesh settings changes.

Do not keep adjusting mesh settings to force a failed mesh to generate. A mesh that requires extreme settings to generate on broken geometry will produce poor quality results at those locations regardless of whether it completes.

3.6  Improving Poor Mesh Quality

Section 3.5 covers failure to generate. This section covers the other outcome: the mesh generates, but quality metrics are unacceptable — high skewness, low orthogonal quality, or both. The approach is different because there is a mesh to inspect.

Step 1: locate the bad elements

The Mesh Metrics histogram (View → Mesh Metrics, select the metric) shows element count vs. quality value. To find where the bad elements are: left-click and drag across the worst bin in the histogram to select those elements. The viewport highlights the selected elements in the geometry. This immediately identifies which body or region is producing the poor quality.

Step 2: identify the cause

Four patterns cover most cases:

  • Bad elements clustered at one body: that body has a geometric problem — a sliver face, a near-tangent surface, or a gap at an interface. Return to SpaceClaim.
  • Bad elements at body interfaces: the bodies are not sharing topology — contact patches are generating transition elements. Apply Share topology in SpaceClaim.
  • Bad elements spread uniformly across a body: the global element size is too coarse relative to the body's curvature or a curved face is producing irregular elements. Reduce element size on that body.
  • High aspect ratio in thin features: a TIM layer, solder joint, or adhesive that is much thinner than the global element size. Apply inflation or Sweep meshing specifically to that body (see 3.3 and 3.4).

Step 3: fix in order of preference

  1. Fix the geometry in SpaceClaim (first choice): remove the sliver face, close the gap, merge the coplanar faces. The mesh will improve automatically on re-generation.
  2. Virtual Topology in Mechanical (Mesh → Insert → Virtual Topology): merges adjacent small faces into a single logical face without modifying the geometry. Effective for faces too small to fix in SpaceClaim or faces that were created by the mesher itself.
  3. Pinch controls (Mesh → Insert → Pinch): collapses very short edges below a threshold length before element generation. Eliminates the small-edge-driven poor elements without geometry surgery.
  4. Mesh defeaturing (Mesh Details → Defeature Size): the mesher ignores geometric features below this length. Use as a last resort — it discards geometry information that may be relevant elsewhere.

When to accept poor quality

Not every poor-quality element requires action. The question is whether those elements are in a path that matters to the result:

  • Poor elements at a screw boss far from the stress concentration of interest? Accept them.
  • Poor elements at a mounting hole that carries load directly? Fix them.
  • High aspect ratio at a solder joint where you are computing through-thickness stress? Fix it — apply Sweep meshing to that body.
  • High aspect ratio at a structural brace far from the area of interest? Accept it if the long axis is aligned with the load direction.

The Mesh Metrics histogram is a tool for finding problems, not a pass/fail gate on its own. A mesh with five bad elements in an unimportant region and 500,000 good elements everywhere else is a better mesh than a uniformly mediocre one.

Example — connector-to-PCB interface: locating and fixing poor elements

A board-mounted power connector on a 2 mm PCB. The connector footprint is an irregular polygon with short edges (0.3 mm) at one corner. The mesh generates successfully but the skewness histogram shows 340 elements above 0.85.

  1. Locate: in Mesh Metrics, drag to select the >0.85 skewness bin. The viewport highlights a cluster at one corner of the connector footprint — not distributed across the board.
  2. Diagnose: zoom to the highlighted region. A 0.28 mm edge at the connector footprint corner is forcing transition elements smaller than the 1 mm body sizing on the connector.
  3. Fix option A — SpaceClaim: merge the 0.28 mm edge with the adjacent 2.1 mm edge (Design → Pull → Merge Edges). This replaces both with a single 2.38 mm edge. Re-mesh: maximum skewness drops from 0.89 to 0.42.
  4. Fix option B — Virtual Topology: if the edge must remain (load-bearing, or referenced by a boundary condition), apply Virtual Topology (Mesh → Insert → Virtual Topology) and merge the two adjacent small faces around the bad corner. The mesher treats the merged region as a single face. Maximum skewness drops from 0.89 to 0.51 without modifying SpaceClaim geometry.

This connector footprint is at the PCB edge, remote from the clamping bolts. The remaining skewness of 0.42–0.51 is acceptable for the transportation analysis. If the connector were at a bolt location carrying primary load, SpaceClaim repair would be required.

References

  1. ANSYS Inc. "Skewness." ANSYS Meshing. ansyshelp.ansys.com. Accessed: 2026-06-16. [ANSYS 2025 R2]
  2. ANSYS Inc. "Orthogonal Quality." ANSYS Meshing. ansyshelp.ansys.com. Accessed: 2026-06-16. [ANSYS 2025 R2]
  3. ANSYS Inc. "Patch Conforming Algorithm for Tetrahedrons Method Control." ANSYS Meshing. ansyshelp.ansys.com. Accessed: 2026-06-16. [ANSYS 2025 R2]
  4. ANSYS Inc. "MultiZone Method Control." ANSYS Meshing. ansyshelp.ansys.com. Accessed: 2026-06-16. [ANSYS 2025 R2]
  5. ANSYS Inc. "Sweep Method Control." ANSYS Meshing. ansyshelp.ansys.com. Accessed: 2026-06-16. [ANSYS 2025 R2]
  6. ANSYS Inc. "Inflation Controls." ANSYS Meshing. ansyshelp.ansys.com. Accessed: 2026-06-16. [ANSYS 2025 R2]