CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Integrated conjugate heat transfer solver in OpenFOAM (

hjasak December 21, 2007 06:06

Hi All, I have recently rel
Hi All,

I have recently released a top-level solver and tutorial for conjugate heat transfer simulations in OpenFOAM using a new coupled matrix approach. The new classes allow you to create a multi-mesh domain and couple equations on various meshes on a per-variable basis.

For example, in conjugate heat transfer, flow equations are solver only on a fluid mesh, while the energy equation is solved in a coupled manner for the fluid and solid domain at the matrix level.

A code snippet showing how the coupling is achieved is given below:

coupledFvScalarMatrix TEqns(2);

// Add fluid equation
new fvScalarMatrix
+ fvm::div(phi, T)
- fvm::laplacian(DT, T)

// Add solid equation
new fvScalarMatrix
fvm::ddt(Tsolid) - fvm::laplacian(DTsolid, Tsolid)


As a good object-oriented citizen I have implemented the machinery to allow arbitrary multi-mesh and multi-variable coupling: this allows you to tackle any coupled problems involving multiple meshes.



Tutorial case:

OpenFOAM-1.4.1-dev/tutorials/conjugateHeatFoam/conjugateCavity + heatedBlock



mkraposhin December 21, 2007 07:57

Thak you, Hrvoje Jasak for Ope
Thak you, Hrvoje Jasak for OpenFOAM! For the last month, i'm trying to couple heat transfer in solid and liquid regions (water as fluid, steel as solid), but, without success.
Where can i find links, mentioned by You in prvious post?

mighelone December 21, 2007 10:14

Hrv Congratulation for your wo
Hrv Congratulation for your work!

If I well understood, is the CHT code able to support multiple fluid and solid regions, like for example two fluids separated with a solid region?

If it is so! I'd like to test the code with some CHT calculation previously done with Fluent.


connclark December 21, 2007 18:56

This is why I started getting
This is why I started getting involved with openFoam in the first place. Now I can try and figure out how to convert my printed circuit board design files into openfoam format and model the air flow in our companies product. The timing is right too we just finished some temperature testing. We have some components getting over 118C


Are you sure you don't live at the north pole and have reindeer? If so thank you Santa. If not thank you any ways for the wonderful christmas present

alberto December 21, 2007 18:59

Great! Merry Christmas :-)

Merry Christmas :-)

mike_jaworski December 22, 2007 02:39

This looks great. Are there di
This looks great. Are there direct links to the download, or instructions on where to get the files?


alberto December 22, 2007 20:55

You can download it from the O
You can download it from the OpenFOAM-extend project :

The SVN directory of the solver is:



hsieh December 23, 2007 22:45

Hi, Alberto, I am wondering
Hi, Alberto,

I am wondering if you can assist me on compiling the development version.

I have been using the standard OF on SuSE without any problem. I would like to try out the conjugate H.T. on the development version. The compilation of the development version seemed different. Is it based on FreeBSD? Would I be able to compile the development version using the same steps of the stadnard OF on SuSE? The development version uses additional utilities, such as gdb and cmake. Are these two packages needed for the development? How do I compile new solver? Will wmake still works? Can I use the same gcc compiler downloaded from the standard OF distribution?


stephan December 26, 2007 07:59

hi, thanks for this nice so

thanks for this nice solver!!!!
best regards

mike_jaworski December 29, 2007 00:56

Pei, I have been wrestling
I have been wrestling with the development version and finally got it to build and everything working with the exception of FoamX, which I don't really need anyways. From what I can see, all the standard steps needed to compile the 1.4.1 version will apply to 1.4.1-dev. I have OpenSUSE 10.3 but I ended up following the wiki article very closely ( in order to get things working. A major stumbling block was finding out I needed binutils and such. 1.4.1-dev also contains dxFoam but you only need that if you don't want to use paraFoam or some other postProcessor you may already use. If you follow the wiki page, though, precisely, things should work.

Hrv: Thank you for the solver. Is there any associated write-up or something to follow along to understand this material? When I attempt to run conjugateHeatFoam . conjugateCavity I get the following error:

--> FOAM FATAL ERROR : Attempt to cast type wall to type lduInterface

From function refCast<to>(From&)
in file /home/mjaworsk/OpenFOAM/OpenFOAM-1.4.1-dev/src/OpenFOAM/lnInclude/typeInfo.H at line 103.

FOAM aborting

I'm new to this so any help is greatly appreciated as are hints on how to better *understand* how these things work.

Thanks and best regards,

hsieh December 29, 2007 09:19

Hi, Mike, Thanks a lot for
Hi, Mike,

Thanks a lot for the link to openfoamwiki. I will give it a try.

