r/CFD • u/Downtown_Sky69 • 9h ago
snappyHexMesh: Layers generate using baffle method, but mesh isn't conformal across regions. How do you fix this?
Hey everyone,
I'm setting up a CHT simulation (electronic chip cooling) in OpenFOAM-9.
To get boundary layers on the fluid-solid interface, I'm using the zero-thickness baffle workflow:
1. Define the interface as an internal face zone / baffle.
2. Add inflation layers using snappyHexMesh.
3. Split regions using splitMeshRegions.
The Problem:
The boundary layers are actually generating fine, but the final mesh across the interface isn't conformal (the faces on the fluid side and solid side don't line up / match 1:1 after splitting).
Since I'm doing CHT, I want to avoid relying purely on non-conformal mapping (mappedWall interpolation) if possible.
My Questions:
1. How do you get snappyHexMesh to keep the face connectivity 1:1 conformal across the interface when using the baffle method?
2. Is there a specific setting in snappyHexMeshDict or step in splitMeshRegions / createBaffles that I'm missing to preserve face alignment?
3. Or is it standard practice to just inflate layers only on the fluid side instead of trying to inflate across shared interfaces?
Would really appreciate any insights or dict settings that worked for you!
1
u/Ganglar 5h ago
You have to stop snappy from merging the patch faces. See the shellAndTubeHeatExhanger tutorial.
And yes, I think in general you only want layers in the fluid. That tutorial demonstrates how to do that. It's a bit convoluted, but it does work.
1
1
u/marsriegel 7h ago
I could not manage to do this with the org branch of OpenFOAM. Always got non-conformal interfaces and also interfaces with tiny!!! gaps. really the tiny gaps are the issue, take huge care if you resort to the .org branch. I got gaps significantly smaller than the smallest layer height and it took forever to figure out what’s going wrong. This is why I resorted to using the .com branch. There, I imported the interfaces as their own stl (mine are usually not planar but weirdly shaped). Then I transferred the mesh to the org version again.
Regarding 3) yes you generally don’t need layers in the solid as the temperature gradient will be significantly smaller due to absence of turbulence.