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)

mattijs July 27, 2005 18:30

Sounds like a boundary conditi
 
Sounds like a boundary condition problem. Should all three boundaries be fixed value?

Also check if you are running 2D that your geometry is actually 2D. And if running 3D that you do not have any empty patches.

panara August 26, 2005 11:47

I spent some time to test the
 
I spent some time to test the solver I submitted and I realized that there where some mistakes.

I have now corrected the mistakes and tested the code against an analytical solution and it works.

The test case is the same I have already explained, the only difference is that now I run openFoam in 1D to save time and space.

here is the new solver

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

and here is the case

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

mattijs August 26, 2005 13:11

Nice one! First multi-domain s
 
Nice one! First multi-domain solver using the new region stuff.

Already had forgotten about the -mesh option to foamToVTK to postprocess a given region ;-)

(is the only application so far that has been adapted)

From first scan:
- you have '<' (angle brackets) around some patch names. Any reason?
- some patches are of type 'wall', instead of 'patch'.

panara August 26, 2005 14:09

The reason why there are brack
 
The reason why there are brackets and wall is due to the fact that I recycled an old case... =)

The brackets have not importance at all, and I guess the same for the wall thing...

A wall patch is a normal patch with some features for calculating turbulence and wall distances that in my case are not used...

So, you can take away the wall and use patch instead of wall.. the solution should be the same..

Sorry if the code is a bit dirty =) but I am a new user..

I am growing with OpenFoam.. and I thank you all for this opportunity.. This is also to answer to the thread "Typo in foamInstallationTest, version 1.2?"

I understand the fundings problem and I really hope that OpenFoam will survive. I am also planning to save some of the funds I have to buy some support hours in order to perform more future complicated tasks.

To the other side, I aggree with "Public User". Any code development should be supported at the best of our capability.

This is the reason why I posted my "little solver" on the discussion group.

I really hope that the solver can be usefull to someone and further developed in the Open Source phylosopy and in the future versions of OpenFoam.

Regards,

Daniele

panara September 8, 2005 05:42

Dear all, I am now trying t
 
Dear all,

I am now trying to couple laplacianFoam (solid wall) with rhoTurbFoam (fluid).

I have a question about the Temperature field.

It seems that rhoTurbFoam creates only two IOobject that are rho and U in createFields.H

plus

volScalarField& p = thermo->p();

and

volScalarField& h = thermo->h();

the solver solves for the rho equation (continuity), U equation (momentum), p equation (PISO) and h equation (energy).

In the output we find the temperature field and the BC are given using temperature values, but it seems to me that an IOobject for the temperature field is not created..

Am I correct?

If yes, how can I access the values of the temperature field?

in which part of the code the temperature field in output is written? in runTime->write() ?

Thanks in advance for your time,

Daniele

mattijs September 8, 2005 13:54

Have a look in the thermophysi
 
Have a look in the thermophysicalModels library. The base class of all the models (basicThermo.H) has a T() access function.

runTime->write() indeed writes all registered objects (of which T is one)

panara September 9, 2005 05:46

I think I solved the problem,
 
I think I solved the problem,
I added the following lines to basicThermo.H

//- Temperature [K]
// Non-const access allowed for conjugate heat transfer prob.
volScalarField& T()
{
return T_;
}

And I left the code untouched...
it seems to work, I am now testing it.

I think it is not a very elegant solution, any other idea how to solve the problem is wellcome =)

Daniele

unoder September 17, 2005 04:36

Hello, I would like to try
 
Hello,

I would like to try this case and solve the conjugate heat transfer problem myself. I can do the analytical calculcation for a 1D problem myself for comparison purposes using Matlab but since I don't have much experience with Foam, I appreciate a few hints to get starting.

For instance: 1) Do this, 2) Do that 3) Compile 4) Run solver on case 5) View result with paraFoam, etc...

So if some of you could point out what I need to get started with a numerical calculation using conjugateFoam2 and conjugate2bars2 I would probably save hours, since I've never tried to experiment with own solvers and this kind of mesh...

Also, in http://www.cfd-online.com/cgi-bin/Op...=4191#POST4191 Mattijs Janssens writes that one should use buoyantFoam instead. Any explanation for this, to a beginner?

Thanks in advance.

unoder September 20, 2005 14:42

Never mind, it was not so diff
 
Never mind, it was not so difficult to get it working...

Now I need some hints on how to post process, like li... Because in paraview I can only color by "Property"... Haven't figured out how to color by temperature yet...

unoder September 20, 2005 14:47

Never mind, it was not so diff
 
Never mind, it was not so difficult to get it working...

Now I need some hints on how to post process, like li... Because in paraview I can only color by "Property"... Haven't figured out how to color by temperature yet...

panara September 20, 2005 15:18

for postprocessing I did it in
 
for postprocessing I did it in a very dirty way =) but I guess that there is a better way using foamToVTK as Mattijs Janssens suggested...

by the way I modified foamToTecplot in foamToTecplotMultiRegion, changing the following line:

in file createMeshes.H

// in order to process a defined region change region below and recompile


Info<< "region3: Create mesh for time = "
<< runTime.value() << nl << endl;

fvMesh mesh
(
IOobject
(
"region3",
runTime.timeName(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);

mesh.constructAndClear();

in file foamToTecplot

// in order to process different region change region below and
// recompile
IOobjectList objects(mesh, runTime.timeName(),"region3");

and in file writeDXdata.H

// in order to process different region change region below and
// recompile
fileName instance(runTime.timeName()/"region3/");

this works for the region called 'region3' to change region you have to change 'region3' with the name of the other region and recompile the application with wmake

I cannot send the foamToTecplotMultiRegion application because I have problem with my computer.. I hope I have helped you anyway..

Daniele

panara September 20, 2005 15:26

P.S. If you are interested
 
P.S.

If you are interested in graphic-plots you can do the same kind of modifications to sample and create a sampleMultiRegion application...

when I will find some time I will add sampleMultiRegion too...

what kind of problem are you trying to simulate?
for the solid-solid coupling I have already validated the solver in 1D using the analytical solution... are you working on solid-fluid coupling?

Regards and good work,

Daniele

unoder September 21, 2005 12:09

Hi Daniele 1) At this momen
 
Hi Daniele

1) At this moment, I just want to learn how to use Foam and get usable results - I've only used it for 3 weeks or so until now. Too bad, that the tutorial isn't longer.

2) You're right - it looks dirty, what you did. I prefer to look closer at the foamToVTK solution to begin with. Also because I'm not really into this source code and never used such a thing like "foamToTecplotMultiRegion". What is that?

3) I'm interested in graphic-plots for my report. I was told I should look at this sample-utility and I'll look again in the tutorial...

4) To start with, I want to simulate solid-solid heat conduction and compare it analytically. 1D is excellent for that. Later on I hope to be able to simulate a casting process but this seems very complicated (I did a calculation with interFoam-solver and the flow looks realistic, but there's no temperature dependency in that calculation)...

What do you think about that?

arne_henning October 4, 2005 11:26

hallo ! I want to solve the
 
hallo !

I want to solve the laplacian for heat conduction in different joint solids, which have different thermal conductivity....so as far as i can read here, the only possibility is to solve the equation for each material (and mesh) and pass the values at the junctions ?! That's strange for me....since, for example, in the "damBreake" example, they even change the "transportProperty" dynamic with the phase.....
So please tell me, if i missed the point...:-)..or if i can use one mesh for all the materials....

thank you !!

Arne

liugx212 November 29, 2005 17:58

Hi Sergei, You said the cel
 
Hi Sergei,

You said the cell properties can be set. I want to set for different cells but I really do not know hot to do. So I am eager to get your help.

Thanks
Guoxiang

helmut November 30, 2005 10:30

Hi Guoxiang, Check out Bern
 
Hi Guoxiang,

Check out Bernhard Gschaider's 2005 August 22 post to the thread OpenFOAM Message Board: OpenFoam: Meshing / Mesh conversion: Gambit/Fluent: Extension of fluentMeshToFoam: internal cells and faces.

Good luck,
H.

liugx212 December 2, 2005 10:17

Hi Sergei: Thanks, I have c
 
Hi Sergei:

Thanks, I have checked. I want to set the different propertities (mechanical and thermo properties) here. So I am eager to your more advice.

Thanks deeply.
Guoxiang

panara February 15, 2006 05:24

I am trying to make a conjugat
 
I am trying to make a conjugate heat transfer solver running together laplacianFoam and rhoTurbFoam.

I did more or less the same thing I did for the two laplacianFoam case for composite material posted in this tread.

I am getting now very strange results...

I am testing the solver in a pipe configuration.
The exterior of the pipe is manteined at 300K and at the beginning the flow and the pipe are at 700K.

At some point I do not know why but the internal pipe wall get colder than the external pipe wall.
and I have a maximum of the temperature inside the pipe close to the wall...

