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/)
-   -   Pure conduction problem with different diffusivities (https://www.cfd-online.com/Forums/openfoam-solving/58494-pure-conduction-problem-different-diffusivities.html)

diego_angeli October 3, 2008 05:09

Hi all, I'm trying to solve
 
Hi all,

I'm trying to solve a conduction problem in materials with different diffusivities. Think about a wall made of some layers of different materials.

I started from the laplacianFoam solver, and modified it as follows:

in the createFields.H file, I changed the diffusivity DT from a constant to a field. Here's the code

volScalarField DT
(
IOobject
(
"DT",
runTime.timename(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);

the solver re-compiled fine, so I suppose to have performed things in the right way

then I followed the instructions I found here:
http://www.cfd-online.com/OpenFOAM_D...tml?1214910015

I tried to use setFields to give to DT the values I wanted in the different regions of my mesh (a simple blockMesh: I have to simulate a flat wall with thermal leaks), but as I create the file "DT" in the "0" folder and I run setFields, the resulting "DT" file returns me just a uniform field with DT equal to the default value I set for it in the setFieldsDict.

Have you got any clue about that? I'm rather new to OpenFOAM, so I could be stuck on a trivial thing...

And, do you think that my way of changing the solver is the right one?

Thank you very much in advance!

Diego Angeli
Modena, Italy

olwi October 4, 2008 18:44

Hi Diego, Sounds like the r
 
Hi Diego,

Sounds like the right approach.

I think you should focus on the possibility that you're doing something wrong with setFields. Try to play around with the dambreak tutorial, for example.

Another thing you need to get good results: use harmonic interpolation of DT in the laplacian. Otherwise you get some smearing on the interface between media. It can be shown formally that harmonic rather than arithmetic (=linear) interpolation is what you need for a correct discretization.

Good luck!

/Ola

diego_angeli October 8, 2008 06:53

Hi Ola Thank you for the ti
 
Hi Ola

Thank you for the tip on the interpolation scheme, and for the "thumbs up".

The approach was indeed right, and I just systematically mistook the order of the two vertices defining boxes in setFields. The results I got are satisfactory!

Now I'm trying to impose a mixed condition at the boundaries and I saw that it is not so immediate... let's see

by now, many thanks!!

Diego


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