Are you using 32 bit or 64 bit SuSE? Prior to OF-1.4, gcc was installed under linuxAMD64, now it is in linux64. If you are using 64 bit SuSE, did you install gcc in linux64?

I was able to compile the development version from source on a 32 bit Ubuntu (but, dx and paraview failed). I ran the conjugateHeatFoam without any problem.


mike_jaworski December 29, 2007 16:04

Pei, I have a 32bit system
I have a 32bit system. However, there are notes on compiling for 64bit a bit lower on that wiki page. I got both dx and paraview to work but I had to dig into those websites and find all their dependencies and the necessary compiler options. The other thing is going in and modifying the following files:

or cshrc as the case may be. You need to alter any values to reflect the locations and version numbers of the dependencies you have. For dxFOAM, this includes the location of the openMotif libraries. For paraview, I think it expects to find cmake files in certain spots. The .bashrc file contains the pointers to the gcc files and versions, etc that you need.

For me, this whole process meant digging into dxFoam's website ( to figure out all these issues and even then, there was a symlink or other issue along the way that needed to be resolved. I was able to google for most of the error messages though, and find a solution.

Good luck,

hsieh December 30, 2007 11:44

Hi, Mike, Thanks a lot for
Hi, Mike,

Thanks a lot for the great help!

By following the wiki steps, I was able to compile gcc-4.2.2 on 64 bit SuSE 10.2. I am not able to compile dx and paraview successfully, but, I probably made some mistakes along the way. I also had trouble compiling dx and paraview on 32 bit Ubuntu, but, openFoam-1.4.1-dev went fine. So, I am compiling the OpenFOAM-1.4.1-dev on 64 bit SuSE 10.2 now.


mike_jaworski December 30, 2007 15:33

Pei, both paraview and dx
both paraview and dx have a long list of dependencies in order to compile correctly. In particular, dx requires a number of ImageMagick libraries and openMotif libraries. Paraview requires not just cmake, but QT as well. If you're having problems with them, I recommend downloading and recompiling those libraries into the ~/OpenFOAM/linux directory and making sure those libraries are specified when you compile dx and paraview.

Also, when you ran conjugateHeatFoam, did you do so through FoamX, or command line? was there any special order/steps during mesh generation?


hsieh December 30, 2007 17:08

Hi, Mike, Thanks for the su
Hi, Mike,

Thanks for the suggestions regarding dx and paraview. I will try your suggestions later.

I am able to compile 64 version of OpenFOAM-1.4.1-dev successfully. I basically ran the tutorial, that is, conjugateCavity. I ran the case using command line, not FoamX (like you did: "conjugateHeatFoam . conjugateCavity"). I have no problem running the tutorial case, except that, I cannot view the results due to failure in dx/paraview. I did not regenerate the mesh. Mesh were already generated in the tutorial case. I am still trying to understand how to use this conjugateHeatFoam solver and how to set up new cases.

I tried SuSE 10.3 64 bit, but, had some strange problem. So, I reverted back to SuSE 10.2.


mike_jaworski December 31, 2007 00:01

Pei, Thanks for letting m
Thanks for letting me know about running conjugateHeatFoam straight "out of the box". It ran, though now I'm left wondering what special items have to take place in order to build meshes and the like.

hsieh December 31, 2007 10:07

Hi, Mike, I am still learni
Hi, Mike,

I am still learning this conjugateHeatFoam solver. Right now, I am stuck installing paraview.

My guess is that, you will generate the fluid mesh and the solid mesh separately. Then, put the solid mesh under the case you are solving. What I am not sure at this point is that, is there a requirement that the mesh has to be conformal at the fluid/solid boundaries.

Another question is that, can one has several solid regions with different conductivity/heat capacity/density?

I am also curious about the efficiency of its parallel solver.


connclark January 8, 2008 17:48

Hrv, I finally got aroun

I finally got around to trying your conjugateHeatFoam solver and I was trying to duplicate each step of the process using the OpenFOAM-1.4.1-dev tree. I can run your solver on the conjugateCavity case, However I can't recreate the meshes using the blockmesh command. I get an error saying "Unknown polyPatch type regionCouple for patch 'whatever' "

Are there some patches to apply to blockmesh and other utils that you could apply to the dev tree?


hjasak January 8, 2008 18:06

You have to specify the region
You have to specify the regionCouple patches by hand. Move the boundary file somewhere, create the meshes using blockMesh and then edit the two boundary files to specify the coupling. You've got the example - it is in the current boundary file.

I am still looking to sort out the user interface, but at least the solver is working properly.



hjasak January 8, 2008 18:07

P.S. Nice pets - you need a ne
P.S. Nice pets - you need a new one. May I recommend 911 Turbo, model 997?

All times are GMT -4. The time now is 08:24.