8.0
general documentation
cs_cdo_advection.c File Reference

Build discrete advection operators for CDO vertex-based schemes. More...

#include "cs_defs.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <assert.h>
#include <bft_mem.h>
#include "cs_cdo_bc.h"
#include "cs_flag.h"
#include "cs_property.h"
#include "cs_math.h"
#include "cs_scheme_geometry.h"
#include "cs_cdo_advection.h"
+ Include dependency graph for cs_cdo_advection.c:

Functions

static double _get_upwind_weight (double criterion)
 Compute the weight of upwinding for an upwind scheme. More...
 
static double _get_samarskii_weight (double criterion)
 Compute the weight of upwinding for an Samarskii scheme. More...
 
static double _get_sg_weight (double criterion)
 Compute the weight of upwinding for an Sharfetter-Gummel scheme. More...
 
static _upwind_weight_t * _assign_weight_func (const cs_param_advection_scheme_t scheme)
 Retrieve the function related to the kind of upwind weighting. More...
 
static short int _set_fquant (const cs_cell_mesh_t *cm, short int e, short int f, const double *tef, double *wvf)
 Retrieve the face edge id from a given cell edge id. Compute the weights related to each vertex of face from pre-computed quantities. More...
 
static void _assemble_face (const cs_cell_mesh_t *cm, const cs_face_mesh_t *fm, const cs_sdm_t *af, cs_sdm_t *ac)
 Assemble a face matrix into a cell matrix. More...
 
static void _build_cell_epcd_upw (const cs_cell_mesh_t *cm, _upwind_weight_t *get_weight, const cs_real_t fluxes[], const cs_real_t upwcoef[], cs_sdm_t *adv)
 Define the local convection operator between primal vertices and dual faces. (Conservative formulation and Upwind flux) More...
 
static void _build_cell_epcd_cen (const cs_cell_mesh_t *cm, const cs_real_t fluxes[], cs_sdm_t *adv)
 Define the local convection operator between primal vertices and dual faces. (Non-conservative formulation and centered flux) More...
 
static void _build_cell_epcd_mcu (const cs_cell_mesh_t *cm, const cs_real_t upwp, const cs_real_t fluxes[], cs_sdm_t *adv)
 Define the local convection operator between primal edges and dual cells. (Non-conservative formulation and mixed centered/upwind) More...
 
static void _build_cell_vpfd_upw (const cs_cell_mesh_t *cm, _upwind_weight_t *get_weight, const cs_real_t fluxes[], const cs_real_t upwcoef[], cs_sdm_t *adv)
 Define the local convection operator between primal vertices and dual faces. (Conservative formulation and Upwind flux) More...
 
static void _build_cell_vpfd_cen (const cs_cell_mesh_t *cm, const cs_real_t fluxes[], cs_sdm_t *adv)
 Define the local convection operator between primal vertices and dual faces. (Conservative formulation and centered flux) More...
 
static void _build_cell_vpfd_mcu (const cs_cell_mesh_t *cm, const cs_real_t upwp, const cs_real_t fluxes[], cs_sdm_t *adv)
 Define the local convection operator between primal vertices and dual faces. (Conservative formulation and mixed centered/upwind) More...
 
static void _update_vcb_system_with_bc (const cs_real_t beta_nf, const cs_face_mesh_t *fm, const cs_sdm_t *matf, cs_cell_sys_t *csys)
 Update the cellwise system with the contributions arising from the boundary conditions. More...
 
static void _vcb_cellwise_consistent_part (const cs_nvec3_t adv_cell, const cs_cell_mesh_t *cm, const cs_face_mesh_t *fm, cs_cell_builder_t *cb)
 Compute the consistent part of the convection operator attached to a cell with a CDO vertex+cell-based scheme when the advection is considered as constant inside a cell. More...
 
static void _vcb_consistent_part (const cs_adv_field_t *adv_field, const cs_nvec3_t adv_cell, const cs_cell_mesh_t *cm, const cs_face_mesh_t *fm, cs_real_t t_eval, cs_cell_builder_t *cb)
 Compute the consistent part of the convection operator attached to a cell with a CDO vertex+cell-based scheme when the advection field is not considered constant inside the current cell. More...
 
static void _vcb_stabilization_part1 (const cs_cell_mesh_t *cm, const cs_face_mesh_t *fm, const double stab_coef, cs_cell_builder_t *cb)
 Compute the stabilization part of the convection operator attached to a cell with a CDO vertex+cell-based scheme (inside pfc) More...
 
static void _vcb_stabilization_part2 (const cs_cell_mesh_t *cm, const double stab_coef, cs_cell_builder_t *cb)
 Compute the stabilization part of the convection operator attached to a cell with a CDO vertex+cell-based scheme (between pfc) More...
 
void cs_cdo_advection_set_cip_coef (double new_value)
 Set the value of the stabilization coefficient used in CIP scheme. More...
 
double cs_cdo_advection_get_cip_coef (void)
 Get the value of the stabilization coefficient used in CIP scheme. More...
 
void cs_cdofb_advection_open_default (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, void *input, cs_cell_builder_t *cb)
 Perform preprocessing such as the computation of the advection flux at the expected location in order to be able to build the advection matrix. Follow the prototype given by cs_cdofb_adv_open_hook_t Default case. More...
 
void cs_cdofb_advection_close_default_scal (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
 Operation done after the matrix related to the advection term has been defined. Follow the prototype given by cs_cdofb_adv_close_hook_t Default scalar-valued case. More...
 
void cs_cdofb_advection_close_default_vect (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
 Operation done after the matrix related to the advection term has been defined. Follow the prototype given by cs_cdofb_adv_close_hook_t Default vector-valued case. More...
 
void cs_cdofb_advection_close_exp_none_scal (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
 Operation done after the matrix related to the advection term has been defined. Follow the prototype given by cs_cdofb_adv_close_hook_t Explicit treatment without extrapolation for scalar-valued DoFs. More...
 
void cs_cdofb_advection_close_exp_none_vect (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
 Operation done after the matrix related to the advection term has been defined. Follow the prototype given by cs_cdofb_adv_close_hook_t Explicit treatment without extrapolation for vector-valued DoFs. More...
 
void cs_cdofb_advection_no_diffusion (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cdofb_adv_scheme_t *scheme_func, cs_cell_builder_t *cb)
 Build the cellwise advection operator for CDO-Fb schemes The local matrix related to this operator is stored in cb->loc. More...
 
void cs_cdofb_advection (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cdofb_adv_scheme_t *scheme_func, cs_cell_builder_t *cb)
 Main function to build the cellwise advection operator for CDO face-based schemes. The local matrix related to this operator is stored in cb->loc. More...
 
void cs_cdofb_advection_upwnoc (int dim, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
 Compute the convection operator attached to a cell with a CDO face-based scheme. More...
 
void cs_cdofb_advection_upwcsv (int dim, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
 Compute the convection operator attached to a cell with a CDO face-based scheme. More...
 
void cs_cdofb_advection_cennoc (int dim, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
 Compute the convection operator attached to a cell with a CDO face-based scheme. More...
 
void cs_cdofb_advection_cencsv (int dim, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
 Compute the convection operator attached to a cell with a CDO face-based scheme. More...
 
void cs_cdo_advection_vb_upwcsv_wpty (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
 Compute the convection operator attached to a cell with a CDO vertex-based scheme with an upwind scheme and a conservative formulation. The portion of upwinding relies on an evaluation of the weigth associated to the given property The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t. More...
 
void cs_cdo_advection_vb_upwcsv (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
 Compute the convection operator attached to a cell with a CDO vertex-based scheme without diffusion and an upwind scheme and a conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t. More...
 
void cs_cdo_advection_vb_cencsv (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
 Compute the convection operator attached to a cell with a CDO vertex-based scheme when a centered scheme and a conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t. More...
 
void cs_cdo_advection_vb_mcucsv (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
 Compute the convection operator attached to a cell with a CDO vertex-based scheme when a mixed centered/upwind scheme with a conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t. More...
 
void cs_cdo_advection_vb_mcunoc (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
 Compute the convection operator attached to a cell with a CDO vertex-based scheme when a mixed centered/upwind scheme with a non-conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t. More...
 
void cs_cdo_advection_vb_upwnoc_wpty (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
 Compute the convection operator attached to a cell with a CDO vertex-based scheme with an upwind scheme and a conservative formulation. The portion of upwinding relies on an evaluation of the weigth associated to the given property. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t. More...
 
void cs_cdo_advection_vb_upwnoc (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
 Compute the convection operator attached to a cell with a CDO vertex-based scheme without diffusion when an upwind scheme and a conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t. More...
 
void cs_cdo_advection_vb_cennoc (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
 Compute the convection operator attached to a cell with a CDO vertex-based scheme when a centered scheme and a non-conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t. More...
 
void cs_cdo_advection_vcb_cw_cst (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
 Compute the convection operator attached to a cell with a CDO vertex+cell-based scheme when the advection field is cellwise constant. More...
 
void cs_cdo_advection_vcb (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
 Compute the convection operator attached to a cell with a CDO vertex+cell-based scheme. More...
 
void cs_cdo_advection_vb_bc (const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, cs_real_t t_eval, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Compute the BC contribution for the convection operator. More...
 
void cs_cdo_advection_vcb_bc (const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, cs_real_t t_eval, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Compute the BC contribution for the convection operator with CDO V+C schemes. More...
 
void cs_cdo_advection_cell_upwind_coef (const cs_cdo_quantities_t *cdoq, cs_param_advection_scheme_t scheme, cs_real_t coefval[])
 Compute the value of the upwinding coefficient in each cell knowing the related Peclet number. More...
 

Detailed Description

Build discrete advection operators for CDO vertex-based schemes.

Function Documentation

◆ _assemble_face()

static void _assemble_face ( const cs_cell_mesh_t cm,
const cs_face_mesh_t fm,
const cs_sdm_t *  af,
cs_sdm_t *  ac 
)
static

Assemble a face matrix into a cell matrix.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]fmpointer to a cs_face_mesh_t structure
[in]afpointer to a cs_sdm_t structure related to a face
[in,out]acpointer to a cs_sdm_t structure related to a cell

◆ _assign_weight_func()

static _upwind_weight_t* _assign_weight_func ( const cs_param_advection_scheme_t  scheme)
inlinestatic

Retrieve the function related to the kind of upwind weighting.

Parameters
[in]schemescheme used for discretizing the advection term
Returns
a function pointer

◆ _build_cell_epcd_cen()

static void _build_cell_epcd_cen ( const cs_cell_mesh_t cm,
const cs_real_t  fluxes[],
cs_sdm_t *  adv 
)
static

Define the local convection operator between primal vertices and dual faces. (Non-conservative formulation and centered flux)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]fluxesarray of fluxes on dual faces
[in,out]advpointer to a cs_sdm_t structure

◆ _build_cell_epcd_mcu()

static void _build_cell_epcd_mcu ( const cs_cell_mesh_t cm,
const cs_real_t  upwp,
const cs_real_t  fluxes[],
cs_sdm_t *  adv 
)
static

Define the local convection operator between primal edges and dual cells. (Non-conservative formulation and mixed centered/upwind)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]upwpportion of upwinding to apply
[in]fluxesarray of fluxes on dual faces
[in,out]advpointer to a cs_sdm_t structure

◆ _build_cell_epcd_upw()

static void _build_cell_epcd_upw ( const cs_cell_mesh_t cm,
_upwind_weight_t *  get_weight,
const cs_real_t  fluxes[],
const cs_real_t  upwcoef[],
cs_sdm_t *  adv 
)
static

Define the local convection operator between primal vertices and dual faces. (Conservative formulation and Upwind flux)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]get_weightpointer to a function for evaluating upw. weight
[in]fluxesarray of fluxes on dual faces
[in]upwcoefarray of coefficient to the weight the upwinding
[in,out]advpointer to a cs_sdm_t structure

◆ _build_cell_vpfd_cen()

static void _build_cell_vpfd_cen ( const cs_cell_mesh_t cm,
const cs_real_t  fluxes[],
cs_sdm_t *  adv 
)
static

Define the local convection operator between primal vertices and dual faces. (Conservative formulation and centered flux)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]fluxesarray of fluxes on dual faces
[in,out]advpointer to a cs_sdm_t structure

◆ _build_cell_vpfd_mcu()

static void _build_cell_vpfd_mcu ( const cs_cell_mesh_t cm,
const cs_real_t  upwp,
const cs_real_t  fluxes[],
cs_sdm_t *  adv 
)
static

Define the local convection operator between primal vertices and dual faces. (Conservative formulation and mixed centered/upwind)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]upwpportion of upwinding to apply
[in]fluxesarray of fluxes on dual faces
[in,out]advpointer to a cs_sdm_t structure

◆ _build_cell_vpfd_upw()

static void _build_cell_vpfd_upw ( const cs_cell_mesh_t cm,
_upwind_weight_t *  get_weight,
const cs_real_t  fluxes[],
const cs_real_t  upwcoef[],
cs_sdm_t *  adv 
)
static

Define the local convection operator between primal vertices and dual faces. (Conservative formulation and Upwind flux)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]get_weightpointer to a function for evaluating upw. weight
[in]fluxesarray of fluxes on dual faces
[in]upwcoefarray of coefficient to the weight the upwinding
[in,out]advpointer to a cs_sdm_t structure

◆ _get_samarskii_weight()

static double _get_samarskii_weight ( double  criterion)
inlinestatic

Compute the weight of upwinding for an Samarskii scheme.

Parameters
[in]criteriondot product between advection and normal vectors or estimation of a local Peclet number
Returns
the weight value

◆ _get_sg_weight()

static double _get_sg_weight ( double  criterion)
inlinestatic

Compute the weight of upwinding for an Sharfetter-Gummel scheme.

Parameters
[in]criteriondot product between advection and normal vectors or estimation of a local Peclet number
Returns
the weight value

◆ _get_upwind_weight()

static double _get_upwind_weight ( double  criterion)
inlinestatic

Compute the weight of upwinding for an upwind scheme.

Parameters
[in]criteriondot product between advection and normal vectors or estimation of a local Peclet number
Returns
the weight value

◆ _set_fquant()

static short int _set_fquant ( const cs_cell_mesh_t cm,
short int  e,
short int  f,
const double *  tef,
double *  wvf 
)
inlinestatic

Retrieve the face edge id from a given cell edge id. Compute the weights related to each vertex of face from pre-computed quantities.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]eedge id in the cell numbering
[in]fface id in the cell numbering
[in]tefvalue of the area of the triangles tef
[in,out]wvfweights of vertices for the current face
Returns
the face edge id

◆ _update_vcb_system_with_bc()

static void _update_vcb_system_with_bc ( const cs_real_t  beta_nf,
const cs_face_mesh_t fm,
const cs_sdm_t *  matf,
cs_cell_sys_t csys 
)
static

Update the cellwise system with the contributions arising from the boundary conditions.

Parameters
[in]beta_nfadvection field coefficient
[in]fmpointer to a cs_face_mesh_t structure
[in]matfpointer to a local dense matrix related to a face
[in,out]csyspointer to a cs_cell_sys_t structure

◆ _vcb_cellwise_consistent_part()

static void _vcb_cellwise_consistent_part ( const cs_nvec3_t  adv_cell,
const cs_cell_mesh_t cm,
const cs_face_mesh_t fm,
cs_cell_builder_t cb 
)
static

Compute the consistent part of the convection operator attached to a cell with a CDO vertex+cell-based scheme when the advection is considered as constant inside a cell.

Parameters
[in]adv_cellconstant vector field inside the current cell
[in]cmpointer to a cs_cell_mesh_t structure
[in]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ _vcb_consistent_part()

static void _vcb_consistent_part ( const cs_adv_field_t adv_field,
const cs_nvec3_t  adv_cell,
const cs_cell_mesh_t cm,
const cs_face_mesh_t fm,
cs_real_t  t_eval,
cs_cell_builder_t cb 
)
static

Compute the consistent part of the convection operator attached to a cell with a CDO vertex+cell-based scheme when the advection field is not considered constant inside the current cell.

Parameters
[in]adv_fieldpointer to a cs_adv_field_t structure
[in]adv_cellconstant vector field inside the current cell
[in]cmpointer to a cs_cell_mesh_t structure
[in]fmpointer to a cs_face_mesh_t structure
[in]t_evaltime at which one evaluates the advection field
[in,out]cbpointer to a cs_cell_builder_t structure

◆ _vcb_stabilization_part1()

static void _vcb_stabilization_part1 ( const cs_cell_mesh_t cm,
const cs_face_mesh_t fm,
const double  stab_coef,
cs_cell_builder_t cb 
)
static

Compute the stabilization part of the convection operator attached to a cell with a CDO vertex+cell-based scheme (inside pfc)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]fmpointer to a cs_face_mesh_t structure
[in]stab_coefdefault value of the stabilization coefficient
[in,out]cbpointer to a cs_cell_builder_t structure

◆ _vcb_stabilization_part2()

static void _vcb_stabilization_part2 ( const cs_cell_mesh_t cm,
const double  stab_coef,
cs_cell_builder_t cb 
)
static

Compute the stabilization part of the convection operator attached to a cell with a CDO vertex+cell-based scheme (between pfc)

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]stab_coefvalue of the stabilization coefficient
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdo_advection_cell_upwind_coef()

void cs_cdo_advection_cell_upwind_coef ( const cs_cdo_quantities_t cdoq,
cs_param_advection_scheme_t  scheme,
cs_real_t  coefval[] 
)

Compute the value of the upwinding coefficient in each cell knowing the related Peclet number.

Parameters
[in]cdoqpointer to the cdo quantities structure
[in]schemetype of scheme used for the advection term
[in,out]coefvalpointer to the pointer of real numbers to fill in: Peclet number in each cell out: value of the upwind coefficient

◆ cs_cdo_advection_get_cip_coef()

double cs_cdo_advection_get_cip_coef ( void  )

Get the value of the stabilization coefficient used in CIP scheme.

Returns
the value the stabilization coefficient

◆ cs_cdo_advection_set_cip_coef()

void cs_cdo_advection_set_cip_coef ( double  new_value)

Set the value of the stabilization coefficient used in CIP scheme.

(DOXYGEN_SHOULD_SKIP_THIS)

Parameters
[in]new_valuevalue of the stabilization coefficient

◆ cs_cdo_advection_vb_bc()

void cs_cdo_advection_vb_bc ( const cs_cell_mesh_t cm,
const cs_equation_param_t eqp,
cs_real_t  t_eval,
cs_face_mesh_t fm,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Compute the BC contribution for the convection operator.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]eqppointer to a cs_equation_param_t structure
[in]t_evaltime at which one evaluates the advection field
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a convection builder structure
[in,out]csyscell-wise structure storing the local system

◆ cs_cdo_advection_vb_cencsv()

void cs_cdo_advection_vb_cencsv ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_property_data_t diff_pty,
cs_face_mesh_t fm,
cs_cell_builder_t cb 
)

Compute the convection operator attached to a cell with a CDO vertex-based scheme when a centered scheme and a conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]diff_ptypointer to a cs_property_data_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdo_advection_vb_cennoc()

void cs_cdo_advection_vb_cennoc ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_property_data_t diff_pty,
cs_face_mesh_t fm,
cs_cell_builder_t cb 
)

Compute the convection operator attached to a cell with a CDO vertex-based scheme when a centered scheme and a non-conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]diff_ptypointer to a cs_property_data_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdo_advection_vb_mcucsv()

void cs_cdo_advection_vb_mcucsv ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_property_data_t diff_pty,
cs_face_mesh_t fm,
cs_cell_builder_t cb 
)

Compute the convection operator attached to a cell with a CDO vertex-based scheme when a mixed centered/upwind scheme with a conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]diff_ptypointer to a cs_property_data_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdo_advection_vb_mcunoc()

void cs_cdo_advection_vb_mcunoc ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_property_data_t diff_pty,
cs_face_mesh_t fm,
cs_cell_builder_t cb 
)

Compute the convection operator attached to a cell with a CDO vertex-based scheme when a mixed centered/upwind scheme with a non-conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]diff_ptypointer to a cs_property_data_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdo_advection_vb_upwcsv()

void cs_cdo_advection_vb_upwcsv ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_property_data_t diff_pty,
cs_face_mesh_t fm,
cs_cell_builder_t cb 
)

Compute the convection operator attached to a cell with a CDO vertex-based scheme without diffusion and an upwind scheme and a conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]diff_ptypointer to a cs_property_data_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdo_advection_vb_upwcsv_wpty()