What I am doing wrong?
Do you have any suggestions?

I post here the solver and the test case I am running, hoping to start a discussion...

Daniele





panara February 15, 2006 05:28

Ops http://www.cfd-online.
 
Ops

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

panara February 15, 2006 05:36

and http://www.cfd-online.
 
and

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

panara February 16, 2006 03:42

I found the error.. it was a s
 
I found the error.. it was a stupid mistake in the evaluation of the heat conductivity ratio..

I attach the modified version for people interested..

Daniele

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

otsuki February 16, 2006 04:36

Hi, Daniele, Thank you for
 
Hi, Daniele,

Thank you for uploading interesting solver and case.
In my OpenFoam-1.2 distribution, your solver cannot
be built by wmake.
In your Make/options,

EXE_INC = \
-I$(LIB_SRC)/cfdTools/compressible \
-I$(LIB_SRC)/cfdTools/lnInclude \
...

But my system, there is no lnInclude/
in cfdTools/ directry but exist in
cfdTools/general/

The version of OpenFOAM is different with yours ?


Masato Otsuki

panara February 16, 2006 11:41

You are right, I should have m
 
You are right, I should have mentioned that I am using the 1.1 version of OpenFoam...

If you change cfdTools with cfdTools/general it should work.

You have also to change the Peqn.H file according to the 2.2 rhoTurbFoam version.

I managed to compile the application in 2.2 but I didn't test it, I get also a lot of suspicious warning...

If you are going to test it with OpenFoam 2.2 please keep me posted

Daniele

hsieh February 16, 2006 15:22

Hi, Daniele, I downloaded y
 
Hi, Daniele,

I downloaded your solver and compiled under OpenFOAM 1.2. The followings are the warnings and errors I got (I will try to see if I can adapt the solver to OpenFOAM 1.2, but, if any one is successfully in adapting the solver to 1.2 first, it will be appreciated if you can post the fix):

SOURCE_DIR=.
SOURCE=conjugateFoam7.C ; g++ -m64 -DlinuxAMD64 -Wall -W -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -ffast-math -DNoRepository -ftemplate-depth-30 -I/home/phsieh/OpenFOAM/OpenFOAM-1.2/src/cfdTools/compressible -I/home/phsieh/OpenFOAM/OpenFOAM-1.2/src/cfdTools/general/lnInclude -I/home/phsieh/OpenFOAM/OpenFOAM-1.2/src/thermophysicalModels/specie/lnInclude -I/home/phsieh/OpenFOAM/OpenFOAM-1.2/src/thermophysicalModels/basic/lnInclude -I/home/phsieh/OpenFOAM/OpenFOAM-1.2/src/turbulenceModels -I/home/phsieh/OpenFOAM/OpenFOAM-1.2/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -c $SOURCE -o Make/linuxAMD64Gcc4Opt/conjugateFoam7.o
readPISOControls.H: In function 'int main(int, char**)':
readPISOControls.H:53: warning: use of old-style cast
readPISOControls.H:54: warning: use of old-style cast
pEqn.H:12: error: 'ddt0' is not a member of 'Foam::fvc'
pEqn.H:15: error: 'ddt0' is not a member of 'Foam::fvc'
pEqn.H:40: error: 'ddt0' is not a member of 'Foam::fvc'
pEqn.H:42: error: 'ddt0' is not a member of 'Foam::fvc'
make: *** [Make/linuxAMD64Gcc4Opt/conjugateFoam7.o] Error 1

Pei

otsuki February 16, 2006 21:46

Hi, Pei-Ying, 1. modify Mak
 
Hi, Pei-Ying,

1. modify Make/options:
EXE_INC = \
-I$(LIB_SRC)/cfdTools/compressible \
-I$(LIB_SRC)/cfdTools/general/lnInclude \
...
2. replace pEqn.H by rhoTurbFoam/pEqn.H
and modify mesh. --> mesh1.
Then you can compile conjugateFoam7 with
OpenFoam-1.2.

You must modify ConjugatePipe/system/fvSchemes
to run the case. I can't run the case yet.

Masato

lillberg February 17, 2006 04:12

Hi Daniele I converted your
 
Hi Daniele

I converted your code to OF1.2 (happy to provide it if someone is interested) but ran into problems when trying it on your case. First iteration is fine, obviously, but in the second timestep the temperature gradient gradT1 is 10e+06, have you seen that before? Consequently the thermodynamics goes ballistic and stop with an error.

//Eric

lillberg February 17, 2006 05:09

Works like a charm... awaiting
 
Works like a charm... awaiting the results...

//E

lillberg February 17, 2006 08:18

Daniele, The results looks
 
Daniele,

The results looks fine, a very neat case to show the ability of OF to solve coupled problems. Is there any validation case with analytical/experimental values to compare with?

//Eric

hsieh February 17, 2006 08:35

Hi, Eric, I ran the case.
 
Hi, Eric,

I ran the case. Used foamToVTK to export two regions, then, read both regions using paraview. The liquid phase has temperature gradient, however, the temperature of the pipe region looked strange (grey color). Did you get the same results? Or how did you post process your results?

Thanks!

Pei

hsieh February 17, 2006 09:26

Hi, Eric, Never mind! I go
 
Hi, Eric,

Never mind! I got it. I am just not use to multi-regions in paraview yet. The results seem reasonable.

Hi, Daniele,

Great job!

Pei

panara March 16, 2006 14:06

Dear all, I am trying to va
 
Dear all,

I am trying to validate the solver for unsteady conjugate flows but I get strange results.

The test case is and hydrodynamically fully developed pipe flow with a wall suddenly set at a different temperature Tw at time t=0. The flow and The wall are at same temperature Ti at time t<0.

here you can see what I get, in the picture there are two different time steps.

http://www.cfd-online.com/OpenFOAM_D...ges/1/1963.jpg

It seems that at the solid fluid interface something is wrong... I am not sure if I have imposed the right thermal diffusivity for the solid..

The test case is with alpha_fluid = alpha_solid
(alpha = thermal diffusivity)

and k_solid=10 * k_fluid ( k = thermal conductivity)

I imposed the thermal conductivity ratio and I calculated the thermal diffusivity for the solid as:

alpha_solid=alpha_fluid= mu/(Pr * rho )

mu = 1.84e-5
Pr = 0.7
rho = 0.5 (T = 700 K)

I didn't use mu(T) since I am using constant thermal properties.. is it ok?

Anybody has any suggestion?

Daniele

ankgupta8um June 7, 2006 18:33

Hi Mattijs, I was trying to
 
Hi Mattijs,

I was trying to give a parallel run (using LAM-MPI) to the solver "simpleFoam-twoMeshes" posted by you on Friday, July 01, 2005 in this thread. I came across the following error:
----------------------------------------------
n-1<24686> ssi:boot:base:linear: booting n0 (lionxm150)
n-1<24686> ssi:boot:base:linear: booting n1 (lionxm151)
n-1<24686> ssi:boot:base:linear: finished

LAM 7.1.1 - Indiana University

mpirun: cannot start simpleFoam-TwoMeshes on n0: No such file or directory
-------------------------------------------
I would appreciate any comments on the possible reasons behind the above error.

Thanks!
Regards,
Ankur

ankgupta8um June 8, 2006 12:36

Hi, The problem I had as me
 
Hi,

The problem I had as mentioned in the last posting is due to the fact that the executable (simpleFoam-TwoMeshes) was getting placed in $Foam_User_Appbin. Once I changed it to $Foam_Appbin, it was working fine.

-Ankur

panara June 8, 2006 19:02

I forgot to mention just for r
 
I forgot to mention just for records that the code has been validated. There was just a wrong sign of the heat flux at the interface. It is important to pay attention at the wall normals...!! =)

Daniele

dmoroian August 18, 2006 08:08

Hi Daniele, Is the latest cod
 
Hi Daniele,
Is the latest code running with OpenFOAM 1.3?
I have troubles to compile conjugateFoam7 with this version. For instance there is no "findRefCell" defined anywere, or at least I coud not find it in the documentation (only findRefCell.H exists as a source file).
It would be very nice if you could post again the solver and the case files on the forum.

Dragos

panara August 18, 2006 10:41

Sorry Dragos but I am using Op
 
Sorry Dragos but I am using OpenFOAM 1.2 and with it I do not have any troubles...

what kind of error message do you get?

Daniele

helmut August 18, 2006 13:07

Hi, I'm trying to solve flo
 
Hi,

I'm trying to solve flow and temperature on a three region domain consisting of two fluid ducts with square cross section separated by a solid slab of the same size. I'd like to do this by solving fluid flow in the fluid regions, and temperature on the entire domain, but I'm getting some nonphysical values.

