CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   nutRoughWallFunction v1.6 (

Schag August 21, 2009 04:30

nutRoughWallFunction v1.6
Hi all,

testing some "new" features given by v1.6, I found this one quite different from previous version, and want to use it.

My issue is the understanding of some pieces of code.
First, these two lines in function calcNut():

tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0));
scalarField& nutw = tnutw();

I understand it initialise a scalarField nutw, uniform 0 value, with the size of the patch I'm dealing with. But the two things I do not get are:
- dummy question: what does tmp stand for? temporary?
- does it initialise this scalarField at each time step? in this case, this boundary type would seem quite useless regarding the calculation of nutw that follows.

It might seem dummy questions, but I have to begin to understand one day or another. Thanks for answers!



jposunz October 1, 2009 05:44

Hi Julien,

I'm looking at the same thing and have come to the same conclusion. I had written my own rough wall function in version 1.5 and was surprised when version 1.6 gave me different results today when I started testing it.

I have 1-D simulations I use to generate profiles and they have a single cell at the ground which makes them pretty easy to debug.

I've found the same thing as you, namely that 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

To test the rest of the code I hard coded a known value for limitingNutw and everything works fine.

I admit my OpenFOAM C++ is not fantastic so I'm not really sure what nutw should be initialised to? Probably the value from the previous time step? I think it probably shouldn't be initialised to 0 initially either but should be read from the nut file?

This is the first potential bug I've stumbled across and I'm not sure what the procedure is for submitting it for someone to have a look at. Advice anyone?


mattijs October 1, 2009 16:28

To report bugs:

If applicable also provide a testcase.

All times are GMT -4. The time now is 10:30.