CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Why wallGradU result is different from dudy in the smooth channel bed (

xiuying December 15, 2008 20:20

Hi, The case is the simple

The case is the simple smooth channel. Now I want to calculate the bottom wall shear stress. I use the function wallGradU as following
forAll(wallGradU.boundaryField(), patchi)
wallGradU.boundaryField()[patchi] =
But I found the result was much different from the value of du/dy, where y was the normal direction of the bottom, and u was the velocity along the flow. Could you inform me the reason for the difference? Thank you so much.


santos December 16, 2008 05:16

Hello, wallGradU returns a

wallGradU returns a vector, with normal and tangential components in relation to the wall.

If you are interested in wall shear stress, you should extract the tangential components of wallGradU, and use them for your calculations.

Your results are different from du/dy probably because your du/dy data concerns only tangential components of velocity gradient.

Jose Santos

xiuying December 16, 2008 14:33

Thank Jose for your answer.
Thank Jose for your answer.

I compared the wallGradU tangential component with my du/dy, and they are much more different.


santos December 17, 2008 07:48

Hello, Maybe you could elab

Maybe you could elaborate a little more on your problem (mesh, Re, discretisation schemes, experimental data, etc).

From my experience, wall gradients are quite sensitive to the quality of your mesh as well as the discretisation schemes you are using.

I have recently validated simulations obtained with OpenFOAM for smooth tube laminar and turbulent flows against Moody friction factor and mass transfer correlations. The results are very good. Let me know if you need some details on this.

Jose Santos

paulo December 17, 2008 15:55

Hello Jose Santos and All,
Hello Jose Santos and All,

I'm also trying to validate simulations on High Reynolds number flows (wind turbines).

I'm interested about the information regarding the turbulence models and numerical schemes you've used.

Thank you very much in advance.


Paulo Rocha

xiuying December 17, 2008 16:03

Hi, I want to calculate the

I want to calculate the wave friction factor on the channel bed with turbulent k-epsilon model using the relation of the friction factor f=2*tau(max)/(pou*U(max)^2),where tau(max) is the maximum of the wall shear stress in a wave period, pou is the density, and U(max) is the sinusoidally oscillatory wave amplitude. So I need calculate the wall shear stress. Now I refined my mesh to get yplus~~0.01 on the wall, and wallGradU was almost equal du/dy. But the calculating friction fractor is much different from the Jensen's experimental data and the error is about 60%.

ngj December 17, 2008 17:04

Hi Xiuying I have been doin
Hi Xiuying

I have been doing the same experiment in an internal code, and I did get good results for the rough boundary (test 13).
Mayby you should consider using another turbulence closure model than k-epsilon, which is known to perform rather poorly subject to adverse pressure gradients, which you will have twice during a wave period.
How does your phase-lag compare with experimental data in the turbulent regime? Is it the experimental verified value of an order of magnitude 10 degrees?
I used k-omega and as I recall yplus=O(0.1).
If you are driving your flow by applying a body force then verify that you do not have a net flux averaged over a wave period as beginning from a zero velocity field will result in a non-zero flux if left untreated.
Further, verify that your computational domain is sufficiently large to contain your wave boundary layer.

Good luck,


xiuying December 17, 2008 18:19

Hi, Niels, Thanks so much. I
Hi, Niels,
Thanks so much.
I used Jensen's test 10 to compare my computing result. In my model the wave flow was drived by an oscillatary body force, and the inlet and outlet used cycle boundary condition. I checked the phase-lag beween the wave and its wall shear stress. I also will check the netflux.


xiuying December 17, 2008 19:43

sorry, I forgot writing the ph
sorry, I forgot writing the phase-lag. It is 13 degree between the wave velocity and its wall shear stress.

ngj December 18, 2008 02:04

Well, if you look at Fig. 11 i
Well, if you look at Fig. 11 in Jensen et al (1989) then you will find that the phase-lag is order of magnitude 6 degrees for their measurements for test 10, thus your flow reversal occur too early in the process.
This might suggest problems in the handling of the adverse pressure gradient, as your mesh should be fine.
Maybe you should take a look on how the wall is treated in the k-epsilon model. There might be some conflicts in resolving the boundary layer.

Have a nice day


santos December 18, 2008 06:38

Hi, Xiuying: I think that w

Xiuying: I think that when using kEpsilon you should keep your y+ above 30. Anyway, check your pressure drop (patchAverage p inlet && patchAverage p outlet) and compare it with your experimental data.

Paulo: I usually start with kEpsilon to obtain initial k and epsilon fields, using upwind on all div schemes, and Gauss linear limited 1 on all laplacians. My relaxation factors are 0.2 for pressure and 0.5 for the other variables. With this setup, the residuals converge quite fast. I am interested on determining mass transfer coefficients at the walls, so I need to resolve adequately the near wall profiles. For that, I switch to a low-Re turbulence model (eg LaunderSharmaKE), increase my mesh resolution (y+<1) and get converged results for first order schemes. Finally, I switch to 2nd order schemes (limitedLinear 1 for divs, linear corrected for laplacians).

paulo December 18, 2008 17:11

Thanks a lot Jose Santos. I'll
Thanks a lot Jose Santos. I'll try your procedure ASAP.


Paulo Rocha

andrea March 2, 2009 08:58

Hi, I'm trying to make my sol
I'm trying to make my solver compute at each time step the gradient of U at wall, but copying from the wallGradU utility I've managed to get it except for the 0 time, in which volVectorField wallGradU is given as "type computed" and it's not calculated.
The difference w.r.o. the results of the utility are in this 0 step and small numeric discrepancies.

There's anyone that can explain these? There a way to make wallGradU calculated at 0 time?


All times are GMT -4. The time now is 23:26.