CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Wall function usage (https://www.cfd-online.com/Forums/openfoam-solving/170101-wall-function-usage.html)

G_German April 24, 2016 08:46

Wall function usage
 
3 Attachment(s)
Since the documentation on the use of wall functions (or BCs for turbulence models in general) in OpenFOAM is rather small I tried to write up a little summary of what is posted in the internet (for kEpsilon, kOmegaSST & SA).
As this may also be interesting to other people and I would be interested in feedback, please find the summary below:

Basics:
If the grid near the wall is fine enough (~y+<1 everywhere and at least 4-5 nodes below y+=5) wall functions are not needed.
For kEpsilon a lowRe version is required, SA and kOmegaSST should be applicable also for low Re numbers (though this is under discussion for the OpenFOAM implementation: http://www.cfd-online.com/Forums/ope...penfoam-2.html).
For coarser grids (30<y+<100) wall functions exploit the universal logarithmic wall law to model the transition from the laminar near-wall flow to the fully developed turbulent flow.


Basically the type of wall function is chosen in the nut file by the nutxxx wall functions:
- nutWallFunction (seems to be the most basic wall function without further requirements): high-Re wall-function based on k.
- nutkWallFunction (standard for kEpsilon/kOmega, probably requires an equation for k...): nutkWallFunction sets the turbulent viscosity in the first node point based on the logarithmic law ( based on the turbulent kinetic energy close to the wall)
- nutUWallFunction: in comparison to nutkWallFunction this wall function calculates yPlus based on the velocity close to the wall (not k)
- nutUSpaldingWallFunction (standard for SA turbulence model, called nutSpalartAllmarasWallFunction in earlier version, original reference is doi:10.1115/1.3641728):
continuous wall-function which should cover the complete y+ range from O(1) to somewhere of O(10). Might be the best choice (together with low Re kEpsilon, kOmegaSST or SA, when y+ varies for different parts of the wall.
- nutLowReWallFunction (code comment: "Sets nut to zero, and provides an access function to calculate y+." ):
Dummy wall function required for the calculation of yPlusRAS in simulations which resolve the near wall flow (however, there are varying opinions about this in the internet).

For epsilon, omega, k, ... one uses the corresponding wall functions exist:
- epsilonWallFuncion for epsilon ( (fixed value e=0 or better e=1e-8(?) for lowRe calculations):
calculate (for each timestep) the first grid point value by using an algebraic expression derived from the classical logarithmic law-of the wall approach
- kqRWallFunction for k, q, R
in code: Boundary condition for turbulence k, Q, and R when using wall functions. Simply acts as a zero gradient condition.
(appears to be applicable down to yPlus~1, but one should use a fixed value with k=0 or a very small value for y+<1)
- omegaWallFunction for omega; Not really a wall function but the b.c. defined by Menter for Omega, i.e. should be used always for kOmega model, independent of y+)
omegawall=60*nu/(beta*y^2), with nu=kinematic viscosity at the wall, beta=0.075 and y=normal distance between the first fluid node and the nearest wall-> very large value for omega)
The "value" which is specified for the wall functions is only an initial conditions

To check my understanding I did some comparisons of simulations with OF 2.4/3.0 to Wieghardt's flat plate Cf measurements:

KateEisenhower August 19, 2016 08:27

Hello Gerd,

thank you for this summary. However, I do not understand the legends of your plots. Could you explain or correct them respectively?

Best regards,

Kate

bennn August 19, 2016 08:50

1 Attachment(s)
Hi all,

Very interesting topic. Here are my findings for steady NACA 0012 with various turbumence models and simpleFoam 2.4:

- The usual y+=1 value is actually around 10 for me with 1/7th power law.
- I could not obtain acceptable results with y+ above 10 with wall functions.

The attached graph illustrates these results.

KateEisenhower August 19, 2016 09:02

Hello Benoit,

this is interesting stuff. You wrote you used various turbulence models. Which ones did you use actually?
The 1/7 power law is for determining the turbulent boundary layer thickness as far as I know. I think I am not getting it in this context. How do you obtain your y+ values?

Best regards,

Kate

Quote:

Originally Posted by bennn (Post 614683)
Hi all,

Very interesting topic. Here are my findings for steady NACA 0012 with various turbumence models and simpleFoam 2.4:

- The usual y+=1 value is actually around 10 for me with 1/7th power law.
- I could not obtain acceptable results with y+ above 10 with wall functions.

The attached graph illustrates these results.


bennn August 22, 2016 06:44

Hi Kate,

The model used were k-epsilon, komega SST and SA in their default OF 2.4 implementations. k-epsilon was a bit off and the other were ok.

Regarding the 1/7th law, you're right, sorry for the wrong wording. The x axis in the graph shown are the target y+ from which I compute my first cell height. The actual value after simulation is somewhat lower but similar, for instance 8 instead of 10. I'm more interested in this approach since I need to know robustly how accurate I am in automatic optimization for instance, without the need to manually check each run.

I am quite interested to know if someone has had better results with wall functions and large y+. It is quite possible that my poor results comes from a mistake from my side.

G_German August 22, 2016 16:01

Hi Kate!

In my simulation I tried different values for the inlet boundary condition of k/epsilon/omega/nut. In the plots I give the curves for the simulations with different turbulent influx to show that this causes a certain variation but I did not add the actual numbers I used. That means the three curves for k-epsilon only differ in the turbulence influx but have the same y+ of around 70, the same is true for the first three curves in the k-omega results (black, light blue and green) and the black and blue curve in the SA plot. In the SA plot I also compare simulations where the "Ashford correction" (a parameter for this model) is switched on and off. Does this help you? If you are interested I can also look up the actual numbers I used for the turbulence influx.

Best regards
Quote:

Originally Posted by KateEisenhower (Post 614678)
Hello Gerd,

thank you for this summary. However, I do not understand the legends of your plots. Could you explain or correct them respectively?

Best regards,

Kate


G_German August 22, 2016 16:05

Hi Benn,

if you are interested we can exchange our input files, to check whether something looks faulty.

Best regards

Gerd

Quote:

Originally Posted by bennn (Post 614960)
Hi Kate,

The model used were k-epsilon, komega SST and SA in their default OF 2.4 implementations. k-epsilon was a bit off and the other were ok.

Regarding the 1/7th law, you're right, sorry for the wrong wording. The x axis in the graph shown are the target y+ from which I compute my first cell height. The actual value after simulation is somewhat lower but similar, for instance 8 instead of 10. I'm more interested in this approach since I need to know robustly how accurate I am in automatic optimization for instance, without the need to manually check each run.

I am quite interested to know if someone has had better results with wall functions and large y+. It is quite possible that my poor results comes from a mistake from my side.


KateEisenhower September 5, 2016 05:25

Quote:

Originally Posted by G_German (Post 615037)
Hi Kate!

In my simulation I tried different values for the inlet boundary condition of k/epsilon/omega/nut. In the plots I give the curves for the simulations with different turbulent influx to show that this causes a certain variation but I did not add the actual numbers I used. That means the three curves for k-epsilon only differ in the turbulence influx but have the same y+ of around 70, the same is true for the first three curves in the k-omega results (black, light blue and green) and the black and blue curve in the SA plot. In the SA plot I also compare simulations where the "Ashford correction" (a parameter for this model) is switched on and off. Does this help you? If you are interested I can also look up the actual numbers I used for the turbulence influx.

Best regards


Hello Gerd,

thanks for the explanation. So the main result from you study is that one should vary the turbulent inflow parameters to see what influence they have on the simulation. I agree.
The actual numbers alone are not so important for me, but the method of how you chose these numbers would be interesting.
Personally, most of the time, I make a first estimation using the CFD-Online Wiki articles.

Best regards,

Kate

KateEisenhower September 5, 2016 05:32

Quote:

Originally Posted by bennn (Post 614960)
Hi Kate,

The model used were k-epsilon, komega SST and SA in their default OF 2.4 implementations. k-epsilon was a bit off and the other were ok.

Regarding the 1/7th law, you're right, sorry for the wrong wording. The x axis in the graph shown are the target y+ from which I compute my first cell height. The actual value after simulation is somewhat lower but similar, for instance 8 instead of 10. I'm more interested in this approach since I need to know robustly how accurate I am in automatic optimization for instance, without the need to manually check each run.

I am quite interested to know if someone has had better results with wall functions and large y+. It is quite possible that my poor results comes from a mistake from my side.


Hello Benoit and thanks for your answer!

Which method do you use to get the actual y+ values after the simulation?
Moreover, it is my understanding that wall functions should only be used for y+ > 30. Do you agree on that? Also it would be interesting at which AoA you are simulating?

Best regards,

Kate

bennn September 6, 2016 04:46

yPlusRAS or simpleFoam -postProcess on latest versions is what I use to get the actual y+ value.

The results shown are for AoA = 10°. My understanding was the same as your, until I tried it, and got the very unexpected graphs shown before.

KateEisenhower September 8, 2016 08:21

Quote:

Originally Posted by bennn (Post 616732)
yPlusRAS or simpleFoam -postProcess on latest versions is what I use to get the actual y+ value.

The results shown are for AoA = 10°. My understanding was the same as your, until I tried it, and got the very unexpected graphs shown before.

Benoit, I am currently working on a similar case. Like you, I get reasonable results when using wall functions on a resolved boundary layer mesh (Spalart Allmaras turbulence modeling). As I said, my results look reasonable, I cannot say if they are yet.

What Reynolds number do you have in your case? Maybe you have a pure laminar bl along until the trailing edge?

Best regards,

Kate

bennn September 8, 2016 08:37

Hi Kate,

Detailed results on this topic can be found here :
http://ntrs.nasa.gov/archive/nasa/ca...9880002254.pdf

The curves I sent are for Re=1e6, so I doubt laminar BL has anything to do with it.

VIJAYA KUMAR February 10, 2017 19:09

Hi
I am trying to do the same case of Flow past a flat plate with U =33 m/s (Weighardt data).

Mesh:
-y+ < 1
-Refinement at Inlet for development of boundary layer
-Using 'simpleFoam' steady state solver

My conditions are as follows

1) k
- fixedValue ~ 0 at Walls
- TKE with Intensity of 5% at Inlet

2) omega
- omegaWallFunction with high initial value (as you have mentioned) at wall
- Calculated based on nut/nu ratio at 'Inlet'

