Skip to content

Initial implementation of chtMultiRegionSimpleFoam, conjugate heat transfer support#265

Draft
kevinsmia1939 wants to merge 11 commits into
jaheyns:masterfrom
kevinsmia1939:add_chtMultiRegionSimpleFoam
Draft

Initial implementation of chtMultiRegionSimpleFoam, conjugate heat transfer support#265
kevinsmia1939 wants to merge 11 commits into
jaheyns:masterfrom
kevinsmia1939:add_chtMultiRegionSimpleFoam

Conversation

@kevinsmia1939
Copy link
Copy Markdown
Contributor

@kevinsmia1939 kevinsmia1939 commented Apr 19, 2026

Add chtMultiRegionSimpleFoam solver to CfdOF with multi-region CHT support

There are several limitations at the moment.

  • Only 1 fluid domain, so heat exchanger cannot be done yet.
  • I tested only gmsh. cfmesh has not been test. snappyhexmesh have to support multi-body mesh.
  • Turbulent RANS, kOmegaSST works, but I encounter stability issue half way into simulation with the example file I gave. We should create better file to test.
  • Only aluminium properties at the moment, but can add more later.
  • The fluid box and solids where heat is flowing though must be combine with "boolean fragments".

FreeCAD version 1.1.1 and openfoam2512 was tested.
Open the example I gave, write mesh case, run mesh, write case, and run case should start simulation without issue.
To view your result, open ParaView and add extractor block to see fluid or solid part, see screenshot.
Most of the codes are written with Claude code.

The next steps after this to put CHT in usable state includes,
Test different combinations and conditions
Test different cases with different wall boundary types, cyclic, symmetry, etc.
Add demo
Test with meanflowvelocity
Test different Turbulent model. A case without stability issues. Then add support for different Turbulent model.
Test different meshing.
Add more solid properties.

This PR still need much more testing until it is ready to merge. Will continue to update status.

All test pass except #262 which will need to merge first.

The example shown below is a heat sink with constant temperature on the bottom. Inlet and outlet flow over at 500mm/s.
Screenshot_20260419_220029
Screenshot_20260419_220103
Screenshot_20260419_215931
cht_heatsink_test.FCStd.txt

@kevinsmia1939 kevinsmia1939 marked this pull request as draft April 26, 2026 11:08
@kevinsmia1939 kevinsmia1939 force-pushed the add_chtMultiRegionSimpleFoam branch from d8b5fe8 to 1a90271 Compare April 26, 2026 11:10
@oliveroxtoby
Copy link
Copy Markdown
Collaborator

Thanks for taking this on.

One comment you could perhaps consider: My plan for this is to allow multiple mesh objects which would be connected via the non-conformal region-coupled boundaries in a similar way to how the periodic master/slave boundaries are currently implemented. This would be fairly general and not require us to implement a specialised method for each different mesher.

Two bugs caused user values to be silently discarded:
1. InputField unit property was set to the full quantity string (e.g. "1000
   kg/m^3") instead of the unit alone. FreeCAD interpreted the numeric
   coefficient as a scale factor, so Density and SpecificHeat displayed and
   stored values scaled by 1000x and 500x respectively. ThermalConductivity
   happened to work because its default value starts with coefficient 1.

2. populateMaterialsList resets all widgets to the AluminiumSolid defaults.
   The subsequent restore loop fires manualEdit (via valueChanged) as soon as
   the first field (ThermalConductivity) changes — at which point the remaining
   widgets are still at the stale AluminiumSolid values. manualEdit reads all
   widgets eagerly and overwrites self.material with the wrong Density and
   SpecificHeat before the restore loop can set them. Wrapping the restore loop
   in selecting_predefined = True suppresses manualEdit during restore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants