CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Heat transfer with solid elements conduction (https://www.cfd-online.com/Forums/openfoam-solving/58173-heat-transfer-solid-elements-conduction.html)

helmut September 12, 2006 16:09

Hi everyone, I'm trying to
 
Hi everyone,

I'm trying to implement Henry Weller's earlier suggestion that "Another two-mesh approach would be to have one mesh for the fluid and one mesh for the thermal equation, i.e. a mesh of everything, and transfer fields between the two. This gives implicit coupling between the regions for the thermal equation but sufferes from a modest storage overhead and the need for quite a bit of mapping code but is also possible in OpenFOAM but has not yet been tried."

I've made some progress with this, but I'm still having difficulties. Please refer to my post of 2006 August 18, this thread, for more details on my test case.

The very high temperatures at the outlets reported in that aforementioned post apparently resulted from my failure to correctBoundaryConditions() of the whole-mesh velocity field after mapping the computed velocities from the submeshes to the whole mesh.

The temperature boundary conditions demand a solution in the range [300,400], but the actual solution is now in the range (292.1, 401.3). The too-high values are near the outer boundaries along the material interfaces, and the too-low values are near the outer boundaries at the inlet.

I'm at a loss for where to go from here ...

Thanks and best regards,
Helmut

helmut October 3, 2006 11:23

Further to my question of Sept
 
Further to my question of September 12, I think the problem might be that the temperature interface condition, k1*gradT on the region1 side of the interface = k2*gradT on the region2 side of the interface, is not represented in the temperature equation. The exterior temperature boundary conditions are set in the boundary condition section of the T field. Is there some way in OpenFOAM to set the interface condition so that it gets into the matrix equation?

khleitz April 18, 2007 04:17

Hallo, I want to implement a
 
Hallo,
I want to implement a local heat source in OpenFOAM.
Can anyone give me a useful tip how to do that?

oscar_j July 10, 2007 00:32

Hello to All, I'm a new OF
 
Hello to All,

I'm a new OF user and I'm interesed in to simulate transfer heat by the three process: Conduction, Convection and Radiation but I haven't found info about that. Is it possible? What about examples and/or tutorials?

I have the impression that isn't so simple and it's scarce the info about this subject.

I appreciate any help.

Thanks!

oscar_j July 10, 2007 23:44

hi, I am trying to get the
 
hi,

I am trying to get the compilation of the laplacianFoam solver with wmake. But some errors happens.

I type within $FOAM_APP/solvers/basic/laplacianFoam directory (OpenFOAM-1.4) simply 'wmake' but I have error messages like these:

/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3916: error: variable or field '_M_initialize_moneypunct' declared void
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3916: error: 'int std::moneypunct<wchar_t,>::_M_initialize_moneypunc t' is not a static member of 'class std::moneypunct<wchar_t,>'
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3916: error: '__c_locale' was not declared in this scope
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3917: error: expected primary-expression before 'const'
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3917: error: initializer expression list treated as compound expression
/home/oscar/OpenFOAM/linux/gcc-4.1.2/bin/../lib/gcc/i686-pc-linux-gnu/4.1.2/../. ./../../include/c++/4.1.2/bits/locale_facets.h:3921: error: variable or field '_M_initialize_moneypunct' declared void



What's my mistake?

Thanks!
Oscar

stephan July 27, 2007 11:26

hi, i have problems converti
 
hi,
i have problems converting to VTK.
it workes with -mesh-option but only for one timestep...
Any hints?
greetings
stephan

sradl July 30, 2007 01:07

Dear Stephan use the PyFoam
 
Dear Stephan

use the PyFoam script of Bernhard:
http://openfoamwiki.net/index.php/Ho...rocMultiregion

It's really great and is much faster than converting to VTK.

br
Stefan

stephan July 30, 2007 19:53

hi, thanx for the hint! re
 
hi,

thanx for the hint!
regards
stephan

oscar_j August 17, 2007 19:34

Hi everybody I'm interested
 
Hi everybody

I'm interested in to simulate heat transfer between many regions, so I'm working on conjugated2 solver posted at Friday, August 26, 2005 by Daniele but when I compile some errors happen:

readSIMPLEControls1.H: In function 'int main(int, char**)':
readSIMPLEControls1.H:33: error: 'findRefCell' was not declared in this scope
readSIMPLEControls1.H:39: warning: use of old-style cast
readSIMPLEControls1.H:40: warning: use of old-style cast
readSIMPLEControls1.H:39: warning: use of old-style cast
readSIMPLEControls1.H:40: warning: use of old-style cast
make: *** [Make/linuxGcc4DPOpt/conjugateFoam2.o] Error 1

I think that those errors are produced by the following code part in readSIMPLEControls1.H:

label pRefCellNew = findRefCell(mesh1, pRefCell);

if (pRefCellNew != pRefCell)
{
pRefCell = pRefCellNew;

((dictionary&)simple).remove("pRefCell");
((dictionary&)simple).add("pRefCell", pRefCell);
}

I work in OpenFOAM-1.4. What is the findRefCell(mesh1, pRefCell) function for OpenFOAM-1.4 and how can I use it ?

Many Thanks
Oscar G

panara August 18, 2007 06:35

I think is a problem with the
 
I think is a problem with the OF 1.4
compare the readSIMPLEControls of the 1.4 version with the one used with conjugateFoam and change mesh with mesh1 or mesh2 and recompile..

I am not sure that it works, I have got no time even to install OF 1.4..

The other possibility is to use the OF 1.3

Daniele

oscar_j August 18, 2007 19:43

Hi Daniele Thanks for quick r
 
Hi Daniele
Thanks for quick response.

Working in OF-1.4, I tryed having the Make/files file like:

conjugateFoam2.C

EXE = $(FOAM_USER_APPBIN)/conjugateFoam2

and the Make/options like:

EXE_INC = \
-I$(LIB_SRC)/cfdTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteVolume/cfdTools/general \
-I$(LIB_SRC)/finiteVolume/cfdTools/general/findRefCell

EXE_LIBS = \
-lcfdTools \
-lfiniteVolume \
-lfindRefCell

but it didnt work, I get the following:

bash-3.1$ wmake
Making dependency list for source file conjugateFoam2.C
SOURCE=conjugateFoam2.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/oscarj/OpenFOAM/OpenFOAM-1.4/src/cfdTools/lnInclude -I/home/oscarj/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/home/oscarj/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/cfdTools/general -I/home/oscarj/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/cfdTools/general/findRefCe ll -IlnInclude -I. -I/home/oscarj/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGcc4DPOpt/conjugateFoam2.o
createMeshes.H: In function 'int main(int, char**)':
createMeshes.H:15: error: 'class Foam::fvMesh' has no member named 'constructAndClear'
createMeshes.H:31: error: 'class Foam::fvMesh' has no member named 'constructAndClear'
readSIMPLEControls1.H:33: error: 'findRefCell' was not declared in this scope
readSIMPLEControls1.H:39: warning: use of old-style cast
readSIMPLEControls1.H:40: warning: use of old-style cast
make: *** [Make/linuxGcc4DPOpt/conjugateFoam2.o] Error 1

What could I do?...

Beforehand thank you very much for your valuable help.

Have a good day
Oscar G

ariorus August 20, 2007 05:39

Hello, some months ago I ha
 
Hello,

some months ago I have been playing a little with the coniugate heat application written by Daniele, for compiling it with openFOAM 1.4.

The modified application uses also intepolations so it should not be necessary that solid mesh and fluid mesh be coincident at the solid faces.

I used buoyantFoam as reference.

I'm attaching herewith the application

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif coniugate_interp.tgz

and a test_case
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif test_coniugate_interp.tgz
(in the testcase I removed solid and fluid mesh files).

Hope this can be useful, anyway I have to warn you it has not been tested very much.

Ciao.

Rosario.

kmurphy August 20, 2007 07:57

Hi Oscar, My (limited) unde
 
Hi Oscar,

My (limited) understanding is that the call to constructAndClear is no longer needed.

In OpenFOAM 1.3 fvMesh had a method called constructAndClear which according to the code comments performed the tasks:
// Construct all necessary data and clear all storage
// Force creation of geometric data
// Force creation of interpolation weights
(see OpenFOAM-1.3/src/finiteVolume/fvMesh/fvMesh.C)

The method constructAndClear or a similar named method does not appear to exist in the corresponding file in OpenFOAM 1.4.
(see OpenFOAM-1.4/src/finiteVolume/fvMesh/fvMesh.C)


At some point in the past (I think when upgrading to OpenFOAM 1.3) I also removed the call to findRefCell from the readSIMPLEControls.H file. I was sure that I had read a suggestion to this somewhere but a quick search this morning failed to find the reference. However, the call to findRefCell does not also appear in the
/src/finiteVolume/lnInclude/readSIMPLEControls.H from version 1.3 on so maybe I just followed (blindly) what was happening in the standard code.

Hope this helps,
Kieran

oscar_j August 21, 2007 16:04

Hi everybody, thanks a lot fo
 
Hi everybody,
thanks a lot for your help.

I have followed your suggestions and indeed my error messages are due to my Openfoam-1.4 version. These errors are about reorganisations of the source code for each Openfoam version.

http://openfoamwiki.net/index.php/Ho...versions_to_13

I will tell you about the results that I get.

Thank you very much
Oscar

ariorus September 3, 2007 04:39

Hi Oscar, I had a look at y
 
Hi Oscar,

I had a look at your code for the boundary conditions and, as as far as I understand, it is ok..
I guess it should be possible to improve a little the setting of the boundary conditions on the solid, to make it clearer the choice between heat flux or temperature specification.

Just a general observation: probably it is better to have prisms near the solid faces of the fluid mesh in order to have a good approximation of the normal gradients.



Ciao.

Rosario.

ps: To attach files read this:
http://www.cfd-online.com/cgi-bin/Op...matting#images

oscar_j September 5, 2007 21:46

Hi Rosario, I have been wor
 
Hi Rosario,

I have been working in a solver for OF-1.4 that simulates the heat transfer by conduction between two coupled tridimensional solids by one patch. I appreciate any comment.

This is the solver:



and this is the case:



I would want to comparate the simulation with the analytic solution for the two coupled solids by one patch for heat conduction, where could I find it?

Thanks!
Oscar

oscar_j September 5, 2007 22:02

Hi Rosario, I have been wor
 
Hi Rosario,

I have been working in a solver for OF-1.4 that simulates the heat transfer by conduction between two coupled tridimensional solids by one patch. I appreciate any comment.

This is the solver:



and this is the case:



I would want to comparate the simulation with the analytic solution for the two coupled solids by one patch for heat conduction, where could I find it?

Thanks!
Oscar

oscar_j September 6, 2007 10:54

solver
 
solver



stephan September 6, 2007 10:57

hi, try carslaw and jaeger
 
hi,

try carslaw and jaeger with "heat conduction in solids"(hope i get the names right?!).
on the other hand crank "mathematics of diffusion" could be nice too...
regards
stephan

oscar_j September 6, 2007 14:39

Hi everybody, The simulati
 
Hi everybody,

The simulation consists on a 3D case which has two coupled 3D solids with different thermal conductivities.

These are heat conduction solver and case for two coupled 3D solids. Solids are coupled by one patch. I havent comparate the numerical solution with analytic solution. I appreciate any comment and info about the solution analytic for two coupled solids.

two coupled solids Solver:

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif twomeshes.tar.gz

Test Case:

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif Twoblocks1patch.tar.gz

Have a good day
Oscar

ariorus September 7, 2007 07:00

Hello Oscar, I looked at yo
 
Hello Oscar,

I looked at your code and I have a question about it.


Since the two equations are solved one after the other and not at the same time it is necessary to solve them many times such that the proper boundary conditions at the interface be satisfied, and you do this.
So you first solve the two solid equations and then reset the bc values of the coupled patches according to what is specified in the 0/T files.
But as far as I understood you reset the gradient value in solid2, if fixedGradient is specified in solid2 0/T file, and the temperature value in solid1 if fixedValue is specified in solid1 0/T file. What happens if you put for instance fixedGradient in both solid1 and solid2 coupled patch? Do you reset only the gradient value and not the temperature?

I may be wrong (if so please correct me) but I think that at every time>0 at the interface between cells of the 2 solids you should have always that the temperature and the heat flux be the same. Did you check this?

You could also try to see what happens playing with conductivity (if a conductivity for a solid is equal to zero you should recover a fixed temperature bc for the other).

I think that an analytical solution should be not too difficult to be found, for instance you could set up a 1D problem.

Ciao.

Rosario

oscar_j September 8, 2007 19:46

Hi Rosario, thanks for your c
 
Hi Rosario,
thanks for your comments.

My first idea in order to couple the two solids is to suposse no heat generation in the interface, so I want to couple the solids like Daniele propose:

T1=T2, at interface
dT2/dn=-k1/k2*dT1/dn, at interface

I think if you put fixedGradient in the two solids it could happen an error when the code reads a patch defined like fixedGradient initially and then it try to set fixedValue.

The solver hasnt been tested yet.
Any help and comment I appreciate so much.

Thanks a lot!
Oscar

oscar_j September 9, 2007 15:44

Hi Rosario, I post the fir
 
Hi Rosario,

I post the first results I have obtained with twomeshes Solver. The case consists in two coupled cubes with 1 meter of side length and same material. The initial temperatures are T1=285K and T2=293K. With these considerations, the temperature of thermal balance would be T=289K. The image is a cross-sectional of the cubes.

http://www.cfd-online.com/OpenFOAM_D...your_image.gif

Although the thermal balance is obtained, in the interface the temperature distribution has a rare variation around the thermal balance temperature, Any idea how could I make better the code?

Regards
Oscar

oscar_j September 9, 2007 15:48

Sorry http://www.cfd-online.co
 
Sorry http://www.cfd-online.com/OpenFOAM_D...part/happy.gif
This is the image:
http://www.cfd-online.com/OpenFOAM_D...ges/1/5359.png

connclark September 21, 2007 12:21

I'm trying to use openFoam to
 
I'm trying to use openFoam to simulate cooling of electronics by convection currents in a case as well as the heat dissipated by the case by convection as well.

Unfortunately, I can't seem to get any of these solvers posted to this thread to work with OpenFOAM 1.4.1 :-(

Also I was wondering about how one could do a continuous power input to a solid instead of specifying a temperature.

Forgive me I'm new to openfoam.

sradl September 22, 2007 04:41

Dear Clark, search the open
 
Dear Clark,

search the openfoamwiki for conjugate heat transfer - the solvers posted there should also work with OF 1.4.1 (not tested by myself).

Specifying a continous power input (e.g. W/m2) means that you will have a constant temperature gradient in the solid at the interface. Thus, dT/dx = q/lambda, where lambda is the heat conductivity of the solid. Specifying a constant gradient at the interface is a standard OF boundary condition :-)

