8.3
general documentation
cs_convection_diffusion.h File Reference
#include "cs_defs.h"
#include "bft_mem.h"
#include "cs_base.h"
#include "cs_dispatch.h"
#include "cs_halo.h"
#include "cs_math.h"
#include "cs_mesh_quantities.h"
#include "cs_equation_param.h"
+ Include dependency graph for cs_convection_diffusion.h:

Go to the source code of this file.

Enumerations

enum  cs_nvd_type_t {
  CS_NVD_GAMMA = 0 , CS_NVD_SMART = 1 , CS_NVD_CUBISTA = 2 , CS_NVD_SUPERBEE = 3 ,
  CS_NVD_MUSCL = 4 , CS_NVD_MINMOD = 5 , CS_NVD_CLAM = 6 , CS_NVD_STOIC = 7 ,
  CS_NVD_OSHER = 8 , CS_NVD_WASEB = 9 , CS_NVD_VOF_HRIC = 10 , CS_NVD_VOF_CICSAM = 11 ,
  CS_NVD_VOF_STACS = 12 , CS_NVD_N_TYPES = 13
}
 

Functions

cs_real_tcs_get_v_slope_test (int f_id, const cs_equation_param_t eqp)
 
void cs_beta_limiter_building (int f_id, int inc, const cs_real_t rovsdt[])
 Compute the beta blending coefficient of the beta limiter (ensuring preservation of a given min/max pair of values). More...
 
void cs_convection_diffusion_scalar (int idtvar, int f_id, const cs_equation_param_t eqp, int icvflb, int inc, int imasac, cs_real_t *pvar, const cs_real_t *pvara, const int icvfli[], 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 *rhs)
 Add the explicit part of the convection/diffusion terms of a standard transport equation of a scalar field $ \varia $. More...
 
void cs_face_convection_scalar (int idtvar, int f_id, const cs_equation_param_t eqp, int icvflb, int inc, int imasac, cs_real_t *pvar, const cs_real_t *pvara, const int icvfli[], const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_massflux[], const cs_real_t b_massflux[], cs_real_2_t i_conv_flux[], cs_real_t b_conv_flux[])
 
void cs_convection_diffusion_vector (int idtvar, int f_id, const cs_equation_param_t eqp, int icvflb, int inc, int ivisep, int imasac, cs_real_3_t *pvar, const cs_real_3_t *pvara, const int icvfli[], const cs_field_bc_coeffs_t *bc_coeffs_v, 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 i_secvis[], const cs_real_t b_secvis[], cs_real_3_t *i_pvar, cs_real_3_t *b_pvar, cs_real_3_t *rhs)
 
void cs_convection_diffusion_tensor (int idtvar, int f_id, const cs_equation_param_t eqp, int icvflb, int inc, int imasac, cs_real_6_t *pvar, const cs_real_6_t *pvara, const cs_field_bc_coeffs_t *bc_coeffs_ts, 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_6_t *rhs)
 Add the explicit part of the convection/diffusion terms of a transport equation of a tensor field $ \tens{\varia} $. More...
 
void cs_convection_diffusion_thermal (int idtvar, int f_id, const cs_equation_param_t eqp, int inc, int imasac, cs_real_t *pvar, const cs_real_t *pvara, 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[], const cs_real_t xcpp[], cs_real_t *rhs)
 Add the explicit part of the convection/diffusion terms of a transport equation of a scalar field $ \varia $ such as the temperature. More...
 
void cs_anisotropic_diffusion_scalar (int idtvar, int f_id, const cs_equation_param_t eqp, int inc, cs_real_t *pvar, const cs_real_t *pvara, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_t *rhs)
 
void cs_anisotropic_left_diffusion_vector (int idtvar, int f_id, const cs_equation_param_t eqp, int inc, int ivisep, cs_real_3_t *pvar, const cs_real_3_t *pvara, const cs_field_bc_coeffs_t *bc_coeffs_v, const cs_real_33_t i_visc[], const cs_real_t b_visc[], const cs_real_t i_secvis[], cs_real_3_t *rhs)
 
