# How to solve a heat conduction between two different solid materials ?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 9, 2012, 02:41 How to solve a heat conduction between two different solid materials ? #1 New Member   Mark Huang Join Date: Oct 2012 Posts: 6 Rep Power: 13 Hi, I'm new with OpenFoam. I'm trying to solve a simple heat conduction problem by OpenFoam "laplacian" solver, but couldn't find an exapmle about heat conduction of two different solid materials in tutorials. So far, I can establish blockMeshDict and controlDict well (I guess), but just do not know how to set up the thermophysical property of two materials in TransportProperties and the contact resistance. Or I just choose the wrong solver completely? Thanks a lot...

 October 9, 2012, 03:09 #2 Senior Member     Anton Kidess Join Date: May 2009 Location: Germany Posts: 1,377 Rep Power: 30 LaplacianFoam just expects a scalar value for the diffusivity, thus it is not set up to handle varying material properties. You can easily replace the dimensionedScalar in the code by a volScalarField which you initialize using setFields (you can probably even find the necessary code here on the forum). Alternatively you can use chtMultiRegionFoam, but I think that will be more work. - Anton Tobi likes this. __________________ *On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer.

 October 10, 2012, 22:41 #3 New Member   Mark Huang Join Date: Oct 2012 Posts: 6 Rep Power: 13 Thanks, I describe the problem in detail. I would like to solve a heat conductuion problem, such as the structure below. ......---==--- ......| ...A... | ------------------- | .........B............ | ------------------- Double-line : Heat source Solid A : Material A Solid B : Material B There is a contact resistance between Solid A and Solid B. All boundaries are heat insulation. I have set up the blockMeshDict and controlDict well, but I do not know how to set up the thermophysical properties and the contact resistance. Could someone give me an idea of which solver I should use and which file I should set up them ? Best Regards

October 11, 2012, 07:33
#4
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Quote:
 Originally Posted by cremona Thanks, I describe the problem in detail. I would like to solve a heat conductuion problem, such as the structure below. ......---==--- ......| ...A... | ------------------- | .........B............ | ------------------- Double-line : Heat source Solid A : Material A Solid B : Material B There is a contact resistance between Solid A and Solid B. All boundaries are heat insulation. I have set up the blockMeshDict and controlDict well, but I do not know how to set up the thermophysical properties and the contact resistance. Could someone give me an idea of which solver I should use and which file I should set up them ? Best Regards
Hi,

if you have the meshes, its very easy to set up a case with the chtMultiRegionSimpleFoam. I did that in my bachelorthesis and in a project with thermoelectric moduls. At least I had a construction to simulate like yours

have a look at the chtMultiRegionSimpleFoam tutorial.

Regards
Tobi

October 15, 2012, 02:52
#5
New Member

Mark Huang
Join Date: Oct 2012
Posts: 6
Rep Power: 13
Quote:
 Originally Posted by Tobi Hi, if you have the meshes, its very easy to set up a case with the chtMultiRegionSimpleFoam. I did that in my bachelorthesis and in a project with thermoelectric moduls. At least I had a construction to simulate like yours have a look at the chtMultiRegionSimpleFoam tutorial. Regards Tobi

Thanks Tobi,

I have checked chtMultiRegionSimpleFoam tutorial, but I found it is a solver for the behavior of heat transfer between "fluid and solid".
Can it also solve the heat conduction between "2 solids" ?
By the way, how about the contact resistance ?
Could I set it up in chtMultiRegionSimpleFoam solver ?

Regards,
Mark

 October 15, 2012, 04:07 #6 Super Moderator     Tobias Holzmann Join Date: Oct 2010 Location: Tussenhausen Posts: 2,708 Blog Entries: 6 Rep Power: 51 Hi, you can solve solid/solid regions. I did it in my bachelorthesis. To your questions with the resistance between the solids. Good question. I dont know. Maybe there are some new BC for that problem. But I am not up to date. If you want, I can upload a testcase for 2 solid regions (2 cylinder) Its 2 years ago that I worked with the chtMultiRegionSimpleFoam but it should work! Regard Tobi