br
Stefan

sradl September 22, 2007 04:42

sorry, of course heat flows ac
 
sorry, of course heat flows across the negative temperature gradient:

q=-dT/dx.lambda

cheers
stefan

connclark September 24, 2007 12:52

Stefan, I have tried to get
 
Stefan,

I have tried to get the example of the conjugate heat transfer found here http://openfoamwiki.net/index.php/HeatTransfer
to work. I was able to hack the code so it compiled, however there are differences in the case file directory structure that I can't figure out how to solve. The main issue being how to combine the fluid region and the solid region in the constant directory so that the 1.4.1 based solver can read it.

Also note that the src tar ball for the pseudo heat solver doesn't contain the code for it.

armin_h September 26, 2007 01:15

Dear All I am a new user of
 
Dear All

I am a new user of OpenFoam as phd petroleum candidate, and i need to simulate fluid flow through the pipe , which should be cilynder.

I will be appreciate if someone let me know how can i create pipe shape in OpenFoam, and which part of OpenFoam Will help me to do so.

Many Thx in advance

sradl September 29, 2007 14:44

Dear Clark, it should be ea
 
Dear Clark,

it should be easy to find the code section in 1.4.1 where the source directory is defined for reading the mesh info. Just study the code - you should have a "solidRegion" and a "fluidRegion" directory under your case/constant directory; both solidRegion and fluidRegion should have a "polyMesh" dir.

