Possible problem in Treatment of Source Terms in Turbulence Models Implementation

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
finzeo
Posts: 69
Joined: Fri Sep 09, 2022 4:23 pm

Possible problem in Treatment of Source Terms in Turbulence Models Implementation

Post by finzeo »

Hi all,

I'm thoroughly analyzing the implementation of hybrid turbulence models, specifically regarding RANS and the k-omega SST model. I'm working with version 8.1.
While examining the code in cs_turbulence_kw.c, I've come across something that doesn't quite add up regarding the explicit/implicit treatment of certain terms in the k equation. Specifically, the source term involving fhybr (=1 in the case of using RANS; 0<fhybr<1 if a hybrid model is used). On one hand, in this part of the code, its contribution to the explicit part of the equation appears:

Code: Select all

...
smbrk[c_id] += cell_f_vol[c_id]*(prodk[c_id] - cs_turb_cmu*ro*xw*xk*fhybr);
 ...
but in this other part, it's indicated that in the case of coupling between k and omega, it is agreed to treat the previous term implicitly:

Code: Select all

...
tinstk[c_id] += cell_f_vol[c_id]*cs_turb_cmu*ro*xw*fhybr;
...
However, in this case, I don't see that the explicit contribution made previously has been removed at this point (that is, both the explicit and implicit contributions have been added in the end), which wouldn't be correct.

Is there something I'm missing?
Martin FERRAND
Posts: 47
Joined: Wed Mar 14, 2012 10:06 am

Re: Possible problem in Treatment of Source Terms in Turbulence Models Implementation

Post by Martin FERRAND »

Hello,

variables are solved in increments, so if a source term write



then it gives with :



Note implicite par is put on the left hand side if .

Martin
finzeo
Posts: 69
Joined: Fri Sep 09, 2022 4:23 pm

Re: Possible problem in Treatment of Source Terms in Turbulence Models Implementation

Post by finzeo »

Thanks Martin,

Now I can clearly see then that by adding the implicit term, a term with is introduced which cancels out the explicit term.
Thanks for the explanation.
Post Reply