src/user/cs_user_source_terms.f90 File Reference

| programmer's documentation

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions/Subroutines
cs_user_source_terms.f90 File Reference

Additional right-hand side source terms. More...

## Functions/Subroutines
subroutine | ustsnv (nvar, nscal, ncepdp, ncesmp, ivar, icepdc, icetsm, itypsm, dt, rtpa, propce, ckupdc, smacel, crvexp, crvimp)
subroutine | ustssc
subroutine | ustske
subroutine | ustskw
subroutine | ustsri
subroutine | ustsv2
subroutine | ustssa

## Detailed Description

Additional right-hand side source terms.

Additional right-hand side source terms for velocity components equation (Navier-Stokes)

# Usage

The additional source term is decomposed into an explicit part (`crvexp`) and an implicit part (`crvimp`) that must be provided here. The resulting equation solved by the code for a velocity is:

Note that `crvexp` and `crvimp` are defined after the Finite Volume integration over the cells, so they include the "volume" term. More precisely:

- crvexp is expressed in kg.m/s2
- crvimp is expressed in kg/s

The `crvexp` and `crvimp` arrays are already initialized to 0 before entering the 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:

- crvexp at time n
- crvimp at time n+1/2

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.

## Function/Subroutine Documentation

subroutine ustske | ( |  | ) |

subroutine ustskw | ( |  | ) |

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(ncelet,*) | rtpa,
|  | double precision, dimension(ncelet,*) | propce,
|  | double precision, dimension(ncepdp,6) | ckupdc,
|  | double precision, dimension(ncesmp,nvar) | smacel,
|  | double precision, dimension(3,ncelet) | crvexp,
|  | double precision, dimension(3,3,ncelet) | crvimp
| ) |  |

Parameters

  [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 (see ustsma)
  [in] | dt | time step (per cell)
  [in] | rtpa | calculated variables at cell centers (preceding time steps)
  [in] | propce | physical properties at cell centers
  [in] | ckupdc | head loss coefficient
  [in] | smacel | value associated to each variable in the mass source terms or mass rate (see ustsma)
  [out] | crvexp | explicit part of the source term
  [out] | crvimp | implicit part of the source term

subroutine ustsri | ( |  | ) |

subroutine ustssa | ( |  | ) |

subroutine ustssc | ( |  | ) |

subroutine ustsv2 | ( |  | ) |