In your case you possibly will need two liquid regions (the air inside and outside the case) as well as the metal. So I guess you need a major review of the solver.

br
Stefan Radl

cedric_duprat October 10, 2007 11:27

Dear Forum, My question is
 
Dear Forum,

My question is not a convection one but a coupling one and this thread is the more interresting one about coupling.
I'm doing a solver for coupling 2 fluids regions. In my case, I want to couple a channelOodles region and a Oodles one. It's usefull is you want to get turbulent flow without adding white noise.
I used a lot your upper convection solver to do that.

but, I still have one problem in the createFields.H files:

createFields.H:65: error: no matching function for call to 'Foam::dictionary::New(Foam::volVectorField&, Foam::surfaceScalarField&)'
/craya/big/duprat/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/dictionary.H:10 5: note: candidates are: static Foam::autoPtr<foam::dictionary> Foam::dictionary::New(Foam::Istream&)


it correspond to the following source:

autoPtr<transportmodel> laminarTransport1
(
transportModel::New
(
U1,
phi1
)
);

autoPtr<lesmodel> sgsModel1
(
LESmodel::New
(
U1,
phi1,
laminarTransport1()
)
);

in the Mattijs Janssens upper code, there is still line like that.
So my question is, Is there any constructor to create in the dictionnary files (.C and .H) or I made a mistake ther ?

