Mastering Multi-Region Meshing for OpenFOAM Conjugate Heat Transfer (CHT)

Published by Ruggero Poletto on

A technical deep dive into creating conformal solid-fluid interfaces using snappyHexMesh and SALOME.

Introduction

In the world of Computational Fluid Dynamics with OpenFOAM, moving from single-phase fluid flow to Conjugate Heat Transfer (CHT) is a significant step up in complexity. CHT involves the coupled simulation of heat transfer between a solid structure and the surrounding fluid.

The biggest hurdle in setting up a CHT case isn’t usually the solver settings (OpenFOAM’s chtMultiRegionFoam family handles that well); it’s the mesh.

A CHT case requires a multi-region mesh. This means your constant/polyMesh directory is replaced by subdirectories for each phase, for example, constant/fluidRegion/polyMesh and constant/solidRegion/polyMesh. Crucially, these two meshes must interface perfectly at their shared boundary to allow accurate heat flux conservation across the solid-fluid interface.

In this post, we will explore two powerful, yet fundamentally different, approaches to generating these conformal multi-region meshes: the automated behemoth, snappyHexMesh, and the GUI-based precision tool, SALOME.


The Anatomy of a Multi-Region Mesh

Before diving into the tools, we must understand the goal. A multi-region mesh for CHT is not just two meshes sitting next to each other. They must be conformal at the interface.

This means that for every face on the fluid side of the interface boundary, there must be an exactly matching face on the solid side, sharing the same vertices. If they don’t match, heat cannot be accurately mapped across the boundary.

The Schematic Structure

Here is a simplified schematic of what we are trying to achieve. Imagine a 2D cross-section of a fluid pipe with a thick solid wall.

Key Requirements:

  1. Distinct Regions: The solver needs to know which cells belong to the fluid (solving Navier-Stokes + Energy) and which belong to the solid (solving conduction Energy equation).
  2. The Interface: The boundary patches where the two regions meet must usually be of type mappedWall (or similar coupled patch types depending on the OpenFOAM version) to enable direct data transfer between the solvers.

Approach 1: The snappyHexMesh (sHM) Method

snappyHexMesh is OpenFOAM’s native, parallelized, automatic hex-dominant mesher. It is incredibly powerful for complex geometries but requires a specific workflow for multi-region setups.

The Strategy: We tell sHM to generate one giant mesh containing both fluid and solid. We use Cell Zones to mark which cells belong to which phase during the generation process. Finally, we split that giant mesh into separate regions based on those zones.

Prerequisites

You need separate, water-tight STL files for each region. For example:

  • fluidVolume.stl
  • solidVolume.stl

Tip: Ensure these STLs share exactly the same geometry at their interface so sHM can snap to a common surface.

The Workflow & Scripting

Step 1: The base mesh (blockMesh) Create a background hex mesh that encompasses both STLs.

Step 2: Configuring snappyHexMeshDict This is the critical step. In the geometry section, you load your STLs. In the castellatedMeshControls -> refinementSurfaces section, you define the zones.

Here is a snippet of a relevant snappyHexMeshDict:

// snappyHexMeshDict snippet

geometry
{
    // Load the distinct STL files
    fluidVolume.stl { type triSurfaceMesh; name fluidSurf; }
    solidVolume.stl { type triSurfaceMesh; name solidSurf; }
};

castellatedMeshControls
{
    // ... standard settings ...

    refinementSurfaces
    {
        // Define the Fluid Region
        fluidSurf
        {
            level (2 2); // Refinement level at surface
            
            // CRITICAL FOR CHT: Assign cells inside this STL to a zone
            cellZone fluidZone; 
            zoneInside true;    
        }

        // Define the Solid Region
        solidSurf
        {
            level (2 2);
            cellZone solidZone;
            zoneInside true;
        }
    }
    // ...
}

Step 3: Run sHM Run snappyHexMesh -overwrite.

The resulting mesh in constant/polyMesh is still a single mesh, but if you view it in ParaView and color by “Cell Zones”, you will see distinct groups for fluid and solid. The boundary between them is currently just internal faces connecting different zones.

Step 4: The Magic Command – splitting the mesh To turn this single meshed zone into a true multi-region structure, run:

splitMeshRegions -cellZones -overwrite