3) nut
- fixedValue ~ 0 at walls
- 'calculated' condition at other patches.

Correct me where I am going wrong, and also is it possible to share your kOmegaSST files.

Regards
Vijay

VIJAYA KUMAR February 10, 2017 19:12

Flow Past a Plate with kOmegaSST and y+1
 
1 Attachment(s)
Quote:

Originally Posted by G_German (Post 596441)
Since the documentation on the use of wall functions (or BCs for turbulence models in general) in OpenFOAM is rather small I tried to write up a little summary of what is posted in the internet (for kEpsilon, kOmegaSST & SA).
As this may also be interesting to other people and I would be interested in feedback, please find the summary below:

Basics:
If the grid near the wall is fine enough (~y+<1 everywhere and at least 4-5 nodes below y+=5) wall functions are not needed.
For kEpsilon a lowRe version is required, SA and kOmegaSST should be applicable also for low Re numbers (though this is under discussion for the OpenFOAM implementation: http://www.cfd-online.com/Forums/ope...penfoam-2.html).
For coarser grids (30<y+<100) wall functions exploit the universal logarithmic wall law to model the transition from the laminar near-wall flow to the fully developed turbulent flow.


Basically the type of wall function is chosen in the nut file by the nutxxx wall functions:
- nutWallFunction (seems to be the most basic wall function without further requirements): high-Re wall-function based on k.
- nutkWallFunction (standard for kEpsilon/kOmega, probably requires an equation for k...): nutkWallFunction sets the turbulent viscosity in the first node point based on the logarithmic law ( based on the turbulent kinetic energy close to the wall)
- nutUWallFunction: in comparison to nutkWallFunction this wall function calculates yPlus based on the velocity close to the wall (not k)
- nutUSpaldingWallFunction (standard for SA turbulence model, called nutSpalartAllmarasWallFunction in earlier version, original reference is doi:10.1115/1.3641728):
continuous wall-function which should cover the complete y+ range from O(1) to somewhere of O(10). Might be the best choice (together with low Re kEpsilon, kOmegaSST or SA, when y+ varies for different parts of the wall.
- nutLowReWallFunction (code comment: "Sets nut to zero, and provides an access function to calculate y+." ):
Dummy wall function required for the calculation of yPlusRAS in simulations which resolve the near wall flow (however, there are varying opinions about this in the internet).

For epsilon, omega, k, ... one uses the corresponding wall functions exist:
- epsilonWallFuncion for epsilon ( (fixed value e=0 or better e=1e-8(?) for lowRe calculations):
calculate (for each timestep) the first grid point value by using an algebraic expression derived from the classical logarithmic law-of the wall approach
- kqRWallFunction for k, q, R
in code: Boundary condition for turbulence k, Q, and R when using wall functions. Simply acts as a zero gradient condition.
(appears to be applicable down to yPlus~1, but one should use a fixed value with k=0 or a very small value for y+<1)
- omegaWallFunction for omega; Not really a wall function but the b.c. defined by Menter for Omega, i.e. should be used always for kOmega model, independent of y+)
omegawall=60*nu/(beta*y^2), with nu=kinematic viscosity at the wall, beta=0.075 and y=normal distance between the first fluid node and the nearest wall-> very large value for omega)
The "value" which is specified for the wall functions is only an initial conditions

To check my understanding I did some comparisons of simulations with OF 2.4/3.0 to Wieghardt's flat plate Cf measurements:


Hi
Can you share your files or can you specify the boundary conditions used for k-Omega-SST with y+ ~ 1

I am trying the same 'Flow Past Flat Plate; but predictions are bad. (Attached the Cf plot)

Regards
Vijaya Kumar G

G_German February 14, 2017 15:03

1 Attachment(s)
Hi Vijay,

I attached my boundary conditions, but yours seem ok.

Cheers

Gerd

VIJAYA KUMAR February 15, 2017 03:19

Inlet Conditions of k,Omega and nut
 
Quote:

Originally Posted by G_German (Post 637116)
Hi Vijay,

I attached my boundary conditions, but yours seem ok.

Cheers

Gerd

Thanks for the reply.

Can you specify how you calculated (relations used) the inlet conditions of k, omega and nut for the resolved boundary layer condition (y+ ~ 1) ?

That would be helpful. I think I'm missing some beat over there.

Regards
Vijaya Kumar G

G_German February 18, 2017 03:14

Quote:

Originally Posted by VIJAYA KUMAR (Post 637176)
Thanks for the reply.

Can you specify how you calculated (relations used) the inlet conditions of k, omega and nut for the resolved boundary layer condition (y+ ~ 1) ?

That would be helpful. I think I'm missing some beat over there.

Regards
Vijaya Kumar G

Hi Vijaya,

I took inlet conditions I found in the literature and used the relation w=e/k to convert the conditions between k-e and k-w simulations.

Regards

Gerd

VIJAYA KUMAR February 18, 2017 16:48

Quote:

Originally Posted by G_German (Post 637590)
Hi Vijaya,

I took inlet conditions I found in the literature and used the relation w=e/k to convert the conditions between k-e and k-w simulations.

Regards

Gerd

Hi

Sorry for bugging you.
Can you give me the exact relations you used, I think I'm missing something there.

Vijay

piu58 February 19, 2017 01:18

Dear Vijay,

this pages
https://www.cfd-online.com/Wiki/Turb...ary_conditions
explains how to calculate initial values for k and eps. Youn need to click a few links to get fomulae for dependend variables. Procedure is
- calculate the hdydraulic diameter
- calculate Re from it
- calculate the turbulent length scale (=the size of the large eddies). For freestream velocity it is better guessing it than using the formula for pipe flow. The larges value you should take into account is the size of the problem.
- calculate the turbulence intensity

Now you have everything for the calculation of k and eps (and omega too).

For calculation of the y value of the finest mesh near the surface I recommend the calculator
http://www.pointwise.com/yplus/

If you have further questions please do not hesitate to ask.

kishpishar May 19, 2019 08:58

Dear Uwe,

I have a question about the usage of continuous wall functions (e.g. nutUSpaldingWallFunction). The documentation says that this wall function is based on velocity, uses Spalding's law to give a continuous profile up to the wall (y+ = 0).

Similarly, both kLowReWallFunction and epsilonWallFunction can be operated in both Low-Re and High-Re modes based on the computed y+ value.

In the usual wall function approach for industrial flows with std/realizable k-epsilon, the recommended practice is to have y+ > 30 at all wall locations. In this case, depending on the solution, the mesh may need adjustments at some locations.

If this is not practical or mesh adjustment is not possible, can one use the following combination in conjunction with standard/realizable k-epsilon model without worrying about y+ at individual locations? I mean, like a universal approach:

k ---> kLowReWallFunction

epsilon ---> epsilonWallFunction

nut ---> nutUSpaldingWallFunction

-kumar


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