NEMoSys  0.63.0
A modular, extensible resource with robust automated mesh generation, mesh quality analysis, adaptive mesh refinement, and data transfer between arbitrary meshes.
Pack Mesh Generation

There are three workflows embedded within the Pack Mesh engine to generate 3D hex(-dominant) multi-material meshes, 3D periodic tetrahedral multi-material meshes, and 2D surface meshes using input pack geometries in the form of an stl file or a Rocpack geometry file. The basic workflow is as follows:

  • Generate a background volume mesh.
  • Snap the extracted surfaces onto the background mesh to create conformal interfaces.
  • Split the regions into different cellZones.
  • Merge all the different volumes into two foam meshes: the packs and the surrounding medium.
  • Create patches for the multiple pack regions.
  • Convert the foam mesh to VTK.
  • Write mesh quality statistics to a text file.

Pack Mesh JSON Template

{
    "Program Type": "Pack Mesh Generation",
    "Mesh File Options": {
        "Input Rocpack File":"packs_roc",
        "Output Pack Mesh File": "geom_pack_mesh.vtu",
        "Output Surrounding Mesh File": "geom_surrounding_mesh.vtu",
        "Output Combined Mesh File": "packmesh.vtu"
    },
    "Pack Mesh Options": {
        "Type": "hexahedral",
        "Engine": "packmesh",
        "snappyHexMesh Parameters": {
            ...
        },
        "blockMesh Parameters": {
            ...
        },
        "MeshManipulation mergeMeshes Parameters": {
            ...
        },
        "MeshManipulation createPatch Parameters": {
            ...
      }
    }
  }

Pack Mesh uses snappyHexMesh and blockMesh to generate meshes of packs in surrounding material.

For snappyHexMesh and blockMesh, only parameters that are required or are specific to Pack Mesh are included here. For other options, check the reference manual pages for those meshing engines.

Four files are referenced in the "Mesh File Options" section of the pack mesh generation JSON input file:

  • Input Rocpack File: the Rocpack file from which the pack mesh will be generated. If using an stl file, instead specify with Input Geometry File
  • Output Pack Mesh File: the mesh of the packed objects.
  • Output Surrounding Mesh File: the mesh of the surrounding medium.
  • Output Combined Mesh File: the combined pack and surrounding medium meshes.
  • Type: One of "surface" or "hexahedral". Required
  • Engine: "packmesh" Required
  • snappyHexMesh Parameters: Required
    • Castellated Mesh: If true, enables castellated mesh option. Required
    • Snapping: If true, enables surface snapping option. Required
    • Layer Addition: If true, enables adding layers. Required
    • Geometry Definition: Required Enable Multi Patches: Should be enabled if the geometry file has more than one patch. Required Input Patch Name: If specified, will be assigned to the entire surface of the provided geometry. Required
    • Castellated Mesh Controls: Required CellZones: If true, indicates that there will be multiple disconnected regions within the mesh. Required RegionRefine: If true, indicates additional refinement regions. Required SurfaceRefine: If true, indicates additional refinement surfaces. Required
  • blockMesh Parameters: Required
    • Input Dict File: Specifies the input file, if any. false indicates no input dict should be used. Required
    • scaleToMeters: Scales all input lengths from the default of meters.To set to millimeters, set to 0.001
    • NumCells: Number of cells in each direction [x, y, z].For 40 cells in every direction, set to [40, 40, 40]
    • Block Parameters: Required InitialPoint: Location of reference point, [x, y, z] Required if not setting "Auto_Generate" Length: Side length in each direction [Lx, Ly, Lz]. Required if not setting "Auto_Generate" Auto_Generate: Automatically generate the bounding box. Required if "InitialPoint" and "Length" are not specified Offset: Required if "InitialPoint" and "Length" are not specified
  • MeshManipulation mergeMeshes Parameters: Options for combining the pack geometries to bring them under one mesh. Optional
    • Master Region Path: Specifies the input file, if any. false indicates no input dict should be used. Optional
    • Add Region Path: Specifies the input file, if any. false indicates no input dict should be used. Optional
    • overwrite?: Should always be set to true for multi-material meshing. Optional
  • MeshManipulation createPatch Parameters: Sets names for the patches used. Optional
    • Surrounding PatchName: Specifies the name for the surrounding medium. Optional
    • Packs PatchName: Specifies the name for the packed material. Optional
    • Surrounding PatchType: Specifies the patch type (either patch or wall) for the surrounding medium. Optional
    • Packs PatchType: Specifies the patch type (either patch or wall) for the packed material. Optional
    • overwrite?: Should always be set to true for multi-material meshing. Optional

Four files are referenced in the "Mesh File Options" section of the pack mesh generation JSON input file:

  • Input Rocpack File: the Rocpack file from which the pack mesh will be generated. If using an stl file, instead specify with Input Geometry File
  • Output Pack Mesh File: the mesh of the packed objects.
  • Output Surrounding Mesh File: the mesh of the surrounding medium.
  • Output Combined Mesh File: the combined pack and surrounding medium meshes.
  • Type: One of "surface" or "hexahedral". Required
  • Engine: "packmesh" Required
  • Periodic 3D Mesh: Required
    • Physical Group Options: One of "None", "Multi Physical Groups", "Two Physical Groups", or "Physical Group per Shape" Optional; default is "None"
    • Create cohesive elements: If true, creates zero-thickness 3D elements between the pack and the surrounding region. Optional; default is false
    • Enable Patches: If true, enables writing of surface patches in the final mesh. Optional; default is false
    • Set Periodic Geometry: Optional; default is false
    • Element Order: Either 1 or 2 Optional; default is 1
    • Custom Domain: Optional Initial: Length:
    • TransferMesh: Specifies translation in the [x, y, z] directions. Optional
  • Mesh Size: Optional
  • Mesh Algorithm: Options are 1, 2, 5, 6, 7, 8, or 9 for 2D meshes and 1, 4, 7, 9, or 10 for 3D meshes; see below. Optional; default is 1
  • Scale Value: Sets the amount of reduction, from 0 to 1, with 1 being no scaling Optional
  • Remove geometries on boundary: If true, any geometry intersecting the boundary will be removed Optional; default is false
  • Enable Default Outputs: Optional; default is false
  • Enable Size Preservation: If true, pack size is preserved instead of packing fraction. Optional; default is false
  • Refinement Levels: Refinement applied to the original mesh. Optional
  • Upper Threshold: Upper threshold for filtering with respect to mean. Optional
  • Lower Threshold Lower threshold for filtering with respect to mean. Optional

Meshing Algorithms for 2D

  • MeshAdapt (1)
  • Automatic (2)
  • Delaunay (5)
  • Frontal Delaunay (6)
  • BAMG (7)
  • Frontal Delaunay for Quads (8)
  • Packing of Parallelograms (9)

Meshing Algorithms for 3D

  • Delaunay (1)
  • Frontal (4)
  • MMG3D (7)
  • R-Tree (9)
  • HXT (10)