Code_Saturne
CFD tool
Functions/Subroutines
matrix.f90 File Reference

This function builds the matrix of advection/diffusion for a scalar field. More...

Functions/Subroutines

subroutine matrix (ncelet, ncel, nfac, nfabor, iconvp, idiffp, ndircp, isym, nfecra, thetap, imucpp, ifacel, ifabor, coefbp, cofbfp, rovsdt, flumas, flumab, viscf, viscb, xcpp, da, xa)
 

Detailed Description

This function builds the matrix of advection/diffusion for a scalar field.

The advection is upwind, the diffusion is not reconstructed. The matrix is splitted into a diagonal block (number of cells) and an extra diagonal part (of dimension 2 time the number of internal faces).

Function/Subroutine Documentation

◆ matrix()

subroutine matrix ( integer  ncelet,
integer  ncel,
integer  nfac,
integer  nfabor,
integer  iconvp,
integer  idiffp,
integer  ndircp,
integer  isym,
integer  nfecra,
double precision  thetap,
integer  imucpp,
integer, dimension(2,nfac)  ifacel,
integer, dimension(nfabor)  ifabor,
double precision, dimension(nfabor)  coefbp,
double precision, dimension(nfabor)  cofbfp,
double precision, dimension(ncelet)  rovsdt,
double precision, dimension(nfac)  flumas,
double precision, dimension(nfabor)  flumab,
double precision, dimension(nfac)  viscf,
double precision, dimension(nfabor)  viscb,
double precision, dimension(ncelet)  xcpp,
double precision, dimension(ncelet )  da,
double precision, dimension(nfac ,isym)  xa 
)
Parameters
[in]nceletnumber of extended (real + ghost) cells
[in]ncelnumber of cells
[in]nfacnumber of interior faces
[in]nfabornumber of boundary faces
[in]iconvpindicator
  • 1 advection
  • 0 otherwise
[in]idiffpindicator
  • 1 diffusion
  • 0 otherwise
[in]ndircpindicator
  • 0 if the diagonal stepped aside
[in]isymindicator
  • 1 symmetric matrix
  • 2 non symmmetric matrix
[in]thetapweightening coefficient for the theta-schema,
  • thetap = 0: explicit scheme
  • thetap = 0.5: time-centred scheme (mix between Crank-Nicolson and Adams-Bashforth)
  • thetap = 1: implicit scheme
[in]imucppindicator
  • 0 do not multiply the convectiv term by Cp
  • 1 do multiply the convectiv term by Cp
[in]ifacelcell indexes of interior faces
[in]ifaborno de l'elt voisin d'une face de bord
[in]coefbpboundary condition array for the variable (Impplicit part)
[in]cofbfpboundary condition array for the variable flux (Impplicit part)
[in]flumasmass flux at interior faces
[in]flumabmass flux at border faces
[in]viscf$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} $ at interior faces for the matrix
[in]viscb$ S_\fib $ at border faces for the matrix
[in]xcpparray of specific heat (Cp)
[out]dadiagonal part of the matrix
[out]xaextra interleaved diagonal part of the matrix
Here is the call graph for this function: