User subroutines for additional right-hand side source terms. More...
Functions/Subroutines | |
subroutine | ustsnv (nvar, nscal, ncepdp, ncesmp, ivar, icepdc, icetsm, itypsm, dt, ckupdc, smacel, crvexp, crvimp) |
Additional right-hand side source terms for velocity components equation (Navier-Stokes) More... | |
subroutine | ustssc (nvar, nscal, ncepdp, ncesmp, iscal, icepdc, icetsm, itypsm, dt, ckupdc, smacel, crvexp, crvimp) |
Additional right-hand side source terms for scalar equations (user scalars and specific physics scalars). More... | |
subroutine | ustsvv (nvar, nscal, ncepdp, ncesmp, iscal, icepdc, icetsm, itypsm, dt, ckupdc, smacel, crvexp, crvimp) |
Additional right-hand side source terms for vectorial equations (user vectors and specific physics vectors). More... | |
subroutine | cs_user_turbulence_source_terms2 (nvar, nscal, ncepdp, ncesmp, f_id, icepdc, icetsm, itypsm, ckupdc, smacel, crvexp, crvimp) |
Additional right-hand side source terms for turbulence models and irijco =1. More... | |
User subroutines for additional right-hand side source terms.
See cs_user_source_terms and Examples of data settings for source terms with scalar in a channel for examples.
subroutine cs_user_turbulence_source_terms2 | ( | integer | nvar, |
integer | nscal, | ||
integer | ncepdp, | ||
integer | ncesmp, | ||
integer | f_id, | ||
integer, dimension(ncepdp) | icepdc, | ||
integer, dimension(ncesmp) | icetsm, | ||
integer, dimension(ncesmp,nvar) | itypsm, | ||
double precision, dimension(6,ncepdp) | ckupdc, | ||
double precision, dimension(ncesmp,nvar) | smacel, | ||
double precision, dimension(6,ncelet) | crvexp, | ||
double precision, dimension(6,6,ncelet) | crvimp | ||
) |
Additional right-hand side source terms for turbulence models and irijco =1.
The additional source term is decomposed into an explicit part (crvexp) and an implicit part (crvimp) that must be provided here. The resulting equations solved by the code are:
where is the turbulence field of index
f_id
Note that crvexp, crvimp are defined after the Finite Volume integration over the cells, so they include the "volume" term. More precisely:
The crvexp, crvimp 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.
[in] | nvar | total number of variables |
[in] | nscal | total number of scalars |
[in] | ncepdp | number of cells with head loss terms |
[in] | ncesmp | number of cells with mass source terms |
[in] | f_id | field index of the current turbulent variable |
[in] | icepdc | index number of cells with head loss terms |
[in] | icetsm | index number of cells with mass source terms |
[in] | itypsm | type of mass source term for each variable |
[in] | ckupdc | head loss coefficient |
[in] | smacel | value associated to each variable in the mass source terms or mass rate |
[out] | crvexp | explicit part of the source term |
[out] | crvimp | implicit part of the source term |
subroutine ustsnv | ( | integer | nvar, |
integer | nscal, | ||
integer | ncepdp, | ||
integer | ncesmp, | ||
integer | ivar, | ||
integer, dimension(ncepdp) | icepdc, | ||
integer, dimension(ncesmp) | icetsm, | ||
integer, dimension(ncesmp,nvar) | itypsm, | ||
double precision, dimension(ncelet) | dt, | ||
double precision, dimension(6,ncepdp) | ckupdc, | ||
double precision, dimension(ncesmp,nvar) | smacel, | ||
double precision, dimension(3,ncelet) | crvexp, | ||
double precision, dimension(3,3,ncelet) | crvimp | ||
) |
Additional right-hand side source terms for velocity components equation (Navier-Stokes)
[in] | nvar | total number of variables |
[in] | nscal | total number of scalars |
[in] | ncepdp | number of cells with head loss terms |
[in] | ncesmp | number of cells with mass source terms |
[in] | ivar | index number of the current variable |
[in] | icepdc | index number of cells with head loss terms |
[in] | icetsm | index number of cells with mass source terms |
[in] | itypsm | type of mass source term for each variable |
[in] | dt | time step (per cell) |
[in] | ckupdc | head loss coefficient |
[in] | smacel | value associated to each variable in the mass source terms or mass rate |
[out] | crvexp | explicit part of the source term |
[out] | crvimp | implicit part of the source term |
subroutine ustssc | ( | integer | nvar, |
integer | nscal, | ||
integer | ncepdp, | ||
integer | ncesmp, | ||
integer | iscal, | ||
integer, dimension(ncepdp) | icepdc, | ||
integer, dimension(ncesmp) | icetsm, | ||
integer, dimension(ncesmp,nvar) | itypsm, | ||
double precision, dimension(ncelet) | dt, | ||
double precision, dimension(6,ncepdp) | ckupdc, | ||
double precision, dimension(ncesmp,nvar) | smacel, | ||
double precision, dimension(ncelet) | crvexp, | ||
double precision, dimension(ncelet) | crvimp | ||
) |
Additional right-hand side source terms for scalar equations (user scalars and specific physics scalars).
[in] | nvar | total number of variables |
[in] | nscal | total number of scalars |
[in] | ncepdp | number of cells with head loss terms |
[in] | ncesmp | number of cells with mass source terms |
[in] | iscal | index number of the current scalar |
[in] | icepdc | index number of cells with head loss terms |
[in] | icetsm | index number of cells with mass source terms |
[in] | itypsm | type of mass source term for each variable |
[in] | dt | time step (per cell) |
[in] | ckupdc | head loss coefficient |
[in] | smacel | value associated to each variable in the mass |
[in] | source | terms or mass rate |
[out] | crvexp | explicit part of the source term |
[out] | crvimp | implicit part of the source term |
subroutine ustsvv | ( | integer | nvar, |
integer | nscal, | ||
integer | ncepdp, | ||
integer | ncesmp, | ||
integer | iscal, | ||
integer, dimension(ncepdp) | icepdc, | ||
integer, dimension(ncesmp) | icetsm, | ||
integer, dimension(ncesmp,nvar) | itypsm, | ||
double precision, dimension(ncelet) | dt, | ||
double precision, dimension(6,ncepdp) | ckupdc, | ||
double precision, dimension(ncesmp,nvar) | smacel, | ||
double precision, dimension(3,ncelet) | crvexp, | ||
double precision, dimension(3,3,ncelet) | crvimp | ||
) |
Additional right-hand side source terms for vectorial equations (user vectors and specific physics vectors).
[in] | nvar | total number of variables |
[in] | nscal | total number of scalars |
[in] | ncepdp | number of cells with head loss terms |
[in] | ncesmp | number of cells with mass source terms |
[in] | iscal | index number of the current scalar |
[in] | icepdc | index number of cells with head loss terms |
[in] | icetsm | index number of cells with mass source terms |
[in] | itypsm | type of mass source term for each variable |
[in] | dt | time step (per cell) |
[in] | ckupdc | head loss coefficient |
[in] | smacel | value associated to each variable in the mass |
[in] | source | terms or mass rate |
[out] | crvexp | explicit part of the source term |
[out] | crvimp | implicit part of the source term |