October 15, 2012, 04:28
#7
New Member

Mark Huang
Join Date: Oct 2012
Posts: 6
Rep Power: 13
Quote:
 Originally Posted by Tobi Hi, you can solve solid/solid regions. I did it in my bachelorthesis. To your questions with the resistance between the solids. Good question. I dont know. Maybe there are some new BC for that problem. But I am not up to date. If you want, I can upload a testcase for 2 solid regions (2 cylinder) Its 2 years ago that I worked with the chtMultiRegionSimpleFoam but it should work! Regard Tobi

Hi Tobi,

I do need your test case for reference due to I'm quite new with OpenFoam.
I very appreciate !
Besides, do you know the difference between chtMultiRegionSimpleFoam and chtMultiRegionFoam ?

Regards,
Mark

October 15, 2012, 18:15
#8
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Hi,

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

chtMultiRegionSimpleFoam is a steady state solver. So the time derivations are neglegted couse in a steady state solution the changes in time are zero.

The code therfor is (just for the solid regions):
Code:
```        fvScalarMatrix tEqn
(
-fvm::laplacian(kappa, T)
);
tEqn.relax();
tEqn.solve();```
chtMultiRegionSimpleFoam solves the equation with time derivations. So you are solving a transient problem.

The code therefor is (just for the solid regions):
Code:
```        tmp<fvScalarMatrix> TEqn
(
fvm::ddt(rho*cp, T)
- fvm::laplacian(kappa, T)
);
TEqn().relax();
TEqn().solve(mesh.solver(T.select(finalIter)));```
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

If you have a look at both equations you can see that for a steady-state solution the values of cp and rho doesn't matter.

Maybe easier?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you have a look at the solver "scalarTransportFoam" there is the following implemented:

Code:
```            solve
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(DT, T)
);```
where T is a simple scalar (like the temperature).
You can modify this solver by comment out the first both terms:
Code:
```            solve
(
//  fvm::ddt(T)
//+ fvm::div(phi, T)
- fvm::laplacian(DT, T)
);```
Now its like the chtMultiRegionSimpleFoam for "ONE" region. Now you have to implement the second region and the
interaction between these two regions. But you are new to OpenFOAM so I think you wanna use chtMultiRegionSimpleFoam

Info
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
My old case does not work anymore and I had to make it working with OF-2.1.x again.
I saw new thermodynamic libs for the solid region. In the new version you are able
to set directional solid values like conductivity for (x,y,z). Have a look at the file

Code:
```thermoType constSolidThermo;
//thermoType isotropicKSolidThermo;
//thermoType directionalKSolidThermo;
Testcase
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

I used a simple test-case in my bachelorthesis to check the solution of the solver.
Therefor I used two pipes and a fixed inner and outer temperature. With that I calculated the heatflux q and compared it with the empirical model:

T_inner = 773K
T_outer = 303K

--> q empirical = 214,16 W
--> q_simulation = 213,48 W

--> T_interface_empirical = 552,45 K
--> T_interface_numerical = 551,09 K

Maybe the solution was not converged enough (I was a beginner at that time). But its very accurate.
Further more the empirical equation uses a logarithmic function for the temperature, which can be also shown with the

Code:
```Solving for solid region kieselgur
DICPCG:  Solving for T, Initial residual = 0.00087073769, Final residual = 1.1952783e-05, No Iterations 2
Min/max T:434.01808 773

Solving for solid region glaswolle
DICPCG:  Solving for T, Initial residual = 0.00079268991, Final residual = 1.0810456e-05, No Iterations 2
Min/max T:303 437.02853
ExecutionTime = 6.07 s  ClockTime = 6 s

