k-epsilon constants modification

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

k-epsilon constants modification

Post by MaximeO »

Hello,

For a study about the flow and dispersion around a building, I would like to see the influence of the modifications of the k-epsilon (or k-epsilon linar production) model constants as shown in few articles that i found. The five constants are : , , , and .

However, only the first three seem to appear in the cs_turbulence_model.c or in the setup.log file obtained after a computation (cf. extract of one of my setup.log file below).

Code: Select all

  k-epsilon model with Linear Production (LP) correction constants:
    ce1:            1.44000e+00 (Cepsilon 1: production coef.)
    ce2:            1.92000e+00 (Cepsilon 2: dissipat.  coef.)
    cmu:            9.00000e-02 (Cmu constant)
I found "sigmak" and "sigmae" variables in src/base/clptrg.f90 and src/base/clptur.f90 which seem to correspond to the two other constants, but I don't know how and where are exactly declared the two sigma constants, and so if we can modify them by a user fonction.

I'm working on code_saturne v8.0.

Best regards,

Maxime
louis.simvia
Posts: 2
Joined: Fri Aug 01, 2025 2:28 pm

Re: k-epsilon constants modification

Post by louis.simvia »

Hello Maxime,

Have you checked this page of the documentation ?
https://www.code-saturne.org/documentat ... sttur.html

Also be careful that code_saturne has two k-epsilon model (linearized or not). I believe the constants sigma_k and sigma_epsilon appears in both but you should probably check the documentation if you want to make some more specific modifications to the constants.
MaximeO
Posts: 7
Joined: Wed Jul 02, 2025 9:37 am

Re: k-epsilon constants modification

Post by MaximeO »

Hello Louis,

Thank you for your response.

I have checked this document, which if I'm not mistaken refers to the cs_turbulence.c file I was talking about, but it doesn't mention the sigma_k and sigma_e constants.
I think the two sigma constants should indeed appear in both standard and linearized k-epsilon model, but as I said I didn't find any information about these two. And as they don't appear in the setup.log file, I am wandering if and how we can use them.

Best regards,

Maxime
StandardRANSUser001
Posts: 50
Joined: Tue Apr 09, 2024 3:26 am

Re: k-epsilon constants modification

Post by StandardRANSUser001 »

Not an expert on k-epsilon, however, aren't all model coefficients defined in cs_turbulence_model.c/cpp? They may be shared across several models perhaps?
https://github.com/code-saturne/code_sa ... _model.cpp

Best regards,
Sean Hanrahan
Yvan Fournier
Posts: 4242
Joined: Mon Feb 20, 2012 3:25 pm

Re: k-epsilon constants modification

Post by Yvan Fournier »

Hello,

If you modify any constant, I recommend checking the setup.log to make sure this worked as intended.

In v8.0, some constants might be duplicated in C and Fortran parts, though most should be shared.
In v9.0, since only the C definitions are used, changing them would be less risky, but note that in general, quite a few constants are not modifiable, as that amounts to changing the turbulence model, and we do not usually encourage this (we are fine with changing a model, as long as the result is considered a new model and not confused with the reference one).

Also, a few variables representing constants in C are shared between 2 models, and some constants may have different values (with the same name) in turbulence model variants. In this case, this is adjusted automatically in the setup, so if you change it too early, it may be overwritten (i.e. it may be better to force values in cs_user_parameters than in cs_user_model). In any case, checking the setup.log is important.

Best regards,

Yvan
Post Reply