Thank you for helping,
Regards,

Cedric

eugene October 11, 2007 06:11

If you want fully developed in
 
If you want fully developed inlet, it is much easier to use the directMappedFixedValue boundary to map internal fields to the boundary than to use a 2 mesh solution.

panara October 11, 2007 08:22

Hi Eugene, that is interestin
 
Hi Eugene,
that is interesting, can you post an example of the blockmesh file with the internal field and ,for example, of the U file with the directMappedFixedValue BC?

I would like to simulate a long pipe with an oscillating flow and a section with heat transfer..

So my idea would be to have a first part of the channel with 'internal periodic BC' which will feed the second part with the heat transfer..

I oscillate the flow with a source term in the momentum equation.

I guess I am going to have problems when the flow reverse.. but I will think about that later on.. =)

For now, it is interesting for me just to try a pulsating channel (no reverse flow) and in this case it should work fine..

Daniele

eugene October 11, 2007 09:40

Sure. In this example "inlet"
 
Sure. In this example "inlet" refers to the patch that uses internal mapping:

1. In constant/polyMesh/boundary

inlet
{
type directMappedPatch;
nFaces #;
startFace #;
offset (<offset> 0 0 1)
}

2. Normally you need to map velocity and turbulent properties. Thus in U file boundary section:

inlet
{
type directMappedFixedValue;
value (<placeholder> 0 0 0);
average (<target> 0 0 2);
}

