CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Possible bug in nutRoughWall (https://www.cfd-online.com/Forums/openfoam-bugs/68794-possible-bug-nutroughwall.html)

 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:

http://www.cfd-online.com/Forums/ope...on-v1-6-a.html

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] =
max
(
min
(
nuw[faceI]
*(yPlus*kappa_/log(max(Edash*yPlus, 1+1e-4)) - 1),
2*limitingNutw
), 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]);
...

Thanks!
John

 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.

H

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