void cs_anisotropic_right_diffusion_vector (int idtvar, int f_id, const cs_equation_param_t eqp, int inc, cs_real_3_t *pvar, const cs_real_3_t *pvara, const cs_field_bc_coeffs_t *bc_coeffs_v, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_3_t *rhs)
 
void cs_anisotropic_diffusion_tensor (int idtvar, int f_id, const cs_equation_param_t eqp, int inc, cs_real_6_t *pvar, const cs_real_6_t *pvara, const cs_field_bc_coeffs_t *bc_coeffs_ts, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_6_t *rhs)
 
void cs_face_diffusion_potential (const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int nswrgp, int imligp, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *frcxt, cs_real_t *pvar, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t *visel, cs_real_t *i_massflux, cs_real_t *b_massflux)
 
void cs_face_anisotropic_diffusion_potential (const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int nswrgp, int imligp, int ircflp, int ircflb, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *frcxt, cs_real_t *pvar, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_t *i_massflux, cs_real_t *b_massflux)
 
void cs_diffusion_potential (const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int nswrgp, int imligp, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *frcxt, cs_real_t *pvar, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t visel[], cs_real_t *diverg)
 Update the cell mass flux divergence with the face pressure (or pressure increment, or pressure double increment) gradient. More...
 
void cs_anisotropic_diffusion_potential (const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int nswrgp, int imligp, int ircflp, int ircflb, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *frcxt, cs_real_t *pvar, const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_t *diverg)
 

Enumeration Type Documentation

◆ cs_nvd_type_t

Enumerator
CS_NVD_GAMMA 
CS_NVD_SMART 
CS_NVD_CUBISTA 
CS_NVD_SUPERBEE 
CS_NVD_MUSCL 
CS_NVD_MINMOD 
CS_NVD_CLAM 
CS_NVD_STOIC 
CS_NVD_OSHER 
CS_NVD_WASEB 
CS_NVD_VOF_HRIC 
CS_NVD_VOF_CICSAM 
CS_NVD_VOF_STACS 
CS_NVD_N_TYPES 

Function Documentation

◆ cs_anisotropic_diffusion_potential()

void cs_anisotropic_diffusion_potential ( const int  f_id,
const cs_mesh_t m,
cs_mesh_quantities_t fvq,
int  init,
int  inc,
int  imrgra,
int  nswrgp,
int  imligp,
int  ircflp,
int  ircflb,
int  iphydp,
int  iwgrp,
int  iwarnp,
double  epsrgp,
double  climgp,
cs_real_3_t frcxt,
cs_real_t pvar,
const cs_field_bc_coeffs_t bc_coeffs,
const cs_real_t  i_visc[],
const cs_real_t  b_visc[],
cs_real_6_t viscel,
const cs_real_2_t  weighf[],
const cs_real_t  weighb[],
cs_real_t diverg 
)

◆ cs_anisotropic_diffusion_scalar()

void cs_anisotropic_diffusion_scalar ( int  idtvar,
int  f_id,
const cs_equation_param_t  eqp,
int  inc,
cs_real_t pvar,
const cs_real_t pvara,
const cs_field_bc_coeffs_t bc_coeffs,
const cs_real_t  i_visc[],
const cs_real_t  b_visc[],
cs_real_6_t viscel,
const cs_real_2_t  weighf[],
const cs_real_t  weighb[],
cs_real_t rhs 
)

◆ cs_anisotropic_diffusion_tensor()

void cs_anisotropic_diffusion_tensor ( int  idtvar,
int  f_id,
const cs_equation_param_t  eqp,
int  inc,
cs_real_6_t pvar,
const cs_real_6_t pvara,
const cs_field_bc_coeffs_t bc_coeffs_ts,
const cs_real_t  i_visc[],
const cs_real_t  b_visc[],
cs_real_6_t viscel,
const cs_real_2_t  weighf[],
const cs_real_t  weighb[],
cs_real_6_t rhs 
)