I have a mesh of the entire domain and submeshes of the two fluid domains. The latter were generated by the submesh utility using cellSets of the fluid regions. For simplicity, the fluid flow and the material properties are independent of temperature. The velocity fields computed on the fluid region submeshes are transferred to their respective regions of the velocity field U_ALL on the full mesh prior to the temperature calculation, which is coded as

RhoUCp = ( fvc::interpolate(rho_All*U_All*Cp_All) & meshAll.Sf() );
solve ( fvm::div(RhoUCp, T_All) - fvm::laplacian(DT_All, T_All) );

U_All is zero within the slab. The fields rho_ALL, Cp_All, and DT_All are region-wise constant with, respectively, the densities, heat capacities, and thermal conductivities of the three materials/regions. The fluid inlet temperatures are set at 300K, the exterior fluid duct walls are set at 300K, the initial interior fluid duct temperatures are 300K, and the fluid outlet conditions are zero-gradient. The slab exterior boundaries are set at 400K and the slab interior is initialised to 400K. The velocity solutions in the ducts are identical to solutions obtained from simpleFoam, and I've checked the transfer of the velocity fields. Nonphysical temperature values are occurring at the inlets and outlets. Temperatures at the inlets drop below 300K to 291K, while at the outlets there are temperatures in excess of 44500K. (See the attached figures).

http://www.cfd-online.com/OpenFOAM_D...ges/1/2902.jpg http://www.cfd-online.com/OpenFOAM_D...ges/1/2903.jpg

Thanks for any ideas,
Helmut

dmoroian August 21, 2006 14:39

Well that is bad news for me.
 
Well that is bad news for me. I have to check the changes in 1.3 release. Anyway, the error is the following:

dragosm@tirian01:~/OpenFOAM/dragosm-1.3/run/conjugateHeat/conjugateFoam7> wmake
make: Inget behöver göras för "allFiles".
make: "Make/linuxAMD64Gcc4DPOpt/dependencies" är färsk.

SOURCE_DIR=.
SOURCE=conjugateFoam7.C ; g++ -m64 -DlinuxAMD64 -DDP -Wall -W -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-30 -I/fsd/home/dragosm/OpenFOAM/OpenFOAM-1.3/src/cfdTools/compressible -I/fsd/home/dragosm/OpenFOAM/OpenFOAM-1.3/src/cfdTools/lnInclude -I/fsd/home/dragosm/OpenFOAM/OpenFOAM-1.3/src/cfdTools/general/lnInclude -I/fsd/home/dragosm/OpenFOAM/OpenFOAM-1.3/src/thermophysicalModels/specie/lnIncl ude -I/fsd/home/dragosm/OpenFOAM/OpenFOAM-1.3/src/thermophysicalModels/basic/lnInclu de -I/fsd/home/dragosm/OpenFOAM/OpenFOAM-1.3/src/turbulenceModels -I/fsd/home/dragosm/OpenFOAM/OpenFOAM-1.3/src/finiteVolume/lnInclude -I/fsd/home/dragosm/OpenFOAM/OpenFOAM-1.3/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -c $SOURCE -o Make/linuxAMD64Gcc4DPOpt/conjugateFoam7.o
readPISOControls.H:
readPISOControls.H:47: error: findRefCell was not declared in this scope
readPISOControls.H:53: warning: use of old-style cast
readPISOControls.H:54: warning: use of old-style cast
make: *** [Make/linuxAMD64Gcc4DPOpt/conjugateFoam7.o] Fel 1

Thank you for considering my question.
Dragos

panara August 22, 2006 01:22

Something seems to be wrong in
 
Something seems to be wrong in the file readPISOControls.H

Try to start from scratch, you have to copy together rhoTurbFoam and LaplacianFoam the ones that work with OF1.3 (that means also the readPISOControls.H version 1.3).
Then add the additional command like in conjugateFoam7.C and the file createFields.H.
Then you change mesh in mesh1 or mesh2 wherever is needed.
Control also the path in Make/options, they should be more or less a combination of the path in rhoTurbFoam and LaplacianFoam 1.3.
when you compile you can get some error from files that are not in your compiling directory and that use mesh insted of mesh1 or mesh2.
Find them e copy them in your compiling directory
changing mesh in mesh1 or mesh2 and recompile..

Good Luck,

Daniele

lillberg August 22, 2006 05:29

Here's a fixed version of cunj
 
Here's a fixed version of cunjugateFoam7 compiling under OF 1.3.

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

findRefCell is not used anymore, so setRefCell will use the cellnumber given in the PISO dict.

Regards

//Eric


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