CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Boundary condition of the third kind or Danckwertz boundary condition (

plage October 2, 2006 16:56

Hi, It seems that nobody ha

It seems that nobody has read my question. I am posting this to bring it to attention. Can anyone answer it?

Is there any implemented BC in OpenFOAM that can be used to treat implicitly a BC of third kind?

Thanks for any help,


mattijs October 3, 2006 04:34

mixedFvPatchField in the finit
mixedFvPatchField in the finiteVolume library?

eugene October 3, 2006 05:08

I'll give it a shot. k*nf &
I'll give it a shot.

k*nf & grad(T)_b = Cp*U_b*(T_b-To)

k*nf & grad(T)_b = k*snGrad(T)_b

k*snGrad(T)_b = k*(T_b - T_cell)/(nf & d)

where d = X_boundaryFace - X_cellCentre


T_b = (k*T_cell/(nf & d) - Cp*U_b*To)/(k/(nf & d) -Cp*U_b)

Once you have the correct boundary value of T, snGrad(T) can be found without iteration.

Of course you have to stick all this stuff inside the evaluate function of your custom boundary condition so it can be updated properly. See OpenFOAM-1.3/src/finiteVolume/fields/fvPatchFields/basicFvPatchFields/fixedGradi ent/fixedGradientFvPatchField.C
line 137-140 for details.

Is this what you wanted or am I competely missing the point? If so you will have to do a bit more explaining.

(PS. I probably made some mistakes with the gradient signs)

plage October 3, 2006 11:47

Dear Mattijs Janssens, I ha
Dear Mattijs Janssens,

I had already checked the mixedFvPatchField because of its name. Due to your suggestion, I read the code again more carefully. From it, it seems that mixedFvPatchField should do the job for the BC:

nf & grad(T) = A*(Tref - T)

if I specify:

refGrad = 0
refValue = Tref

and calculate f at each boundary face of the patch by

f = A/(A+1/d), where 1/d = patch().deltaCoeffs() and 0<f<1>0,

as soon as the local A value is available. If it is constant (not my case), this has to be done only once at the beginning of computation.

For a third order boundary condition that comes from flux conservation:

-k (nf & grad(T)) = h*(T - Tref) => A = h/k > 0

For a Danckwertz boundary condition:

(nf & grad(T)) = (Cp/k)*(phi/magSf)*(T-Tref) => A = - (Cp/k)*(phi/magSf) > 0 because phi < 0 at an inlet boundary.

I have not tried yet, but I will post if this solution works after trying.

Does this seem correct to you?


plage October 3, 2006 12:21

A small mistake in the line:
A small mistake in the line:

f = A/(A+1/d), where 1/d = patch().deltaCoeffs() and 0<f<1
for A>0,

in the previous post. The system did not produce correctly the text:
for A>0
both in the same line.

All times are GMT -4. The time now is 19:17.