The "average" entry is not compulsory. For example a hypothetical k field inlet would look like this:

inlet
{
type directMappedFixedValue;
value (<placeholder> 1e-10);
}

Unfortunately, the "directMappedPatch" boundary mesh type is not yet supported by decomposePar and other mesh manipulation utilities. So if you want to run in parallel, you will have to manually edit the processor boundary files to add the directMappedPatch entries.

cedric_duprat October 11, 2007 09:41

Hi Eugene and Daniele, well
 
Hi Eugene and Daniele,

well, maybe you're write, I will try to use the directMappedFixedValue BC but, before trying, could you explain us what is it please. Because, I the forum, the "directMappedFixedValue" was cited only 3 times now : Eugene 1 today, Daniele 1 few minutes ago and me .... now :o)

more generaly, I think a coupling solver for two fluid will be also the first step for a RANS / LES coupling.

Cedric

cedric_duprat October 11, 2007 09:43

oups ... I'm a little bit lat
 
oups ...
I'm a little bit late... :o)
Thank you Eugene

oscar_j November 7, 2007 21:15

Hi everybody, I would want
 
Hi everybody,

I would want to calculate the mean temperature in a fluid and solid, is there any function or way in order to do that?, I have worked on buoyantfoam for the fluid and laplacianfoam for the solid.

Thanks!
Oscar

tehache November 8, 2007 04:08

Hi Oscar, There is e.g.
 
Hi Oscar,

There is e.g.

fvc::domainIntegrate(T))

to integrate field T

suredross April 7, 2008 05:05

hi, i have a case with 2 inle
 
hi,
i have a case with 2 inlets and an outlet,with 2 different liquids at the inlets.which equation and how do i couple it to work in openfoam?i tried the icoFoam solver but something seems wrong?
i am new to OF and need help,desperately!
thanks
david

ngj April 7, 2008 05:58

Hi Davey Have a look at the
 
Hi Davey

Have a look at the damBreak case in the User Guide. It is using the interFoam solver, which solves for a two-phase flow.

You say you are having two inlets, is it one inlet per fluid, or is there a mixture of the fluids in either inlet?
If the first is the case, you simply specify in the gamma file in /0/gamma that inlet1 has the value 1 and that inlet2 has the value 0. If you have a mixture, it might become somewhat more difficult - I don't know if there are any tools which you could use directly or if you need to program something yourself.

Best regards,

Niels


All times are GMT -4. The time now is 02:07.