9.1
general documentation
cs_matrix_building.h File Reference
#include "base/cs_defs.h"
#include "base/cs_math.h"
#include "base/cs_parameters.h"
#include "base/cs_base.h"
#include "base/cs_halo.h"
+ Include dependency graph for cs_matrix_building.h:

Go to the source code of this file.

Functions

void cs_matrix_compute_coeffs (cs_matrix_t *a, const cs_field_t *f, int iconvp, int idiffp, int ndircp, double thetap, double relaxp, int imucpp, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t rovsdt[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t xcpp[])
 Build the diagonal of the advection/diffusion matrix for determining the variable time step, flow, Fourier. More...
 
template<cs_lnum_t stride>
void cs_matrix_compute_coeffs (cs_matrix_t *a, const cs_field_t *f, int iconvp, int idiffp, int tensorial_diffusion, int ndircp, cs_lnum_t eb_size, double thetap, double relaxp, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t fimp[][stride][stride], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[])
 Build the diagonal of the advection/diffusion matrix for determining the variable time step, flow, Fourier. More...
 
void cs_matrix_wrapper (int iconvp, int idiffp, int ndircp, int isym, double thetap, int imucpp, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t rovsdt[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t xcpp[], cs_real_t da[], cs_real_t xa[])
 
template<cs_lnum_t stride>
void cs_matrix_wrapper (int iconvp, int idiffp, int tensorial_diffusion, int ndircp, int isym, cs_lnum_t eb_size, double thetap, const cs_field_bc_coeffs_t *bc_coeffs_v, const cs_real_t fimp[][stride][stride], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t da[][stride][stride], cs_real_t xa[])
 Build the matrix for a vector or tensor field. More...
 
void cs_matrix_time_step (const cs_mesh_t *m, int iconvp, int idiffp, int isym, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t *da)
 

Function Documentation

◆ cs_matrix_compute_coeffs() [1/2]

void cs_matrix_compute_coeffs ( cs_matrix_t a,
const cs_field_t f,
int  iconvp,
int  idiffp,
int  ndircp,
double  thetap,
double  relaxp,
int  imucpp,
const cs_field_bc_coeffs_t bc_coeffs,
const cs_real_t  rovsdt[],
const cs_real_t  i_massflux[],
const cs_real_t  b_massflux[],
const cs_real_t  i_visc[],
const cs_real_t  b_visc[],
const cs_real_t  xcpp[] 
)

Build the diagonal of the advection/diffusion matrix for determining the variable time step, flow, Fourier.

Parameters
[in,out]apointer to matrix structure
[in]fpointer to field, or null
[in]iconvpindicator
  • 1 advection
  • 0 otherwise
[in]idiffpindicator
  • 1 diffusion
  • 0 otherwise
[in]ndircpnumber of Dirichlet BCs
[in]thetaptime scheme parameter
[in]relaxprelaxation coefficient (if < 1)
[in]imucp1 for temperature (with Cp), 0 otherwise
[in]bc_coeffsboundary condition structure
[in]rovsdtimplicit terms (rho / dt)
[in]i_massfluxmass flux at interior faces
[in]b_massfluxmass flux at border faces
[in]i_visc$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} $ at interior faces for the matrix
[in]b_visc$ S_\fib $ at border faces for the matrix
[in]xcppCp per cell, or null

◆ cs_matrix_compute_coeffs() [2/2]

void cs_matrix_compute_coeffs ( cs_matrix_t a,
const cs_field_t f,
int  iconvp,
int  idiffp,
int  tensorial_diffusion,
int  ndircp,
cs_lnum_t  eb_size,
double  thetap,
double  relaxp,
const cs_field_bc_coeffs_t bc_coeffs,
const cs_real_t  fimp[][stride][stride],
const cs_real_t  i_massflux[],
const cs_real_t  b_massflux[],
const cs_real_t  i_visc[],
const cs_real_t  b_visc[] 
)

Build the diagonal of the advection/diffusion matrix for determining the variable time step, flow, Fourier.

Template Parameters
stride3 for vectors, 6 for tensors
Parameters
[in,out]apointer to matrix structure
[in]fpointer to field, or null
[in]iconvpindicator
  • 1 advection
  • 0 otherwise
[in]idiffpindicator
  • 1 diffusion
  • 0 otherwise
[in]tensorial_diffusionindicator
[in]ndircpnumber of Dirichlet BCs
[in]thetaptime scheme parameter
[in]relaxprelaxation coefficient (if < 1)
[in]eb_sizeextra-diagonal block size (1 or 3 for stride 3, 1 for stride 6)
[in]bc_coeffsboundary conditions structure
[in]fimpimplicit terms, or null
[in]i_massfluxmass flux at interior faces
[in]b_massfluxmass flux at border faces
[in]i_visc$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} $ at interior faces for the matrix
[in]b_visc$ S_\fib $ at boundary faces for the matrix

◆ cs_matrix_time_step()

void cs_matrix_time_step ( const cs_mesh_t m,
int  iconvp,
int  idiffp,
int  isym,
const cs_field_bc_coeffs_t bc_coeffs,
const cs_real_t  i_massflux[],
const cs_real_t  b_massflux[],
const cs_real_t  i_visc[],
const cs_real_t  b_visc[],
cs_real_t da 
)

◆ cs_matrix_wrapper() [1/2]

void cs_matrix_wrapper ( int  iconvp,
int  idiffp,
int  ndircp,
int  isym,
double  thetap,
int  imucpp,
const cs_field_bc_coeffs_t bc_coeffs,
const cs_real_t  rovsdt[],
const cs_real_t  i_massflux[],
const cs_real_t  b_massflux[],
const cs_real_t  i_visc[],
const cs_real_t  b_visc[],
const cs_real_t  xcpp[],
cs_real_t  da[],
cs_real_t  xa[] 
)

◆ cs_matrix_wrapper() [2/2]

void cs_matrix_wrapper ( int  iconvp,
int  idiffp,
int  tensorial_diffusion,
int  ndircp,
int  isym,
cs_lnum_t  eb_size,
double  thetap,
const cs_field_bc_coeffs_t bc_coeffs_v,
const cs_real_t  fimp[][stride][stride],
const cs_real_t  i_massflux[],
const cs_real_t  b_massflux[],
const cs_real_t  i_visc[],
const cs_real_t  b_visc[],
cs_real_t  da[][stride][stride],
cs_real_t  xa[] 
)

Build the matrix for a vector or tensor field.

The advection (if present) is upwind. The diffusion is not reconstructed. The matrix is split into a diagonal part (stride*stride blocks) and an extra diagonal part.

Template Parameters
stride3 for vectors, 6 for tensors
Parameters
[in]mpointer to mesh structure
[in]idiffpindicator
  • 1 diffusion
  • 0 otherwise
[in]thetapweighting coefficient for the theta-scheme,
  • thetap = 0: explicit scheme
  • thetap = 0.5: time-centered scheme (mix between Crank-Nicolson and Adams-Bashforth)
  • thetap = 1: implicit scheme
[in]bc_coeffs_vboundary condition structure for the variable
[in]fimp$ \tens{f_s}^{imp} $, or null
[in]i_visc$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} $ at interior faces for the matrix
[in]b_visc$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} $ at border faces for the matrix
[out]dadiagonal part of the matrix
[out]xaextra interleaved diagonal part of the matrix