CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   How to solve a heat conduction between two different solid materials ? (http://www.cfd-online.com/Forums/openfoam/107898-how-solve-heat-conduction-between-two-different-solid-materials.html)

cremona October 9, 2012 02:41

How to solve a heat conduction between two different solid materials ?
 
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...

akidess October 9, 2012 03:09

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

cremona October 10, 2012 22:41

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

Tobi October 11, 2012 07:33

Quote:

Originally Posted by cremona (Post 386070)
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

cremona October 15, 2012 02:52

Quote:

Originally Posted by Tobi (Post 386137)
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

Tobi October 15, 2012 04:07

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

cremona October 15, 2012 04:28

Quote:

Originally Posted by Tobi (Post 386624)
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

Tobi October 15, 2012 18:15

3 Attachment(s)
Hi,

first to your questions:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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;
//thermoType solidMixtureThermo<multiComponentSolidMixture<exponentialSolidTransport<constSolidRad<exponentialSolidThermo<constRho>>>>>;

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
chart added in the attachment.

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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

1. Download the tar file
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

cremona October 16, 2012 05:02

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.

Tobi October 16, 2012 08:00

Quote:

Originally Posted by cremona (Post 386828)
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 ;)

Tobi October 16, 2012 08:10

Quote:

Originally Posted by akidess (Post 385651)
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.

akidess October 16, 2012 09:02

Tobi, your last post doesn't make sense to me. Temperature will never be a vector, so why use fvVectorMatrix?

Tobi October 16, 2012 10:22

Quote:

Originally Posted by akidess (Post 386879)
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!

Thanks for your comment.

cremona October 18, 2012 20:28

Quote:

Originally Posted by Tobi (Post 386865)
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

Tobi October 19, 2012 03:28

Quote:

Originally Posted by cremona (Post 387415)
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 :)

Tobi October 19, 2012 03:55

Quote:

Originally Posted by cremona (Post 387415)
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,

please download the tar.gz file again. I forget a file called "boundary.backup" in the /constant/kieselgur/polyMesh" folder.


To clear your mind
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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

nakor November 5, 2012 16:53

Quote:

Originally Posted by Tobi (Post 386624)
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 :D

Tobi November 5, 2012 18:14

Quote:

Originally Posted by nakor (Post 390414)
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 (Post 390414)
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 (Post 390414)
-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 (Post 390414)
-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

nakor November 5, 2012 19:01

Quote:

Originally Posted by Tobi (Post 390429)
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 (Post 390429)
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.

nakor November 9, 2012 09:32

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..


All times are GMT -4. The time now is 04:26.