How to Mesh Assemblies with Netgen in FreeCAD FEM

Meshing complex multi-part assemblies using the Netgen mesher in FreeCAD's Finite Element Method (FEM) workbench requires turning discrete solid components into a single, conformal geometric structure before running the mesh generator. This guide explains how to prepare assembly geometry using Boolean operations, configure Netgen parameters for accurate element sizing, and apply localized mesh refinements to ensure a continuous and robust tetrahedral mesh across touching interfaces.

Step 1: Prepare Assembly Interfaces

Netgen operates on single geometries. If multiple parts simply touch without a shared topological boundary, Netgen will mesh them independently, resulting in non-conforming nodes at the interfaces. To fix this:

  1. Switch to the Part Workbench.
  2. Select all components of your assembly in the tree view.
  3. Go to Part → Split → Boolean Fragments (or Slice to compound). Set the mode to CompSolid (composite solid) if the parts share common material behaviors, or leave it as a continuous compound. This creates shared faces between adjacent solids.
  4. Verify the geometry using Part → Check geometry to eliminate duplicate faces, tiny edges, or self-intersections that often crash Netgen.

Step 2: Initialize the FEM Analysis

  1. Switch to the FEM Workbench.
  2. Click the Analysis container button (yellow folder icon) to create a new simulation environment.
  3. Ensure the newly created Boolean Fragment compound resides inside or is targeted by the analysis container.

Step 3: Apply the Netgen Mesher

  1. Select the compound object in the tree view.
  2. Click the FEM mesh from shape by Netgen tool.
  3. In the task panel, define the global sizing parameters:
    • Max Size: Set an upper limit to prevent excessively large elements in bulk regions.
    • Min Size: Define the smallest feature size you want to resolve to keep element count manageable.
    • Fineness: Select from presets (Very Coarse to Very Fine) or set to User Defined for explicit control.
    • Second Order: Check this box to generate quadratic tetrahedral elements (Tet10). Second-order elements are essential for capturing bending stresses and curved boundaries accurately.
    • Optimize: Keep this enabled to let Netgen run post-meshing surface and volume optimization steps.

Step 4: Add Localized Mesh Refinements

Complex assemblies frequently have regions like fillets, holes, or contact zones that require a finer resolution than the global setting.

  1. Select the Netgen mesh object in the tree view.
  2. Click the FEM mesh region tool.
  3. Click Add and select the specific faces, edges, or sub-solids requiring refinement.
  4. Define a smaller local element size in the dialog and click OK.

Step 5: Compute and Verify the Mesh

  1. Double-click the Netgen mesh object in the model tree.
  2. Click Apply to compute the mesh. For large models, this process may take several minutes.
  3. Inspect the mesh visually:
    • Hide the original CAD geometry (press the spacebar on the compound object) to view only the mesh elements.
    • Verify that nodes are shared across contact interfaces by zooming into partition boundaries.
    • Look for excessively distorted or collapsed elements near acute angles.
  4. If the meshing fails or takes too long, increase the Min Size parameter or refine the underlying CAD geometry by removing non-critical small features using the Defeaturing tools.