◆ cs_anisotropic_left_diffusion_vector()

void cs_anisotropic_left_diffusion_vector ( int  idtvar,
int  f_id,
const cs_equation_param_t  eqp,
int  inc,
int  ivisep,
cs_real_3_t pvar,
const cs_real_3_t pvara,
const cs_field_bc_coeffs_t bc_coeffs_v,
const cs_real_33_t  i_visc[],
const cs_real_t  b_visc[],
const cs_real_t  i_secvis[],
cs_real_3_t rhs 
)

◆ cs_anisotropic_right_diffusion_vector()

void cs_anisotropic_right_diffusion_vector ( int  idtvar,
int  f_id,
const cs_equation_param_t  eqp,
int  inc,
cs_real_3_t pvar,
const cs_real_3_t pvara,
const cs_field_bc_coeffs_t bc_coeffs_v,
const cs_real_t  i_visc[],
const cs_real_t  b_visc[],
cs_real_6_t viscel,
const cs_real_2_t  weighf[],
const cs_real_t  weighb[],
cs_real_3_t rhs 
)

◆ cs_beta_limiter_building()

void cs_beta_limiter_building ( int  f_id,
int  inc,
const cs_real_t  rovsdt[] 
)

Compute the beta blending coefficient of the beta limiter (ensuring preservation of a given min/max pair of values).

Parameters
[in]f_idfield id
[in]inc"not an increment" flag
[in]rovsdtrho * volume / dt

◆ cs_convection_diffusion_scalar()

void cs_convection_diffusion_scalar ( int  idtvar,
int  f_id,
const cs_equation_param_t  eqp,
int  icvflb,
int  inc,
int  imasac,
cs_real_t pvar,
const cs_real_t pvara,
const int  icvfli[],
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 rhs 
)

Add the explicit part of the convection/diffusion terms of a standard transport equation of a scalar field $ \varia $.

More precisely, the right hand side $ Rhs $ is updated as follows:

\[
Rhs = Rhs - \sum_{\fij \in \Facei{\celli}}      \left(
       \dot{m}_\ij \left( \varia_\fij - \varia_\celli \right)
     - \mu_\fij \gradv_\fij \varia \cdot \vect{S}_\ij  \right)
\]

Warning:

  • $ Rhs $ has already been initialized before calling bilsc2!
  • mind the sign minus

Please refer to the bilsc2 section of the theory guide for more informations.

Parameters
[in]idtvarindicator of the temporal scheme
[in]f_idfield id (or -1)
[in]eqpequation parameters
[in]icvflbglobal indicator of boundary convection flux
  • 0 upwind scheme at all boundary faces
  • 1 imposed flux at some boundary faces
[in]incindicator
  • 0 when solving an increment
  • 1 otherwise
[in]imasactake mass accumulation into account?
[in]pvarsolved variable (current time step)
[in]pvarasolved variable (previous time step)
[in]icvfliboundary face indicator array of convection flux
  • 0 upwind scheme
  • 1 imposed flux
[in]bc_coeffsboundary condition structure for the variable
[in]i_massfluxmass flux at interior faces
[in]b_massfluxmass flux at boundary faces
[in]i_visc$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} $ at interior faces for the r.h.s.
[in]b_visc$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} $ at border faces for the r.h.s.
[in,out]rhsright hand side $ \vect{Rhs} $

◆ cs_convection_diffusion_tensor()

void cs_convection_diffusion_tensor ( int  idtvar,
int  f_id,
const cs_equation_param_t  eqp,
int  icvflb,
int  inc,
int  imasac,
cs_real_6_t pvar,
const cs_real_6_t pvara,
const cs_field_bc_coeffs_t bc_coeffs_ts,
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_6_t rhs 
)

Add the explicit part of the convection/diffusion terms of a transport equation of a tensor field $ \tens{\varia} $.