Time = 242```
How to run the testcase
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

2. untar the file
3. move it to your \$FOAM_RUN folder
4. switch into the directory
5. ./solve
6. paraview
7. open the two files build by solve.sh

enjoy

- - - - - - - - - - -
Regard
Tobi

PS: Plot of residual and temperature curvature is attached
PPS: I am very tierd now; good night everybody

Case is updated 19.10.2012
Thank you Mark for telling me the problem
Attached Images
 Tplot.jpg (32.4 KB, 323 views) Residuen.jpg (15.6 KB, 194 views)
Attached Files
 chtMultiRegionSimpleFoam_case_cremona.tar.gz (7.4 KB, 435 views)

Last edited by Tobi; October 19, 2012 at 03:58. Reason: Updated the case

 October 16, 2012, 05:02 #9 New Member   Mark Huang Join Date: Oct 2012 Posts: 6 Rep Power: 13 Thanks Tobi, I got your case, and I'v check it already. I would like to ask another question. In my case , I establish different structure with yours, so I have to mesh it. However, I couldn't generate a file "cellToRegion" in the \0 directory. How can I create it? Thanks a lot.. Regards Mark p.s. The platform I run openFoam is in Windows System. I purchased a software which is named OpenFlow and it is a native Windows port of OpenFOAM 2.1.x. by Symscape company.

October 16, 2012, 08:00
#10
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Quote:
 Originally Posted by cremona Thanks Tobi, I got your case, and I'v check it already. I would like to ask another question. In my case , I establish different structure with yours, so I have to mesh it. However, I couldn't generate a file "cellToRegion" in the \0 directory. How can I create it? Thanks a lot.. Regards Mark p.s. The platform I run openFoam is in Windows System. I purchased a software which is named OpenFlow and it is a native Windows port of OpenFOAM 2.1.x. by Symscape company.

Hi,
is that file necessary?
I think that was a file I created with snappyHexMesh in a case befor
Delete it please I think it should work without.

Tobi

PS: I know windows operating systems/software for openfoam too but I am an oldschool terminal/script user

October 16, 2012, 08:10
#11
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Quote:
 Originally Posted by akidess LaplacianFoam just expects a scalar value for the diffusivity, thus it is not set up to handle varying material properties. You can easily replace the dimensionedScalar in the code by a volScalarField which you initialize using setFields (you can probably even find the necessary code here on the forum). Alternatively you can use chtMultiRegionFoam, but I think that will be more work. - Anton

Notice
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
like Anton mentioned, the laplacianFoam solves the scalarField for the
temperature field with a scalar conductivity. The chtMultiRegionSimpleFoam is able
to use a direction depended conductivity by using the thermodynamic models
which are included in the chtMultiRegionFoam for the solid regions.

Last edited by Tobi; October 16, 2012 at 10:37. Reason: Messed up things!!!

 October 16, 2012, 09:02 #12 Senior Member     Anton Kidess Join Date: May 2009 Location: Germany Posts: 1,377 Rep Power: 30 Tobi, your last post doesn't make sense to me. Temperature will never be a vector, so why use fvVectorMatrix? __________________ *On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer.

October 16, 2012, 10:22
#13
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Quote:
 Originally Posted by akidess Tobi, your last post doesn't make sense to me. Temperature will never be a vector, so why use fvVectorMatrix?
You are right.

I messed up a few things ...
Uppssss ...

Wanted to make it possible to use directional depended thermal conductivity, couse in the version 1.7, there are no model for that.
But now I saw that you can use the thermodynamic model for that!

Last edited by Tobi; October 16, 2012 at 10:35. Reason: Last edit

October 18, 2012, 20:28
#14
New Member

Mark Huang
Join Date: Oct 2012
Posts: 6
Rep Power: 13
Quote:
 Originally Posted by Tobi Hi, is that file necessary? I think that was a file I created with snappyHexMesh in a case befor Delete it please I think it should work without. Tobi PS: I know windows operating systems/software for openfoam too but I am an oldschool terminal/script user

Hi Tobi,

There is still a problem with running your case. After I ran the case by chtMultiRegionSimpleFoam solver, I got an error message
" patch type 'patch' not type 'directMappedPatchBase' for patch kieselgur_to_glaswolle of field T in file "D:/example/0/T" "

Then, I changed the relavent keyword 'patch' to 'directMappedPatchBase' in your case and my case, but again I got an error message
" patch type 'genericPatch' not type 'directMappedPatchBase' for patch kieselgur_to_glaswolle of field T in file "D:/example/0/T" "

Now, I have no ideas to cope with this problem.
Do you have any ideas about it? Or anyone can give me some suggestion.
Thanks....

Regards,
Mark

October 19, 2012, 03:28
#15
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Quote:
 Originally Posted by cremona Hi Tobi, There is still a problem with running your case. After I ran the case by chtMultiRegionSimpleFoam solver, I got an error message " patch type 'patch' not type 'directMappedPatchBase' for patch kieselgur_to_glaswolle of field T in file "D:/example/0/T" " Then, I changed the relavent keyword 'patch' to 'directMappedPatchBase' in your case and my case, but again I got an error message " patch type 'genericPatch' not type 'directMappedPatchBase' for patch kieselgur_to_glaswolle of field T in file "D:/example/0/T" " Now, I have no ideas to cope with this problem. Do you have any ideas about it? Or anyone can give me some suggestion. Thanks.... Regards, Mark
Oh sorry.
That problem is coused by the patch type in your
Code:
`/constant/SOLIDREGION/polyMesh/boundary`
I ll have a look at that now.
One moment

October 19, 2012, 03:55
#16
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Quote:
 Originally Posted by cremona Hi Tobi, " patch type 'patch' not type 'directMappedPatchBase' for patch kieselgur_to_glaswolle of field T in file "D:/example/0/T" " Mark

Hi Mark,

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

If you use chtMultiRegion solver you are using several domains which
must be connected. So the interfaces between two solid regions are
of patchType
Code:
`type        mappedWall;`
But thats not all you have do modify.
Normally a patch type looks like that one:
Code:
```myPatch
{
type               patch;
nFaces           4;
startFace       168;
}```
for the interfaces in chtMulti solver you have to use that patch
Code:
```myPatch1_to_myPatch2
{
type                   mappedWall;
nFaces               10;
startFace           222;
sampleMode      nearestPatchFace;
sampleRegion    mySolid2;
samplePatch      myPatch1_to_myPatch2;
offsetMode        uniform;
offset                ( 0 0 0 );
}```
Again
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

You can make your mesh by typing the command:
Code:
```blockMesh -region glaswolle
blockMesh -region kieselgur```
in your terminal. After that compare the files:

Code:
```constant/glaswolle/polyMesh/boundary
constant/glaswolle/polyMesh/boundary.backup

