CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Wall with fixed heatFlux boundary condition (

Martin Lorenz (Lorenz) February 16, 2005 08:55

Hello, for a heat transpor

for a heat transport problem I would like to use a fixed heatFlux boundary condition, where 120 W/m^2 flux of heat are imposed on a patch named "inner".

Therefore I created the following T file in the 0 directory using FoamX:

type heatFlux;
// Field value
value uniform 400;
// Heat flux
flux uniform 120;

type fixedValue;
// Field Value
value uniform 300;


UNfortunately, this doesn't work: this simply sets the temperature on the boudary to 400K. Removing the Field Value results in an error message.

I don't know why one has to specify both temperature and flux since this would result into an over-determination! Any hints?

Another question concerns external boundaries with a heat transfer constant k, i.e. the heat flux is given by k*(T-Tenv), where T is the surface temperature and Tenv is the temperature of the environment. I suppose that one has to use the "mixed" or even the "computed" boundary type, but I could not find any examples in the tutorials. Any help is appreciated.

Thanks, Martin

Hrvoje Jasak (Hjasak) February 16, 2005 09:28

That's because there's no suc
That's because there's no such thing as a heatFlux boundary condition - only a fixedGradient b.c. Somewhere in the documentation there should be a section on this.

Currently, you are falling into a new-ish gap in the design: if a b.c. is not recognised, it will look for a value and use that; this will NOT allow you to do what you wish.


Martin Lorenz (Lorenz) February 16, 2005 10:11

Hi Hrv, I know that the he
Hi Hrv,

I know that the heat flux is connected with the gradient by J_th = lambda * grad T.
But the strange thing is that FoamX allows one to choose "wallFixedHeatFlux" as boundary type for a patch of the mesh! This sets the patch field type to "heatFlux" for the field T!

What about the boundaries with a heat transfer constant to the environment?


Hrvoje Jasak (Hjasak) February 16, 2005 12:59

Well, grep heatFlux lnInclude
Well, grep heatFlux lnInclude/* in the main library says nothing, which means the bug is in FoamX. use fixedGradient on the T field with the gradient of J_th/lambda and all will be well.

Don't understand the second question... If you mean that lambda is a function of something else, that's no problem either, but you'll need a new top-level code.



newbee March 3, 2006 07:13

Hi, could anybode explein to m
Hi, could anybode explein to me how the fixedGradient works.

I'm running buoyantSimpleFoam on a case with a channel with airflow thru it. The airflow is supposed to be heated by one of the walls which is increasing in temperature thru the channel.

I have tried running the case with different gradients of fixedGradient on the specified wall patch. But unfortunetly all I get is air flow with the same temperature as the intital setting of the internal field.

ccless June 7, 2006 21:01

I am getting the same effect,
I am getting the same effect, any luck on this. It seems to only heat up the cells in the proximity to the walls. Basically, not providing any advection of thermal energy into cells next to the ones on the wall. Any ideas on this one?

christian_hausmann October 10, 2006 06:32

Hi, how can I set a boundar

how can I set a boundary condition to fixedGradient?

I want to set heat flux as boundary condition at a wall, but FoamX sets the patch field type to zeroGradient, if I set the boundary type to wall. Any suggestions?

gschaider October 10, 2006 06:53

Hi Christian! This is the p
Hi Christian!

This is the point where one abandons FoamX and uses a text-editor for editing the boundar conditions. Or rewrites the config-files for FoamX (with a text-editor). First route is easier.

Not the answer you wanted, I know, maybe someone else knows something that doesn't involve a text-editor.

christian_hausmann October 10, 2006 07:20

Hi Bernhard, it doesn't bot
Hi Bernhard,

it doesn't bother me to use a text-editor. I simply use FoamX, because the tutorials of the documentation are made with FoamX.

Do I only have to edit the boundary-file and the T-file of my case? Replace fixedValue by fixedGradient? Can/must I edit a estimated Start-temperature?

gschaider October 10, 2006 09:49

Hi Christian! I didn't want
Hi Christian!

I didn't want to imply you were afraid of text-editors. There is just a point in a man's life where he wants more than FoamX can offer him and you seem to have reached that point quite early (right after the tutorials).

Your questions: Yes. Yes. No

I think the neccesary field that replaces "value" is called "gradientValue"

christian_hausmann October 12, 2006 04:46

Hi, thanks Bernhard for you

thanks Bernhard for you help.

I am now able to set boundary condition to fixed Gradient. But how do I treat the dimensions? I have heatflux over walls and airflow through an inlet. The dimension of the heatflux boundary condition is [K/m] and for the Temperature of the Inlet is [K].

eugene October 12, 2006 05:08

q = alphaEff * snGrad(T) Th
q = alphaEff * snGrad(T)


snGrad(T) = q/alphaEff

Your BC needs to look up the turbulence model in the database and then it needs to ask the turbulence model for the near-weall heat transfer coefficient. I might still have some code that does this for another purpose, so let me know if you would like a snippet.

christian_hausmann October 12, 2006 10:00

Hi Eugene, For some boundar
Hi Eugene,

For some boundaries I have an airflow with a fix temperature and for others I have a fix heat flux density. Since I know the heat conductivity of the wall my intention was to specify snGrad(T) directly in the T-file. The problem is I don't know how to specify different dimensions in the T file. One dimension for gradient and one for value.

If I am totally wrong, I will appreciate it to get a snippet of your code, to solve this problem.

gschaider October 12, 2006 10:29

You don't have to. Gradient is
You don't have to. Gradient is implicitly "original dimension per meter". Or the more practical view: the dimension of the gradientValue isn't checked anyway.

eugene October 12, 2006 10:45

? Specifying the gradient of T
? Specifying the gradient of T at the boundary will not fix the heat flux.

Anyway, you do not need to specify the dimensions for the gradient, in the boundary section of the field file:

type fixedGradient;
gradient 2000;

To really have a fixed heat flux, you need to know the heat transfer coefficient between the wall and the fluid:

In the evaluate function of your new boundary (drived from the fixedGradient type) put:

const compressible::turbulenceModel& rasModel = db().lookupObject<compressible::turbulencemodel>(" turbulenceProperties");

scalarField alphaEffWall = rasModel.alphaEff()().boundaryField()[patch().patch().index()];

gradient() == q/alphaEffWall;

There are some details that have to be sorted regarding dictionary inputs, the face size and direction of the flux, but I'll leave this to you.

oscar_j July 10, 2007 02:58

Hello to all, I'd want to
Hello to all,

I'd want to realize my own heat transfer application but I haven't found specific information about it.


emilianyassenov November 10, 2008 05:29

hi to all.. I want to simulat
hi to all..
I want to simulate Heat flux increasing till in the middle of the pipe than decrease it..which solver I should use?and how to include heat flux in the boundary conditions.

best regards,


emilianyassenov November 14, 2008 12:09

Hello Hrvoje, Could you exp
Hello Hrvoje,

Could you explain in details how to include heat flux? what is J_th there?

thanks in advance


emilianyassenov November 17, 2008 09:26

hello I want to have fixed

I want to have fixed heat flux in boundary I am using icoFoam and turbFoam I have included energy equation in them I am using Water in a pipe...
how to get that fixed flux on the boundary..

thanks in advance


emilianyassenov November 17, 2008 11:11

can anyone help me? thanks
can anyone help me?



All times are GMT -4. The time now is 16:42.