8.3
general documentation
cs_macfb_advection.h File Reference
#include "cs_advection_field.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_local.h"
#include "cs_cdo_quantities.h"
#include "cs_equation_param.h"
#include "cs_macfb_builder.h"
#include "cs_property.h"
+ Include dependency graph for cs_macfb_advection.h:

Go to the source code of this file.

Typedefs

typedef void() cs_macfb_adv_open_hook_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, 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. More...
 
typedef void() cs_macfb_adv_scheme_t(const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_cell_builder_t *cb, cs_sdm_t *adv, cs_real_t *rhs)
 Define the local convection operator in MAC-Fb schemes. Case of an operator that should be assemble into a matrix. Boundary conditions are also handled in this function. More...
 
typedef void() cs_macfb_adv_build_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_macfb_adv_scheme_t *scheme_func, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
 Build the cellwise advection operator for MAC-Fb schemes The local matrix related to this operator is stored in cb->loc. More...
 
typedef void() cs_macfb_adv_close_hook_t(const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, const cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Operation done after the matrix related to the advection term has been defined. More...
 

Functions

void cs_macfb_advection_open_default (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, 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_macfb_adv_open_hook_t Default case. More...
 
void cs_macfb_advection_close_default_vect (const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, const cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Operation done after the matrix related to the advection term has been defined. Follow the prototype given by cs_macfb_adv_close_hook_t Default vector-valued case. More...
 
void cs_macfb_advection_close_exp_none_vect (const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, const cs_cell_builder_t *cb, cs_cell_sys_t *csys)
 Operation done after the matrix related to the advection term has been defined. Follow the prototype given by cs_macfb_adv_close_hook_t Explicit treatment without extrapolation for vector-valued DoFs. More...
 
void cs_macfb_advection_no_diffusion (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_macfb_adv_scheme_t *scheme_func, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
 Main function to build the cellwise advection operator for MAC-Fb schemes The local matrix related to this operator is stored in cb->loc. More...
 
void cs_macfb_advection (const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_macfb_adv_scheme_t *scheme_func, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
 Main function to build the cellwise advection operator for MAC face-based schemes. The local matrix related to this operator is stored in cb->loc. More...
 
void cs_macfb_advection_upwnoc (const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_cell_builder_t *cb, cs_sdm_t *adv, cs_real_t *rhs)
 Compute the convection operator attached to a cell with a MAC face-based scheme. More...
 
void cs_macfb_advection_upwcsv (const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_cell_builder_t *cb, cs_sdm_t *adv, cs_real_t *rhs)
 Compute the convection operator attached to a cell with a MAC face-based scheme. More...
 
void cs_macfb_advection_cennoc (const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_cell_builder_t *cb, cs_sdm_t *adv, cs_real_t *rhs)
 Compute the convection operator attached to a cell with a MAC face-based scheme. More...
 
void cs_macfb_advection_cencsv (const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_cell_builder_t *cb, cs_sdm_t *adv, cs_real_t *rhs)
 Compute the convection operator attached to a cell with a MAC face-based scheme. More...
 

Typedef Documentation

◆ cs_macfb_adv_build_t

typedef void() cs_macfb_adv_build_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_macfb_adv_scheme_t *scheme_func, cs_cell_sys_t *csys, cs_cell_builder_t *cb)

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

This pointer of function manages how is build the advection term in a cell and it relies on the lower-level function cs_macfb_adv_scheme_t

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]scheme_funcfunction pointer to the scheme definition
[in,out]csyspointer to a cellwise view of the system
[in,out]cbpointer to a cellwise builder

◆ cs_macfb_adv_close_hook_t

typedef void() cs_macfb_adv_close_hook_t(const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, const cs_cell_builder_t *cb, cs_cell_sys_t *csys)

Operation done after the matrix related to the advection term has been defined.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]csyspointer to a cs_cell_sys_t structure

◆ cs_macfb_adv_open_hook_t

typedef void() cs_macfb_adv_open_hook_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, 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.

Parameters
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_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_macfb_adv_scheme_t

typedef void() cs_macfb_adv_scheme_t(const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_cell_builder_t *cb, cs_sdm_t *adv, cs_real_t *rhs)

Define the local convection operator in MAC-Fb schemes. Case of an operator that should be assemble into a matrix. Boundary conditions are also handled in this function.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to a local matrix to build
[in,out]rhspointer to a cs_real_t array. It is filled inside the function. Have to preallocated.

Function Documentation

◆ cs_macfb_advection()

void cs_macfb_advection ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_macfb_builder_t macb,
cs_macfb_adv_scheme_t scheme_func,
cs_cell_sys_t csys,
cs_cell_builder_t cb 
)

Main function to build the cellwise advection operator for MAC 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]macbpointer to a cs_macfb_builder_t structure
[in]scheme_funcpointer to the function building the system
[in,out]csyspointer to a cellwise view of the system
[in,out]cbpointer to a cellwise builder

