SimPilot
DocumentationExamplesAPI Reference
Sign in

Search Documentation

Find pages across the documentation

Getting Started

IntroductionQuickstartHow It Works

Core Concepts

AI AgentSimulation WorkflowEngineering PipelineKnowledge BaseArchitecture

Features

OverviewChat InterfaceCanvas & ArtifactsSharing & CollaborationExports & ReportsVoice InputMulti-Model AIProjectsTemplates & WorkflowsFile UploadsDeep ResearchWeb SearchCode ExecutionImage GenerationMCP ConnectorsInteractive DashboardsParallel ExecutionURL RetrievalFreeCAD CADSimulationsTemplatesConvergence Monitoring

Simulation

OverviewSupported TypesMesh GenerationError RecoveryBatch & SweepsResults Comparison

Studies & Analysis

OverviewDOE & Parametric SweepsOptimizationComparison

Validation & Reviews

OverviewBaselines & VersioningEngineering ReviewsRegulatory Compliance

3D Viewer

OverviewVisualization ToolsKeyboard Shortcuts

Enterprise

OverviewAdmin PanelOrganizationsKnowledge ManagementMethod Packs

Account

Getting StartedSettingsBilling

Examples

OverviewAerodynamicsPipe FlowHeat TransferStructural
  1. Docs
  2. Simulation
  3. Mesh Generation

Mesh Generation

Four mesh generation modes -- from automatic blockMesh to agentic GMSH scripting.

Mesh generation is one of the most critical steps in any simulation. SimPilot provides four mesh generation modes, each tailored to a different workflow. The AI agent selects the appropriate mode based on your inputs, or you can specify one explicitly. Mesh type aliases like snappyHexMesh, blockMesh, and cfMesh are accepted.

Mesh modes

Standard mode

Uses OpenFOAM's native mesh tools to generate the mesh from case dictionaries.
  • The AI agent generates blockMeshDict and optionally snappyHexMeshDict
  • Mesh utilities run as part of the execution script: blockMesh followed by snappyHexMesh if geometry refinement is needed
  • Best suited for parametric geometries described in text (boxes, cylinders, channels)
This is the default mode when no geometry file is uploaded and no external mesh is provided.

Custom mesh import

Import an external .msh file generated by any meshing tool.

Upload mesh file

Provide a GMSH-format .msh file (MSH 2.2 recommended for compatibility).

Conversion

SimPilot runs gmshToFoam to convert the mesh into OpenFOAM format.

Boundary validation

Boundary patches are parsed from constant/polyMesh/boundary and validated. The agent checks that named physical groups exist and no defaultFaces patches remain.

Quality check

checkMesh runs to verify mesh integrity before the solver starts.
Physical groups matter
Ensure your .msh file defines named physical groups for all boundary surfaces. Without them, OpenFOAM assigns everything to defaultFaces, which prevents proper boundary condition assignment.

GMSH agentic mode

The LLM generates GMSH Python code, runs it, and iteratively fixes errors -- fully autonomously.

Boundary extraction

The AI extracts expected boundary names from your description (e.g., inlet, outlet, walls).

Code generation

An LLM generates a complete GMSH Python script that creates the geometry and mesh with named physical groups.

Execution and conversion

The Python script runs inside the compute environment, producing geometry.msh. The mesh is then converted to solver format via gmshToFoam.

Validation and retry

Boundary patches are validated against the expected names. If the mesh fails quality checks, has defaultFaces, or has mismatched boundaries, the LLM receives the error output and generates a corrected script. This retry loop runs up to 6 attempts by default.
This mode is ideal when you need complex 2D/3D geometries that cannot be easily described with blockMeshDict alone.
Standalone mesh generation
The mesh phase of the engineering pipeline provides standalone mesh generation outside of the simulation workflow. It accepts an optional GeometryArtifact from the geometry phase, searches the built-in knowledge base for GMSH patterns, and streams real-time progress updates to the chat UI during generation.

Geometry pipeline mode

For uploaded STEP, STL, or OBJ geometry files. This mode uses the solver's native geometry-to-mesh pipeline.
For OpenFOAM, the pipeline is:

STL preparation

The geometry file is placed in constant/triSurface/. If a STEP file is provided, it is first converted to STL.

Dictionary generation

The LLM generates blockMeshDict and snappyHexMeshDict tailored to the geometry dimensions, scale, and flow type.

Mesh generation

Runs surfaceFeatureExtract, then blockMesh, then snappyHexMesh -overwrite.

Quality validation

checkMesh evaluates the mesh. If quality checks fail, the LLM regenerates snappyHexMeshDict with adjusted refinement and layer settings. This repair loop runs up to 6 attempts.
For solvers without a native geometry pipeline, SimPilot falls back to a generic GMSH/meshio conversion path.

Mesh tools

SimPilot's OpenFOAM plugin supports the following mesh utilities:
ToolPurpose
blockMeshStructured hexahedral background mesh from blockMeshDict
snappyHexMeshAutomatic hex-dominant mesh with surface refinement and boundary layers
cfMesh / cartesianMesh / tetMeshAlternative automatic mesh generators (cfMesh family)
checkMeshMesh quality validation and diagnostics
refineMeshSelective cell refinement based on field or region criteria
gmshExternal mesh generation via GMSH Python API or .geo scripts
gmshToFoamConvert GMSH .msh format to OpenFOAM polyMesh
surfaceFeatureExtractExtract feature edges from STL for snappyHexMesh refinement

Mesh quality analysis

After mesh generation, checkMesh evaluates quality metrics against configurable thresholds. Each metric receives a pass, warn, or fail status:
MetricDescriptionTypical threshold
Non-orthogonalityAngle between cell-center vector and face normalwarn > 65, fail > 70
SkewnessOffset of face center from cell-center connectionwarn > 3, fail > 4
Aspect ratioRatio of longest to shortest cell edgewarn > 100, fail > 1000
Automatic repair
When mesh quality checks fail during geometry pipeline or GMSH agentic mode, the AI automatically adjusts mesh parameters and regenerates. You do not need to manually intervene unless the retry limit is exhausted.
Failed mesh checks do not always block simulation execution. The agent evaluates whether the failures are in critical regions and may proceed with a warning if the issues are localized to non-critical areas.
PreviousSupported TypesNextError Recovery

On this page

Mesh modesMesh toolsMesh quality analysis