Wind tunnel by Launder-Sharma k-epsilon

Questions and remarks about Code_Saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Posts: 24
Joined: Sun Sep 17, 2017 7:41 pm

Wind tunnel by Launder-Sharma k-epsilon

Post by konst » Thu Apr 04, 2019 3:55 pm


Could you provide an example of using new Launder-Sharma k-epsilon model in version CS 6.0? It would be great if you can provide wind tunnel with rough wall.

Best regards,

Erwan Le Coupanec
Posts: 39
Joined: Sun Sep 08, 2013 8:50 pm

Re: Wind tunnel by Launder-Sharma k-epsilon

Post by Erwan Le Coupanec » Tue Apr 09, 2019 11:40 am

Hi Konstantin,

Launder-Sharma is a low Reynolds turbulence model, so using it to take into account rough walls with a wall model does not make much sense.

Nonetheless since the title of your thread calls for a more generic answer that might be needed by other users as well, you can find a user example telling you how to set the turbulence model in the sources. Here is a snippet coming from this user example source (cs_user_parameters-base.c)

Code: Select all


  /* Example: Chose a turbulence model
   *   CS_TURB_NONE: no turbulence model (laminar flow)
   *   CS_TURB_MIXING_LENGTH: mixing length model
   *   CS_TURB_K_EPSILON: standard k-epsilon model
   *   CS_TURB_K_EPSILON_LIN_PROD: k-epsilon model with
   *     Linear Production (LP) correction
   *   CS_TURB_K_EPSILON_LS: Launder-Sharma low Re k-epsilon model
   *   CS_TURB_RIJ_EPSILON_LRR: Rij-epsilon (LRR)
   *   CS_TURB_RIJ_EPSILON_SSG: Rij-epsilon (SSG)
   *   CS_TURB_LES_SMAGO_CONST: LES (constant Smagorinsky model)
   *   CS_TURB_LES_SMAGO_DYN: LES ("classical" dynamic Smagorisky model)
   *   CS_TURB_V2F_PHI: v2f phi-model
   *   CS_TURB_V2F_BL_V2K: v2f BL-v2-k
   *   CS_TURB_K_OMEGA: k-omega SST
   *   CS_TURB_SPALART_ALLMARAS: Spalart-Allmaras model */

  cs_turb_model_t *turb_model = cs_get_glob_turb_model();
  turb_model->iturb = CS_TURB_K_EPSILON_LS;


Posts: 24
Joined: Sun Sep 17, 2017 7:41 pm

Re: Wind tunnel by Launder-Sharma k-epsilon

Post by konst » Wed Apr 10, 2019 6:14 pm

Thank you for your reply !

But this will not work with GUI, because setting of GUI has a priority over cs_user_parameters.c, right? If that's right could you provide an example how to use CS6.0 without GUI (all set of necessary files... maybe).

PS. I was planning to apply for rough walls, because I thought Launder-Sharma take into account roughness of walls, but it is not.

Best regards.

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

Re: Wind tunnel by Launder-Sharma k-epsilon

Post by Yvan Fournier » Wed Apr 10, 2019 9:21 pm


Actually, user subroutines have priority in all cases except the choice of physical and turbulence models, such as is the case here, because those come very early and determine the types of fields that need to be created.

But although this is an "ugly" solution, making changes to a model by changing some equation parameters (such as switching from one k-epsilon to another variant) might be possible at a slightly later stage, though not recommended.

I don't guarantee it will work, but you can try it. You may then need to use at least some user subroutines to adapt to the desired model.

Best regards,


Posts: 24
Joined: Sun Sep 17, 2017 7:41 pm

Re: Wind tunnel by Launder-Sharma k-epsilon

Post by konst » Fri Apr 12, 2019 11:12 am

I have implemented option of Launder-Sharma model to GUI. Looks like it works. There is questions what kind of wall-functions is possible to use with that model. I implemented the same wall functions options as for k-epsilon models, but maybe it should be just two options: 1) wallfunction "all y+" . 2) "no wall function". I think it would be easy to fix.

I implemented it in branches origin/master and origin/v6.0. I think this feature would be interesting for the other people. So you can find this implementation in my fork of CS on github ( Question to CS-team: It would be possible to add this feature to realize version after some code-review?

Other Question: I want to implement also another k-epsilon turbulence model for rough walls (Foti-Scandura), but do not understand how to access roughness value defined by user. Could you describe how to access from turbke.f90 the roughness height defined by user in GUI?

Post Reply