◆ cs_macfb_advection_cencsv()

void cs_macfb_advection_cencsv ( const cs_cell_mesh_t cm,
const cs_macfb_builder_t macb,
cs_cell_builder_t cb,
cs_sdm_t *  adv,
cs_real_t rhs 
)

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

  • conservative formulation $ \vec{beta} \cdot \nabla u $
  • centered scheme
Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to a local matrix to build
[in,out]rhspointer to a cs_real_t array. It is filled inside the function. Have to preallocated.

◆ cs_macfb_advection_cennoc()

void cs_macfb_advection_cennoc ( const cs_cell_mesh_t cm,
const cs_macfb_builder_t macb,
cs_cell_builder_t cb,
cs_sdm_t *  adv,
cs_real_t rhs 
)

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

  • non-conservative formulation beta.grad
  • centered scheme
Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to a local matrix to build
[in,out]rhspointer to a cs_real_t array. It is filled inside the function. Have to preallocated.
  • non-conservative formulation $ \vec{beta} \cdot \nabla u $
  • centered scheme
Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to a local matrix to build
[in,out]rhspointer to a cs_real_t array. It is filled inside the function. Have to preallocated.

◆ cs_macfb_advection_close_default_vect()

void cs_macfb_advection_close_default_vect ( const cs_cell_mesh_t cm,
const cs_macfb_builder_t macb,
const cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

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

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]csyspointer to a cs_cell_sys_t structure

◆ cs_macfb_advection_close_exp_none_vect()

void cs_macfb_advection_close_exp_none_vect ( const cs_cell_mesh_t cm,
const cs_macfb_builder_t macb,
const cs_cell_builder_t cb,
cs_cell_sys_t csys 
)

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

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]csyspointer to a cs_cell_sys_t structure

◆ cs_macfb_advection_no_diffusion()

void cs_macfb_advection_no_diffusion ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_macfb_builder_t macb,
cs_macfb_adv_scheme_t scheme_func,
cs_cell_sys_t csys,
cs_cell_builder_t cb 
)

Main function to build the cellwise advection operator for MAC-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 special 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]macbpointer to a cs_macfb_builder_t structure
[in]scheme_funcpointer to the function building the system
[in,out]csyspointer to a cellwise view of the system
[in,out]cbpointer to a cellwise builder

Main function to build the cellwise advection operator for MAC-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 special 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]macbpointer to a cs_macfb_builder_t structure
[in]scheme_funcpointer to the function building the system
[in,out]csyspointer to a cellwise view of the system
[in,out]cbpointer to a cellwise builder

◆ cs_macfb_advection_open_default()

void cs_macfb_advection_open_default ( const cs_equation_param_t eqp,
const cs_cell_mesh_t cm,
const cs_macfb_builder_t macb,
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_macfb_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]macbpointer to a cs_macfb_builder_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
[in]eqppointer to a cs_equation_param_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]csyspointer to a cs_cell_sys_t structure
[in,out]inputnullptr or pointer to a structure cast on-the-fly
[in,out]cbpointer to a cs_cell_builder_t structure

◆ cs_macfb_advection_upwcsv()

void cs_macfb_advection_upwcsv ( const cs_cell_mesh_t cm,
const cs_macfb_builder_t macb,
cs_cell_builder_t cb,
cs_sdm_t *  adv,
cs_real_t rhs 
)

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

  • conservative formulation $ \nabla\cdot(\beta \otimes u) $
  • upwind scheme
Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to a local matrix to build
[in,out]rhspointer to a cs_real_t array. It is filled inside the function. Have to preallocated.
  • conservative formulation $ \vec{beta} \cdot \nabla u $
  • upwind scheme
Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to a local matrix to build
[in,out]rhspointer to a cs_real_t array. It is filled inside the function. Have to preallocated.

◆ cs_macfb_advection_upwnoc()

void cs_macfb_advection_upwnoc ( const cs_cell_mesh_t cm,
const cs_macfb_builder_t macb,
cs_cell_builder_t cb,
cs_sdm_t *  adv,
cs_real_t rhs 
)

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

  • non-conservative formulation $ \vec{beta} \cdot \nabla u $
  • upwind scheme
Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]macbpointer to a cs_macfb_builder_t structure
[in]cbpointer to a cs_cell_builder_t structure
[in,out]advpointer to a local matrix to build
[in,out]rhspointer to a cs_real_t array. It is filled inside the function. Have to preallocated.