Page 1 of 1

Modify buoyancy-term parameter Pr

Posted: Fri Jan 09, 2026 5:04 pm
by WenhaoZHANG
Bonjour,

I am using code_saturne 9.0 to simulate breaking waves on cronos. I would like to modify the buoyancy-term parameter Pr in order to compare my results with other published papers that use OpenFOAM.

Does anyone know how to modify Pr in the user-defined files (e.g. cs_user_parameters.c)? Or can it only be changed by modifying the source code and recompiling code_saturne?

Below is the definition of Pr as implemented in the source code of the k–ω turbulence model.

/* Buoyancy production
------------------- */

/* prodk=min(P,c1*eps)+G */
/* prodw=P+(1-ce3)*G */

cs_real_t prdtur = 1;



Best regards,
Wenhao

Re: Modify buoyancy-term parameter Pr

Posted: Sun Jan 11, 2026 8:05 pm
by Yvan Fournier
Hello,

If you want to replace "cs_real_t prdtur = 1;", since it is a local definition, a user-defined file will not be enough.

You can try using the modified source code file as a user-defined file, but I am not sure whether this will work or lead to link-time issues. It did work in most cases with older compilers, but using a non-user file as a user-defined file in you case's SRC is not recommended, or at least recommended only for testing, as the modified file could be incompatible with bug fixes that same branch (we always make sure user-defined files stay compatible in a given series, but do not guarantee this for other files). So this is the easiest solution but should be very "temporary".

The clean solution is to rebuild the whole modified source code. On cronos, you can copy the install scripts (for example /software/rd/saturne/code_saturne/9.0/src/install_saturne-9.0.sh) locally and adapt the paths in the beginning to paths in you own directory to do this. Do not forget to also copy the matching etc/code_saturne.cfg settings from the reference implementation to your install to finalize the install.

Best regards,

Yvan