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
konst
Posts: 30
Joined: Sun Sep 17, 2017 7:41 pm

Wind tunnel by Launder-Sharma k-epsilon

Post by konst »

Hello,

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,
Konstantin
Erwan Le Coupanec
Posts: 45
Joined: Sun Sep 08, 2013 8:50 pm

Re: Wind tunnel by Launder-Sharma k-epsilon

Post by Erwan Le Coupanec »

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_RIJ_EPSILON_EBRSM: Rij-epsilon (EBRSM)
   *   CS_TURB_LES_SMAGO_CONST: LES (constant Smagorinsky model)
   *   CS_TURB_LES_SMAGO_DYN: LES ("classical" dynamic Smagorisky model)
   *   CS_TURB_LES_WALE: LES (WALE)
   *   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;
  

Regards,
Erwan.
konst
Posts: 30
Joined: Sun Sep 17, 2017 7:41 pm

Re: Wind tunnel by Launder-Sharma k-epsilon

Post by konst »

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... cs_user_scripts.py maybe).
Thanks.

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: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Wind tunnel by Launder-Sharma k-epsilon

Post by Yvan Fournier »

Hello,

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,

Yvan
konst
Posts: 30
Joined: Sun Sep 17, 2017 7:41 pm

Re: Wind tunnel by Launder-Sharma k-epsilon

Post by konst »

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 (https://github.com/kikuznetsov/code_saturne). 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