This utility looks at the cellZones. It moves the original mesh into backup folders and creates new directories: constant/fluidZone/polyMesh and constant/solidZone/polyMesh.

Crucially, it identifies the faces that were between the zones and creates new boundary patches for them, usually naming them something like fluidZone_to_solidZone and setting their type to mappedWall automatically.


Approach 2: The SALOME Method

SALOME is an open-source CAD/CAE integration platform with a powerful meshing module. It is excellent when you need precise control over mesh grading or boundary layer generation in complex geometries, which can sometimes be frustrating in sHM.

The Strategy: Unlike sHM, SALOME requires us to ensure conformity before we start meshing. We do this in the CAD stage using a “Partition” or “Compound” operation.

Prerequisites

You need the CAD geometry (STEP, IGES, or BREP format) of your fluid and solid parts.

The Workflow & Visuals

Step 1: CAD Preparation (The Geometry Module) If you import a fluid body and a solid body that touch, SALOME sees them as two separate entities. If you mesh them individually, the nodes at the interface won’t match.

  1. Import both your solid and fluid CAD objects.
  2. Select both objects and perform a Partition operation (Operations -> Partition).
  3. This creates a single CAD object containing sub-shapes. Critically, the interface face is now shared between the two volumes.

Visualizing the Geometry Object Browser:

+ Geometry
  + fluid_CAD
  + solid_CAD
  + Partition_1  <-- This is what we mesh
    + Solid_Volume (sub-shape)
    + Fluid_Volume (sub-shape)
    + Shared_Interface_Face (sub-shape)
    + Inlet_Face
    + ...

Step 2: Creating Groups Before meshing, create Groups on the Partition object. This is vital for OpenFOAM to recognize patches and zones later.

  1. Volume Groups: Create a group for the solid sub-volume named “solidZone” and one for the fluid named “fluidZone”.
  2. Face Groups: Create groups for inlets, outlets, walls, and crucially, the shared interface face (e.g., named “interfaceFace”).

Step 3: Meshing (The Mesh Module)

  1. Create a mesh on the Partition_1 object.
  2. Assign your desired hypotheses (algorithms like NETGEN 1D-2D-3D, or viscous layers).
  3. Because you are meshing the Partitioned object, the mesher guarantees that the nodes on the “Shared_Interface_Face” are identical for both volumes.

Step 4: Exporting to OpenFOAM Right-click your mesh and export it to a UNV file (e.g., chtMesh.unv).

Step 5: Importing and Splitting in OpenFOAM Move the UNV file to your OpenFOAM case directory.

  1. Convert UNV to OpenFOAM format:BashideasUnvToFoam chtMesh.unv This creates a single mesh in constant/polyMesh. Your SALOME volume groups become cellZones, and face groups become patches.
  2. Split into regions: Just like with sHM, we use the splitting tool:BashsplitMeshRegions -cellZones -overwrite

This results in the same final structure as the sHM approach: separate specialized mesh regions ready for chtMultiRegionFoam.

Summary Comparison

FeaturesnappyHexMeshSALOME
Workflow NatureScript-driven, automated.GUI-driven, manual steps.
Geometry InputSTL (triangulated surfaces).STEP/IGES (B-Rep CAD).
Ensuring ConformityHandled by splitMeshRegions after generating a single meshed space.Handled by CAD “Partition” operation before meshing begins.
Best For…Very complex, dirty geometries, or automated pipelines. Quick iterations.High-quality hex or tet meshes where precise control over cell distribution is needed.

Both methods are capable of producing high-quality CHT meshes. The choice often depends on the quality of your input CAD and your preference for scripting versus GUI methodologies. Master either one, and you unlock the full thermal simulation capabilities of OpenFOAM.


CloudHPC is a HPC provider to run engineering simulations on the cloud. CloudHPC provides from 1 to 224 vCPUs for each process in several configuration of HPC infrastructure - both multi-thread and multi-core. Current software ranges includes several CAE, CFD, FEA, FEM software among which OpenFOAM, FDS, Blender and several others.

New users benefit of a FREE trial of 300 vCPU/Hours to be used on the platform in order to test the platform, all each features and verify if it is suitable for their needs


Categories: SALOMEsnappyHexMesh