CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   Mixed/Robin boundary condition (

aaev February 10, 2010 16:09

Mixed/Robin boundary condition
1 Attachment(s)
I am quite new to OpenFOAM and therefore am not entirely sure whether this is a bug or a feature, but results one obtains when selecting valueFraction in ]0,1[ when using 'mixed' boundary condition (i.e., a truly mixed/Robin-type boundary condition, not a pure Dirichlet or a Neumann one) depend on the grid size, which seems quite startling to me. For example, I attach a small effectively one-dimensional test-case (tar-ed gzip-ed test_bc.tar.gz) of a steady-state heat conduction problem on a unit square, where at the bottom boundary a mixed BC is prescribed with refValue=-1.0, and refGradient=2.0. The solution to this problem varies linearly from top (where T=0 is prescribed) to bottom, so for a purely Dirichlet problem (valueFraction=1) T_Dir=-1.0 at the "mixed" boundary, and for purely Neumann case (valueFraction=0) T_Neum=n*grad(T)=2.0 there. Therefore, say for valueFraction = 0.5 I would expect T=0.5*(T_Dir + T_Neum) = 0.5; however, one may easily check that this value depends on the number of elements in the mesh and in fact converges to T_Dir as the mesh is refined.

Such behaviour can be fixed if one uses

newValueFraction_=valueFraction_/(valueFraction_ + (1.0-valueFraction_)*this->patch().deltaCoeffs());

in place of valueFraction_ in the implementation of the mixed boundary condition (I can sketch a small note why, and I tried to write a comment about this in my amateurish C++ implementation of mixed1 boundary condition-also in the attached archive), which now produces expected mesh-independent results. You can try it out by building the corrected mixed1 boundary condition (wmake libso in mixed1BC.d); and then changing mixed->mixed1 in test_bc/0/T file and uncommenting the 'libs' line in test_bc/system/controlDict to load the mixed1 BC.

Please let me know if I mis-understand the purpose or the expected behaviour of the original mixed boundary condition in OpenFOAM.

--Anton Evgrafov

skeptik December 15, 2011 14:18

Today I found that Robin BC give incorrect temperatures on the wall Twall>Tref.

Your post could be useful. Tomorrow I'll try It.

А ещё, Вы говорите по-русски?)

aaev December 15, 2011 15:03


Originally Posted by skeptik (Post 335982)
А ещё, Вы говорите по-русски?)

da, govoru

All times are GMT -4. The time now is 03:15.