void cs_cdo_advection_vb_upwcsv_wpty ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_property_data_t diff_pty,
cs_face_mesh_t fm,
cs_cell_builder_t cb 
)

Compute the convection operator attached to a cell with a CDO vertex-based scheme with an upwind scheme and a conservative formulation. The portion of upwinding relies on an evaluation of the weigth associated to the given property The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]diff_ptypointer to a cs_property_data_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdo_advection_vb_upwnoc()

void cs_cdo_advection_vb_upwnoc ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_property_data_t diff_pty,
cs_face_mesh_t fm,
cs_cell_builder_t cb 
)

Compute the convection operator attached to a cell with a CDO vertex-based scheme without diffusion when an upwind scheme and a conservative formulation is used. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]diff_ptypointer to a cs_property_data_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdo_advection_vb_upwnoc_wpty()

void cs_cdo_advection_vb_upwnoc_wpty ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_property_data_t diff_pty,
cs_face_mesh_t fm,
cs_cell_builder_t cb 
)

Compute the convection operator attached to a cell with a CDO vertex-based scheme with an upwind scheme and a conservative formulation. The portion of upwinding relies on an evaluation of the weigth associated to the given property. The local matrix related to this operator is stored in cb->loc Predefined prototype to match the function pointer cs_cdovb_advection_t.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]diff_ptypointer to a cs_property_data_t structure
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdo_advection_vcb()