More precisely, the right hand side $ \tens{Rhs} $ is updated as follows:

\[
 \tens{Rhs} = \tens{Rhs} - \sum_{\fij \in \Facei{\celli}}      \left(
        \dot{m}_\ij \left( \tens{\varia}_\fij - \tens{\varia}_\celli \right)
      - \mu_\fij \gradt_\fij \tens{\varia} \cdot \tens{S}_\ij  \right)
\]

Warning:

  • $ \tens{Rhs} $ has already been initialized before calling bilsc!
  • mind the sign minus
Parameters
[in]idtvarindicator of the temporal scheme
[in]f_idindex of the current variable
[in]eqpequation parameters
[in]icvflbglobal indicator of boundary convection flux
  • 0 upwind scheme at all boundary faces
  • 1 imposed flux at some boundary faces
[in]incindicator
  • 0 when solving an increment
  • 1 otherwise
[in]imasactake mass accumulation into account?
[in]pvarsolved velocity (current time step)
[in]pvarasolved velocity (previous time step)
[in]bc_coeffs_tsboundary condition structure for the variable
[in]i_massfluxmass flux at interior faces
[in]b_massfluxmass flux at boundary faces
[in]i_visc$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} $ at interior faces for the r.h.s.
[in]b_visc$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} $ at border faces for the r.h.s.
[in,out]rhsright hand side $ \tens{Rhs} $

◆ cs_convection_diffusion_thermal()

void cs_convection_diffusion_thermal ( int  idtvar,
int  f_id,
const cs_equation_param_t  eqp,
int  inc,
int  imasac,
cs_real_t pvar,
const cs_real_t pvara,
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[],
const cs_real_t  xcpp[],
cs_real_t rhs 
)

Add the explicit part of the convection/diffusion terms of a transport equation of a scalar field $ \varia $ such as the temperature.

More precisely, the right hand side $ Rhs $ is updated as follows:

\[
Rhs = Rhs + \sum_{\fij \in \Facei{\celli}}      \left(
       C_p\dot{m}_\ij \varia_\fij
     - \lambda_\fij \gradv_\fij \varia \cdot \vect{S}_\ij  \right)
\]

Warning: $ Rhs $ has already been initialized before calling bilsct!

Parameters
[in]idtvarindicator of the temporal scheme
[in]f_idindex of the current variable
[in]eqpequation parameters)
[in]incindicator
  • 0 when solving an increment
  • 1 otherwise
[in]imasactake mass accumulation into account?
[in]pvarsolved variable (current time step)
[in]pvarasolved variable (previous time step)
[in]bc_coeffsboundary condition structure for the variable
[in]i_massfluxmass flux at interior faces
[in]b_massfluxmass flux at boundary faces
[in]i_visc$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} $ at interior faces for the r.h.s.
[in]b_visc$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} $ at border faces for the r.h.s.
[in]xcpparray of specific heat ( $ C_p $)
[in,out]rhsright hand side $ \vect{Rhs} $

◆ cs_convection_diffusion_vector()

void cs_convection_diffusion_vector ( int  idtvar,
int  f_id,
const cs_equation_param_t  eqp,
int  icvflb,
int  inc,
int  ivisep,
int  imasac,
cs_real_3_t pvar,
const cs_real_3_t pvara,
const int  icvfli[],
const cs_field_bc_coeffs_t bc_coeffs_v,
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  i_secvis[],
const cs_real_t  b_secvis[],
cs_real_3_t i_pvar,
cs_real_3_t b_pvar,
cs_real_3_t rhs 
)

◆ cs_diffusion_potential()

void cs_diffusion_potential ( const int  f_id,
const cs_mesh_t m,
cs_mesh_quantities_t fvq,
int  init,
int  inc,
int  imrgra,
int  nswrgp,
int  imligp,
int  iphydp,
int  iwgrp,
int  iwarnp,
double  epsrgp,
double  climgp,
cs_real_3_t frcxt,
cs_real_t pvar,
const cs_field_bc_coeffs_t bc_coeffs,
const cs_real_t  i_visc[],
const cs_real_t  b_visc[],
cs_real_t  visel[],
cs_real_t diverg 
)

