CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   Possible bug in nutRoughWall (

jposunz October 1, 2009 18:17

Possible bug in nutRoughWall
1 Attachment(s)
Hi all,

I think there may be a bug in the rough wall function. Its been discussed a little in the thread:

But basically nutw is set to 0 every time step. This means that

scalar limitingNutw = max(nutw[faceI], nuw[faceI]);

always returns limitingNutw = nuw[faceI].

This in turn means that

nutw[faceI] =
*(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1),
), 0.5*limitingNutw

always returns nutw[faceI] = 2*limitingNutw

As a result the simulation is subjected to a Ks much less than specified.

In the test case attached the velocity should end up close to:

u = u_star/kappa*log((z+z0)/z0)

where in this case u_star = 0.625137, kappa = 0.4 and z0 = 0.01.

I've fixed the problem buy adding the following lines which evaluate the limitingNutw using the values nut in the cell next to the wall.

const tmp<volScalarField> toldnut = rasModel.nut();
const volScalarField& oldnut = toldnut();

scalar limitingNutw = max(oldnut[faceCellI], nuw[faceI]);


henry October 2, 2009 02:56

Yes, we fixed this a couple of days ago and are testing the fix at the moment and will push it into 1.6.x shortly.


All times are GMT -4. The time now is 22:41.