Function called every time step.
Assume, for example, that the user source terms modify the equation of a variable in the following way:
The example is valid for a velocity component, for a turbulent variable (
,
,
,
or
) and for a scalar (or for the average of the square of the fluctuations of a scalar), because the syntax of the cs_user_source_terms function in the cs_user_source_terms.c file is similar.
The source terms in the transport equations related to the user scalars (passive or not, average of the square of the fluctuations of a scalar, ...) can be filled in thanks to the GUI or the cs_user_source_terms
user file. Without the GUI, the cs_user_source_terms
function is used to add source terms to the transport equations related to the user scalars, this function is called every time step, once for each user scalar. The user must provide the arrays st_imp
and st_exp
related to each scalar. st_imp
and st_exp
must be set to 0 for the scalars on which it is not wished for the user source term to be applied.
The GUI can be used if the source terms are proportional to the volume of the cells or the volume of the fluid in the cell.
By example if we have:
We can define them directly in the GUI