void cs_cdo_advection_vcb ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_property_data_t diff_pty,
cs_face_mesh_t fm,
cs_cell_builder_t cb 
)

Compute the convection operator attached to a cell with a CDO vertex+cell-based scheme.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]diff_ptypointer to the property associated to diffusion
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdo_advection_vcb_bc()

void cs_cdo_advection_vcb_bc ( const cs_cell_mesh_t cm,
const cs_equation_param_t eqp,
cs_real_t  t_eval,
cs_face_mesh_t fm,
cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

Compute the BC contribution for the convection operator with CDO V+C schemes.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]eqppointer to a cs_equation_param_t structure
[in]t_evaltime at which one evaluates the advection field
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]csyscell-wise structure storing the local system

◆ cs_cdo_advection_vcb_cw_cst()

void cs_cdo_advection_vcb_cw_cst ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_property_data_t diff_pty,
cs_face_mesh_t fm,
cs_cell_builder_t cb 
)

Compute the convection operator attached to a cell with a CDO vertex+cell-based scheme when the advection field is cellwise constant.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]diff_ptypointer to the property associated to diffusion
[in,out]fmpointer to a cs_face_mesh_t structure
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdofb_advection()

void cs_cdofb_advection ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_cell_sys_t csys,
cs_cdofb_adv_scheme_t scheme_func,
cs_cell_builder_t cb 
)

