Question about atmospheric module

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
MaximeO
Posts: 10
Joined: Wed Jul 02, 2025 9:37 am

Question about atmospheric module

Post by MaximeO »

Hello,

I'm working on a dispersion study in an urban area, and I would like to analyze the impact of the turbulent schmidt number of the transported scalar over the concentration fields.

During some previous tests on a simplified case, I was able to modify the thanks to the user function cs_user_parameters.c with :

Code: Select all

#pragma weak cs_user_parameters
void
cs_user_parameters(cs_domain_t   *domain)
{
  cs_field_set_key_double(cs_field_by_name("scalar1"), cs_field_key_id("turbulent_schmidt"), 0.4); 
}
But I am now working with the Atmospheric module, and it seems that it fixes the to 0.7 and the user function does'nt work anymore.

Do you have any idea if it is possible to somehow "overpass" the Atmospheric module and modify this value ?

Thank you,

Maxime
Yvan Fournier
Posts: 4269
Joined: Mon Feb 20, 2012 3:25 pm

Re: Question about atmospheric module

Post by Yvan Fournier »

Hello,

I am not sure, but you could try placing the setting in a function called a bit later, such as cs_user_finalize_setup.

Also, be careful to remove the "#pragma weak" lines. They are removed from the user files copied in the installation directories (also used when you select user-defined functions with the GUI).
These lines are there to ensure the empty functions in the reference code have lower priority than the user's version. If the user's version also has these lines, priority is not guaranteed (and especially on Ubuntu systems, the empty reference version may be used instead).

Best regards,

Yvan
MaximeO
Posts: 10
Joined: Wed Jul 02, 2025 9:37 am

Re: Question about atmospheric module

Post by MaximeO »

Hello Yvan,

First of all thank you for the information about the "#pragma" line.

I didn't try your recommendation, but I found another way. As I am only studying the impact and all the other parameters remain the same, I first launched a flow simulation with the atmospheric module, and then I study the modification on a frozen field without the atmospheric module. I didn't think about this before writing the post, but as the field is frozen i don't need the atmo module anymore.

But I will keep you recommendation in mind, thank you !

Best regards,

Maxime
Post Reply