Update the cell mass flux divergence with the face pressure (or pressure increment, or pressure double increment) gradient.

\[
\dot{m}_\ij = \dot{m}_\ij
            - \sum_j \Delta t \grad_\fij p \cdot \vect{S}_\ij
\]

Parameters
[in]f_idfield id (or -1)
[in]mpointer to mesh
[in]fvqpointer to finite volume quantities
[in]initindicator
  • 1 initialize the mass flux to 0
  • 0 otherwise
[in]incindicator
  • 0 when solving an increment
  • 1 otherwise
[in]imrgraindicator
  • 0 iterative gradient
  • 1 least squares gradient
[in]nswrgpnumber of reconstruction sweeps for the gradients
[in]imligpclipping gradient method
  • < 0 no clipping
  • = 0 thank to neighbooring gradients
  • = 1 thank to the mean gradient
[in]iphydphydrostatic pressure indicator
[in]iwarnpverbosity
[in]iwgrpindicator
  • 1 weight gradient by vicosity*porosity
  • weighting determined by field options
[in]epsrgprelative precision for the gradient reconstruction
[in]climgpclipping coeffecient for the computation of the gradient
[in]frcxtbody force creating the hydrostatic pressure
[in]pvarsolved variable (current time step)
[in]bc_coeffsboundary condition structure for the variable
[in]i_visc$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} $ at interior faces for the r.h.s.
[in]b_visc$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} $ at border faces for the r.h.s.
[in]viselviscosity by cell
[in,out]divergmass flux divergence

◆ cs_face_anisotropic_diffusion_potential()

void cs_face_anisotropic_diffusion_potential ( const int  f_id,
const cs_mesh_t m,
cs_mesh_quantities_t fvq,
int  init,
int  inc,
int  imrgra,
int  nswrgp,
int  imligp,
int  ircflp,
int  ircflb,
int  iphydp,
int  iwgrp,
int  iwarnp,
double  epsrgp,
double  climgp,
cs_real_3_t frcxt,
cs_real_t pvar,
const cs_field_bc_coeffs_t bc_coeffs,
const cs_real_t  i_visc[],
const cs_real_t  b_visc[],
cs_real_6_t viscel,
const cs_real_2_t  weighf[],
const cs_real_t  weighb[],
cs_real_t i_massflux,
cs_real_t b_massflux 
)

◆ cs_face_convection_scalar()

void cs_face_convection_scalar ( int  idtvar,
int  f_id,
const cs_equation_param_t  eqp,
int  icvflb,
int  inc,
int  imasac,
cs_real_t pvar,
const cs_real_t pvara,
const int  icvfli[],
const cs_field_bc_coeffs_t bc_coeffs,
const cs_real_t  i_massflux[],
const cs_real_t  b_massflux[],
cs_real_2_t  i_conv_flux[],
cs_real_t  b_conv_flux[] 
)

◆ cs_face_diffusion_potential()

void cs_face_diffusion_potential ( const int  f_id,
const cs_mesh_t m,
cs_mesh_quantities_t fvq,
int  init,
int  inc,
int  imrgra,
int  nswrgp,
int  imligp,
int  iphydp,
int  iwgrp,
int  iwarnp,
double  epsrgp,
double  climgp,
cs_real_3_t frcxt,
cs_real_t pvar,
const cs_field_bc_coeffs_t bc_coeffs,
const cs_real_t  i_visc[],
const cs_real_t  b_visc[],
cs_real_t visel,
cs_real_t i_massflux,
cs_real_t b_massflux 
)

◆ cs_get_v_slope_test()

cs_real_t * cs_get_v_slope_test ( int  f_id,
const cs_equation_param_t  eqp 
)