Main function to build the cellwise advection operator for CDO face-based schemes. The local matrix related to this operator is stored in cb->loc.

One assumes that a diffusion term is present so that there is no need to perform additional checkings on the well-posedness of the operator.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]csyspointer to a cs_cell_sys_t structure
[in]scheme_funcpointer to the function building the system
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdofb_advection_cencsv()

void cs_cdofb_advection_cencsv ( int  dim,
const cs_cell_mesh_t cm,
const cs_cell_sys_t csys,
cs_cell_builder_t cb,
cs_sdm_t *  adv 
)

Compute the convection operator attached to a cell with a CDO face-based scheme.

  • conservative formulation div(beta )
  • centered scheme Rely on the work performed during R. Milani's PhD

A scalar-valued version is built. Only the enforcement of the boundary condition depends on the variable dimension. Remark: Usually the local matrix called hereafter adv is stored in cb->loc

Parameters
[in]dimdimension of the variable (1 or 3)
[in]cmpointer to a cs_cell_mesh_t structure
[in]csyspointer to a cs_cell_sys_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to a local matrix to build

◆ cs_cdofb_advection_cennoc()

void cs_cdofb_advection_cennoc ( int  dim,
const cs_cell_mesh_t cm,
const cs_cell_sys_t csys,
cs_cell_builder_t cb,
cs_sdm_t *  adv 
)

