Page 1 of 1

Wall function for scalars

Posted: Mon Sep 27, 2021 12:28 pm
by Ruonan
Dear developers,

Hello, could you please help me with a question about the wall function? I am using version 7.0, incompressible module, with thermal scalar chosen to be "temperature Kelvin". But I can't find what wall function is used for this scalar.

I read through "cs_wall_functions.h", learned there are two types of wall functions: one for velocity, the other one for scalar. It seems there are different types of scalar wall functions that I can choose, as shown below.
wall function for scalars.PNG
But I can't find what scalar wall function was used both in GUI and in .xml file. I can only find and change the type of velocity wall function, as shown below.
wall function in xml.PNG
select a wall function type.PNG
So my question is: how could I know what scalar wall function is used in the simulation, and how could I change it to different types available? Thank you very much!

Best regards,
Ruonan

Re: Wall function for scalars

Posted: Mon Sep 27, 2021 3:05 pm
by Yvan Fournier
Hello,

You can get a trace of the wall law used by searching for "iwallf" in the setup.log file after running a computation.

Best regards,

Yvan

Re: Wall function for scalars

Posted: Mon Sep 27, 2021 4:05 pm
by Ruonan
Hello Yvan,

Thank you! I found it in setup.log file. Code_Saturne use the "Arparci and Larsen" one as a default scalar wall function. But how could I change to another scalar wall function, for example "VDRIEST"?

Should I add something in the "setup.xml" file? I tried to add a line "<scalar_wall_function>1</scalar_wall_function>" in the setup.xml (just guessing), and run the simulation. But nothing changed, the scalar wall function was still "Arparci and Larsen". What should I do please? Thanks!

Best regards,
Ruonan

Re: Wall function for scalars

Posted: Tue Sep 28, 2021 1:38 pm
by Yvan Fournier
Hello,

You guess is close, but, looking at the XML reader, the tag would be "wall_function" instead of "scalar_wall_function", and is common to all variables (I think). It is also placed in a specific place in the keywords "tree", so the best solution is to use the GUI and modify the choice of wall law using the "advanced options" of the turbulence model you use to build an example
(than search for "wall_function" in the XML)

Once you have an example, you can always modify it directly if you prefer.

Best regards,

Yvan

Re: Wall function for scalars

Posted: Tue Sep 28, 2021 4:28 pm
by Ruonan
Hello Yvan,

Thank you very much! But I'm not sure the wall function selected is for all variables? If we look at the GUI, there are 4 types of wall functions available to choose, as shown in the figure. But I think they are all velocity wall function, not scalar wall function?

In cs_wall_functions.h, I can see the codes for several types of scalar wall functions. Saturne uses "Arparci and Larsen" as default, but I want to try another one. I didn't find how to change the scalar wall function in GUI or xml. Could you guide me please?

Best regards,
Ruonan
select a wall function type.PNG

Re: Wall function for scalars

Posted: Tue Sep 28, 2021 11:49 pm
by Yvan Fournier
Hello,

I'm not see sure about this but I think the wall law choice is global. For a given scalar and boundary zone (or face) you can choose to apply the wall law or apply direct Dirichlet/Neumann conditions, and you can modify the Prandlt/Schmidt number, but I do not think you can choose a separate law for each scalar.

This would probably be possible, but would require finer-grained settings than those available.

Again, I am not an expert on this part of the code, and am answering from a smartphone, which is not ideal for "grepping" the code itself....

Best regards,

Yvan