CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Post-Processing (
-   -   wallShearStress, wallGradU are inconsistent (

dancfd June 18, 2013 23:57

wallShearStress, wallGradU are inconsistent
Hello all,

I just tried to calculate the wallShearStress entries of my case from wallGradU (dU/dy), rho (all found using OF postprocessors and sample utility), and nu (from transportProperties). Since tau = mu * (dU/dy) = rho * nu * (dU/dy), I figure that tau / (rho * dU/dy) should be constant, however this is not the case.

Can anyone explain why there is a discrepancy? I feel like I should be able to calculate wallShearStress somehow using its constituent parameters. This is important to me since the wallShearStress utility does not work for laminar flow and I want to compare the forces on an airfoil in laminar and turbulent flow for the same case.

Thanks in advance,

dancfd July 14, 2013 15:07

Issue resolved - rather, issues:

1) for compressible cases, you must run "wallShearSress -compressible" with that flag in place. The only way to know to do this is to read the code for the wallShearStress utility. Suggestion: the utility should be able to distinguish between compressible and incompressible cases by itself, or force the user to use a flag for compressible and incompressible, to make this utility more user friendly.

2) by looking at the turbulence model (kwSST) code and the wallShearStress code, I found that OF calculates wallShearStress as follows:
tau_w = -(mu + mut) * (wallGradU)

When I made that change, the data matched.

Therefore, to calculate laminar, tau_w = -mu * (wallGradU) since mut = 0.

May others learn from my mistakes!

dancfd May 25, 2014 10:13

To continue this monologue, I noticed that when running wallShearStress with and without the compressible flag on the same case, the results differed by a factor of rho yet the dimensions in both wallShearStress files were the same. This suggests that the equation for tau_w (wallShearStress) changes as follows for compressible/incompressible cases:

\tau_w = \nu_{eff} \frac{\partial U}{\partial y}

wallShearStress -compressible:
\tau_w = \mu_{eff} \frac{\partial U}{\partial y}= \rho \nu_{eff} \frac{\partial U}{\partial y}

Therefore, if I understand correctly:
\tau_{wCompressible} = \rho\tau_{wIncompressible}

Which would not be a problem if the dimensions in both cases did not read the same (m2/s2):

dimensions      [0 2 -2 0 0 0 0];
This looks to me like a bug. Thoughts?


wyldckat December 6, 2014 06:30

Greetings Daniel,

Sorry for the (very) late reply, but only now did I trip over your thread, while looking for the exact answer you've given in post #2 ;)

The explanation to your latest question is simple: OpenFOAM uses a simplification of omitting rho to save up some CPU cycles in pointless multiplications by rho, when handling incompressible simulations... at least in most cases. This should also increase accuracy, since with each multiplication, there is always an error involved, no matter how small.

This to say that wallShearStress in incompressible mode does what it can with the data we provide it, namely since rho was not provided, it cannot multiply by an unknown rho ;)
I also explained this with other details a few months ago (which was a few months after your last post), on this post: post #6

Best regards,

All times are GMT -4. The time now is 08:43.