Compute the convection operator attached to a cell with a CDO face-based scheme.

  • non-conservative formulation beta.grad
  • centered scheme Rely on the work performed during R. Milani's PhD

A scalar-valued version is built. Only the enforcement of the boundary condition depends on the variable dimension. Remark: Usually the local matrix called hereafter adv is stored in cb->loc

Parameters
[in]dimdimension of the variable (1 or 3)
[in]cmpointer to a cs_cell_mesh_t structure
[in]csyspointer to a cs_cell_sys_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to a local matrix to build

◆ cs_cdofb_advection_close_default_scal()

void cs_cdofb_advection_close_default_scal ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_cell_sys_t csys,
cs_cell_builder_t cb,
cs_sdm_t *  adv 
)

Operation done after the matrix related to the advection term has been defined. Follow the prototype given by cs_cdofb_adv_close_hook_t Default scalar-valued case.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]csyspointer to a cs_cell_sys_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to the local advection matrix

◆ cs_cdofb_advection_close_default_vect()

void cs_cdofb_advection_close_default_vect ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_cell_sys_t csys,
cs_cell_builder_t cb,
cs_sdm_t *  adv 
)

Operation done after the matrix related to the advection term has been defined. Follow the prototype given by cs_cdofb_adv_close_hook_t Default vector-valued case.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]csyspointer to a cs_cell_sys_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to the local advection matrix

