Does code_saturne use wall functions on standard walls?

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Mohammad
Posts: 114
Joined: Thu Oct 25, 2018 12:18 pm

Does code_saturne use wall functions on standard walls?

Post by Mohammad »

Hello,

As you know, we may get better results if we set up wall functions boundary condition on walls instead of no-slip condition for turbulent flows.

According to the documents on the Doxygen about iwalf (https://www.code-saturne.org/cms/sites/ ... 69ec058107) it is mentioned that:
5: two scales of friction velocities (mixing length based on V. Driest analysis) iwallf is initialised to 2 for iturb = 10, 40, 41 or 70 (mixing length, LES and Spalart Allmaras).
iwallf is initialised to 0 for iturb = 0, 32, 50 or 51
Does it mean that code_saturne implements log-law wall function boundary condition on walls (with the iparoi condition) for LES by default or we have to set it in cs_user_parameters file to 5 or 2?

Regards,
Mohammad
Yvan Fournier
Posts: 4220
Joined: Mon Feb 20, 2012 3:25 pm

Re: Does code_saturne use wall functions on standard walls?

Post by Yvan Fournier »

Hello,

For RANS models, that is the default, but for LES I am not sure. If someone can correct me I would be happy.

If in doublt, you can simply run 1 (or 0) time steps with a simple case and check in the setup.log and run_solver.log which values the code has used for iwallf. Looking at src/modini.f90 it would seem iwallf ss set to 2 by default if the user has not specified it in the GUI or in cs_user_parameters.

So the documentation seems good.

But whenever in doubt or suspecting a bug, do not forget to experiment and use the logs on a simple case. This will often give you the quickest answer.

Regards,

Yvan
Mohammad
Posts: 114
Joined: Thu Oct 25, 2018 12:18 pm

Re: Does code_saturne use wall functions on standard walls?

Post by Mohammad »

Hello,

Thank you Yvan!
I checked the setup.log file and noticed that the default value is set to 2 which means that code_saturne uses one scale of friction velocities (log law) for LES by default.

Regards,

Mohammad
Ruonan
Posts: 136
Joined: Mon Dec 14, 2020 11:38 am

Re: Does code_saturne use wall functions on standard walls?

Post by Ruonan »

Hello Yvan and Mohammad,

Please I have a question about this topic:

I am also doing LES in Code_Saturne, and I confirmed from my setup.log file, that iwallf is initialized to 2 (one scale model log law) for LES Smagorinsky and classical dynamic model.

But how could I do if I want a wall resolved LES? I found there is no option for "wall function type" for LES in GUI. Also, as the wall function is "initialized" to "one scale model log law", will there be a change in the solution? For example, if I use a mesh that is fine enough, will it be initialized to "one scale model log law" and turn to "No wall function" during the calculation?

Many thanks,
Ruonan
Ruonan
Posts: 136
Joined: Mon Dec 14, 2020 11:38 am

Re: Does code_saturne use wall functions on standard walls?

Post by Ruonan »

Hello Code_Saturne experts,

Please could you give me some advice?

Many thanks,
Ruonan
Yvan Fournier
Posts: 4220
Joined: Mon Feb 20, 2012 3:25 pm

Re: Does code_saturne use wall functions on standard walls?

Post by Yvan Fournier »

Hello,

I would prefer turbulence specialists to answer this in a more precise manner, but if you want to ensure wall laws are not used, you can use cs_user_coundary_conditions to impose a Dirichlet condition (icodcl(ifac,iu) = 1) with zero velocity (rcodc(ifac, iu, 1) = 0, same for iv and iw).

Best regards,

Yvan
Ruonan
Posts: 136
Joined: Mon Dec 14, 2020 11:38 am

Re: Does code_saturne use wall functions on standard walls?

Post by Ruonan »

Hello Yvan,

Thanks for your reply. Actually I tried to set a Dirichlet boundary condition in the subroutine, but had some problems:

For example, for a stationary wall, if I don't specify anything either in GUI or subroutine, the velocity on the wall seems to be a friction velocity with wall functions, not no-slip velocity, but other values (pressure, temperature, etc) seem ok. But if I specify a Dirichlet boundary condition in subroutine as you said, the velocity on the wall seems no-slip without wall functions, but the problem is: wall distance and other values in the fluid domain seem wrong.

This is also discussed in a previous post, which hasn't been replied to now.
viewtopic.php?f=2&t=2791

Please could you give me some tips on what caused this problem? Thank you!

Best regards,
Ruonan
Post Reply