constant/kieselgur/polyMesh/boundary
constant/kieselgur/polyMesh/boundary.backup```
I think that makes everything clear.
It should be possible to set the boundary condition in blockMeshDict
but I dont know how to do that.

The case should run now by using
Code:
`./solve`
Regard
Tobi

November 5, 2012, 15:53
#17
New Member

Romain
Join Date: Jun 2010
Location: Lyon
Posts: 28
Rep Power: 15
Quote:
 Originally Posted by Tobi Hi, you can solve solid/solid regions. I did it in my bachelorthesis. To your questions with the resistance between the solids. Good question. I dont know. Maybe there are some new BC for that problem. But I am not up to date. If you want, I can upload a testcase for 2 solid regions (2 cylinder) Its 2 years ago that I worked with the chtMultiRegionSimpleFoam but it should work! Regard Tobi
I have the exact same problem : how to simulate a contact resistance between two solids.
It seems to me that the only available boundary condition in chtMultiRegionFoam for interface between two solids, or a solid and a fluid will always be :
Code:
```			type            compressible::turbulentTemperatureCoupledBaffleMixed;
neighbourFieldName T;
K               solidThermo;
KName           none;
value           uniform 321.34;```
it will assume a perfect contact between the two solids, or calculate the heat transfer coefficient (explained here and here )

Coming from this analysis, I have three possibilities
-a small region between the two solids, which will simulates the contact resistance (Rth=e/lambda*S, with low e, and really low lambda), but it could be difficult for the most complex geometries

-use swak4foam. But it does not seems to be able to do what I want... Still looking on that.

-modify the boundary condition such that the boundary will not impose the same temperature on each side (source code here)

anyway if someone has any ideas or a few hints it will surely speed up the process

November 5, 2012, 17:14
#18
Super Moderator

Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Quote:
 Originally Posted by nakor I have the exact same problem : how to simulate a contact resistance between two solids. It seems to me that the only available boundary condition in chtMultiRegionFoam for interface between two solids, or a solid and a fluid will always be : Code: ``` type compressible::turbulentTemperatureCoupledBaffleMixed; neighbourFieldName T; K solidThermo; KName none; value uniform 321.34;``` it will assume a perfect contact between the two solids, or calculate the heat transfer coefficient (explained here and here )
Yes I think so too!

Quote:
 Originally Posted by nakor Coming from this analysis, I have three possibilities -a small region between the two solids, which will simulates the contact resistance (Rth=e/lambda*S, with low e, and really low lambda), but it could be difficult for the most complex geometries
sounds good but I am withyou! For complex geometries it would be very hard to do it
Quote:
 Originally Posted by nakor -use swak4foam. But it does not seems to be able to do what I want... Still looking on that.
Hmmm I think its possible to do that. But like I told befor, its two years ago that I worked with that solver
Quote:
 Originally Posted by nakor -modify the boundary condition such that the boundary will not impose the same temperature on each side (source code here)
Well that sounds good.
I can create a new BC (but not now - in Dez/Jan maybe, if I dont forget it and have time)... the problem I think is, how would you calculate your resistance?

If you put two plates together you have a resistance thats clear, but what value would you set or is it possible to calculate it with some empiric equations which depend on the surface?

Tobi

November 5, 2012, 18:01
#19
New Member

Romain
Join Date: Jun 2010
Location: Lyon
Posts: 28
Rep Power: 15
Quote:
 Originally Posted by Tobi Hmmm I think its possible to do that. But like I told befor, its two years ago that I worked with that solver
I am not sure that it will be possible with swak4foam since I am just starting with this nice tool, but it seems promising.

If we are only considering one boundary between two solids, namely solid 1 and solid 2, and one heat flux through said boundary, we will have one surface we will be hotter than the other (Tside1=Tside2+flux*Rth)
Thus, one boundary which could work will be
Code:
```Side2
{
type groovyBC;
value uniform Tinit;
valueExpression "Tside1+DT*q";
variables "Tside1{side1/solid1}=average(T);DT=cst;q=?";
}```
The main problem here would be to determine the heat flux which go through the boundary... It could be obtain with something like q = DeltaT* (lambda*S/e) for a really small e near the boundary.
But I do not know (yet) how to do that.

Quote:
 Originally Posted by Tobi Well that sounds good. I can create a new BC (but not now - in Dez/Jan maybe, if I dont forget it and have time)... the problem I think is, how would you calculate your resistance? If you put two plates together you have a resistance thats clear, but what value would you set or is it possible to calculate it with some empiric equations which depend on the surface?
I do like this approach too, but the source code does not seem that easy to understand, I will need to spend some time on it.
I think the easiest way to go is to let the user define the resistance in Km2/W between two surfaces.
After that, the boundary will have to maintain a constant heat flow on each side of the boundary, but the temperature on each side of this boundary will be different depending on the specified thermal resistance.

 November 9, 2012, 08:32 #20 New Member   Romain Join Date: Jun 2010 Location: Lyon Posts: 28 Rep Power: 15 After some research, swak4foam does not seems to be adaptated to our problems. It will average the temperature on each patch, so I will lose the spatial informations. But I had an other idea before attempting to look into the boundary condition source code. It seem that a baffle could answer to my problem. If I understand correctly how it is working, it could create a small region between the two solids, which will simulates the contact resistance with Rth=e/lambda*S Code: ```zone1_to_zone2 { type directMappedWallVariableThickness; // This thickness is used if the baffle is 1D. thickness uniform 0.005; }``` Does anyone have any previous experiense with those thermal baffles ? thermal baffles release note edit:Thermal baffle is perfect! But it is not adapted to mappedPatch, only to genericPatch It seem that I will have to look inside the code of turbulentTemperatureCoupledBaffleMixed and try to modify it a bit.. Last edited by nakor; November 9, 2012 at 14:39.