◆ cs_cdofb_advection_close_exp_none_scal()

void cs_cdofb_advection_close_exp_none_scal ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_cell_sys_t csys,
cs_cell_builder_t cb,
cs_sdm_t *  adv 
)

Operation done after the matrix related to the advection term has been defined. Follow the prototype given by cs_cdofb_adv_close_hook_t Explicit treatment without extrapolation for scalar-valued DoFs.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]csyspointer to a cs_cell_sys_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to the local advection matrix

◆ cs_cdofb_advection_close_exp_none_vect()

void cs_cdofb_advection_close_exp_none_vect ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
cs_cell_sys_t csys,
cs_cell_builder_t cb,
cs_sdm_t *  adv 
)

Operation done after the matrix related to the advection term has been defined. Follow the prototype given by cs_cdofb_adv_close_hook_t Explicit treatment without extrapolation for vector-valued DoFs.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in,out]csyspointer to a cs_cell_sys_t structure
[in,out]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to the local advection matrix

◆ cs_cdofb_advection_no_diffusion()

void cs_cdofb_advection_no_diffusion ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_cell_sys_t csys,
cs_cdofb_adv_scheme_t scheme_func,
cs_cell_builder_t cb 
)

Build the cellwise advection operator for CDO-Fb schemes The local matrix related to this operator is stored in cb->loc.

Main function to build the cellwise advection operator for CDO-Fb schemes The local matrix related to this operator is stored in cb->loc.

Case of an advection term without a diffusion operator. In this situation, a numerical issue may arise if an internal or a border face is such that there is no advective flux. A specil treatment is performed to tackle this issue.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]csyspointer to a cs_cell_sys_t structure
[in]scheme_funcpointer to the function building the system
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdofb_advection_open_default()

void cs_cdofb_advection_open_default ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_cell_sys_t csys,
void *  input,
cs_cell_builder_t cb 
)

Perform preprocessing such as the computation of the advection flux at the expected location in order to be able to build the advection matrix. Follow the prototype given by cs_cdofb_adv_open_hook_t Default case.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]csyspointer to a cs_cell_sys_t structure
[in,out]inputNULL or pointer to a structure cast on-the-fly
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_cdofb_advection_upwcsv()

void cs_cdofb_advection_upwcsv ( int  dim,
const cs_cell_mesh_t cm,
const cs_cell_sys_t csys,
cs_cell_builder_t cb,
cs_sdm_t *  adv 
)

Compute the convection operator attached to a cell with a CDO face-based scheme.

  • conservative formulation $ \nabla\cdot(\beta ) $
  • upwind scheme Rely on the work performed during R. Milani's PhD

A scalar-valued version is built. Only the enforcement of the boundary condition depends on the variable dimension. Remark: Usually the local matrix called hereafter adv is stored in cb->loc

Parameters
[in]dimdimension of the variable (1 or 3)
[in]cmpointer to a cs_cell_mesh_t structure
[in]csyspointer to a cs_cell_sys_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to a local matrix to build

◆ cs_cdofb_advection_upwnoc()

void cs_cdofb_advection_upwnoc ( int  dim,
const cs_cell_mesh_t cm,
const cs_cell_sys_t csys,
cs_cell_builder_t cb,
cs_sdm_t *  adv 
)

Compute the convection operator attached to a cell with a CDO face-based scheme.

  • non-conservative formulation $ \vec{beta} \cdot \nabla $
  • upwind scheme Rely on the work performed during R. Milani's PhD

A scalar-valued version is built. Only the enforcement of the boundary condition depends on the variable dimension. Remark: Usually the local matrix called hereafter adv is stored in cb->loc

Parameters
[in]dimdimension of the variable (1 or 3)
[in]cmpointer to a cs_cell_mesh_t structure
[in]csyspointer to a cs_cell_sys_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to a local matrix to build