![]() |
programmer's documentation
|
Additional right_hand side source terms for turbulence models
The additional source term is decomposed into an explicit part and an implic it part
that must be provided here. The resulting equations solved by the code are:
where is the turbulence field of index
.
The ,
arrays are already initialized to 0 before entering the routine. It is not needed to do it in the routine (waste of CPU time).
For stability reasons, Code_Saturne
will not add -crvimp
directly to the diagonal of the matrix, but Max
(-crvimp,0). This way, the crvimp
term is treated implicitely only if it strengthens the diagonal of the matrix. However, when using the second-order in time scheme, this limitation cannot be done anymore and -crvimp
is added directly. The user should therefore test the negativity of crvimp
by himself.
When using the second-order in time scheme, one should supply:
The selection of cells where to apply the source terms is based on a getcel command. For more info on the syntax of the getcel command, refer to the user manual or to the comments on the similar command getfbr in the routine cs_user_boundary_conditions.
The following initialization block needs to be added for the following examples:
At the end of the subroutine, it is recommended to deallocate the work array:
In theory Fortran 95 deallocates locally-allocated arrays automatically, but deallocating arrays in a symetric manner to their alloacation is good pratice, and avoids using a different logic C and Fortran.
Remaining initialization
Get the density array in cpro_rom
Get the array of the current turbulent variable and its name
Example of arbitrary additional source term for turbulence models (Source term on the TKE "k" here).
Source term for
with =
3.d0
an =
4.d0