src/alge/cs_convection_diffusion_balance.c File Reference

| programmer's documentation

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
cs_convection_diffusion_balance.c File Reference
`#include "cs_defs.h"`
`#include <assert.h>`
`#include <errno.h>`
`#include <stdio.h>`
`#include <stdarg.h>`
`#include <string.h>`
`#include <math.h>`
`#include <float.h>`
`#include "bft_error.h"`
`#include "bft_mem.h"`
`#include "bft_printf.h"`
`#include "cs_blas.h"`
`#include "cs_halo.h"`
`#include "cs_halo_perio.h"`
`#include "cs_log.h"`
`#include "cs_mesh.h"`
`#include "cs_field.h"`
`#include "cs_gradient.h"`
`#include "cs_gradient_perio.h"`
`#include "cs_ext_neighborhood.h"`
`#include "cs_mesh_quantities.h"`
`#include "cs_parameters.h"`
`#include "cs_prototypes.h"`
`#include "cs_timer.h"`
`#include "cs_convection_diffusion_balance.h"`
Include dependency graph for cs_convection_diffusion_balance.c:

## Macros
#define | THR_MIN 128

## Functions
void | bilsc2 (const cs_int_t *const idtvar, const cs_int_t *const f_id, const cs_int_t *const iconvp, const cs_int_t *const idiffp, const cs_int_t *const nswrgp, const cs_int_t *const imligp, const cs_int_t *const ircflp, const cs_int_t *const ischcp, const cs_int_t *const isstpp, const cs_int_t *const icvflb, const cs_int_t *const inc, const cs_int_t *const imrgra, const cs_int_t *const iccocg, const cs_int_t *const ifaccp, const cs_int_t *const iwarnp, const cs_real_t *const blencp, const cs_real_t *const epsrgp, const cs_real_t *const climgp, const cs_real_t *const extrap, const cs_real_t *const relaxp, const cs_real_t *const thetap, cs_real_t pvar[], const cs_real_t pvara[], const cs_int_t bc_type[], const cs_int_t icvfli[], const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], 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[])
void | cs_convection_diffusion_scalar (int idtvar, int f_id, int iconvp, int idiffp, int nswrgp, int imligp, int ircflp, int ischcp, int isstpp, int icvflb, int inc, int imrgra, int iccocg, int ifaccp, int iwarnp, double blencp, double epsrgp, double climgp, double extrap, double relaxp, double thetap, cs_real_t *restrict pvar, const cs_real_t *restrict pvara, const cs_int_t bc_type[], const cs_int_t icvfli[], const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], 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 *restrict rhs)
| This function adds the explicit part of the convection/diffusion terms of a standard transport equation of a scalar field . More...

## Macro Definition Documentation

#define THR_MIN 128

## Function Documentation

void bilsc2 | ( | const cs_int_t *const | idtvar,
|  | const cs_int_t *const | f_id,
|  | const cs_int_t *const | iconvp,
|  | const cs_int_t *const | idiffp,
|  | const cs_int_t *const | nswrgp,
|  | const cs_int_t *const | imligp,
|  | const cs_int_t *const | ircflp,
|  | const cs_int_t *const | ischcp,
|  | const cs_int_t *const | isstpp,
|  | const cs_int_t *const | icvflb,
|  | const cs_int_t *const | inc,
|  | const cs_int_t *const | imrgra,
|  | const cs_int_t *const | iccocg,
|  | const cs_int_t *const | ifaccp,
|  | const cs_int_t *const | iwarnp,
|  | const cs_real_t *const | blencp,
|  | const cs_real_t *const | epsrgp,
|  | const cs_real_t *const | climgp,
|  | const cs_real_t *const | extrap,
|  | const cs_real_t *const | relaxp,
|  | const cs_real_t *const | thetap,
|  | cs_real_t | pvar[],
|  | const cs_real_t | pvara[],
|  | const cs_int_t | bc_type[],
|  | const cs_int_t | icvfli[],
|  | const cs_real_t | coefap[],
|  | const cs_real_t | coefbp[],
|  | const cs_real_t | cofafp[],
|  | const cs_real_t | cofbfp[],
|  | 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[]
| ) |  |

(end ignore by Doxygen)

void cs_convection_diffusion_scalar | ( | int | idtvar,
|  | int | f_id,
|  | int | iconvp,
|  | int | idiffp,
|  | int | nswrgp,
|  | int | imligp,
|  | int | ircflp,
|  | int | ischcp,
|  | int | isstpp,
|  | int | icvflb,
|  | int | inc,
|  | int | imrgra,
|  | int | iccocg,
|  | int | ifaccp,
|  | int | iwarnp,
|  | double | blencp,
|  | double | epsrgp,
|  | double | climgp,
|  | double | extrap,
|  | double | relaxp,
|  | double | thetap,
|  | cs_real_t *restrict | pvar,
|  | const cs_real_t *restrict | pvara,
|  | const cs_int_t | bc_type[],
|  | const cs_int_t | icvfli[],
|  | const cs_real_t | coefap[],
|  | const cs_real_t | coefbp[],
|  | const cs_real_t | cofafp[],
|  | const cs_real_t | cofbfp[],
|  | 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 *restrict | rhs
| ) |  |

This function adds the explicit part of the convection/diffusion terms of a standard transport equation of a scalar field .

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

Warning:

- has already been initialized before calling bilsc2!
- mind the sign minus

Options:

- blencp = 0: upwind scheme for the advection
- blencp = 1: no upwind scheme except in the slope test
- ischcp = 0: second order
- ischcp = 1: centred

Parameters

  [in] | idtvar | indicator of the temporal scheme
  [in] | f_id | field id (or -1)
  [in] | iconvp | indicator 1 convection, 0 sinon
  [in] | idiffp | indicator 1 diffusion, 0 sinon
  [in] | nswrgp | number of reconstruction sweeps for the gradients
  [in] | imligp | clipping gradient method < 0 no clipping = 0 thank to neighbooring gradients = 1 thank to the mean gradient
  [in] | ircflp | indicator 1 flux reconstruction, 0 otherwise
  [in] | ischcp | indicator 1 centred 0 2nd order
  [in] | isstpp | indicator 1 without slope test 0 with slope test
  [in] | icvflb | global indicator of boundary convection flux 0 upwind scheme at all boundary faces 1 imposed flux at some boundary faces
  [in] | inc | indicator 0 when solving an increment 1 otherwise
  [in] | imrgra | indicator 0 iterative gradient 1 least square gradient
  [in] | iccocg | indicator 1 re-compute cocg matrix (for iterativ gradients) 0 otherwise
  [in] | ifaccp | indicator 1 coupling activated 0 coupling not activated
  [in] | iwarnp | verbosity
  [in] | blencp | fraction of upwinding
  [in] | epsrgp | relative precision for the gradient reconstruction
  [in] | climgp | clipping coeffecient for the computation of the gradient
  [in] | extrap | coefficient for extrapolation of the gradient
  [in] | relaxp | coefficient of relaxation
  [in] | thetap | weightening 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] | pvar | solved variable (current time step)
  [in] | pvara | solved variable (previous time step)
  [in] | bc_type | boundary condition type
  [in] | icvfli | boundary face indicator array of convection flux 0 upwind scheme 1 imposed flux
  [in] | coefap | boundary condition array for the variable (Explicit part)
  [in] | coefbp | boundary condition array for the variable (Impplicit part)
  [in] | cofafp | boundary condition array for the diffusion of the variable (Explicit part)
  [in] | cofbfp | boundary condition array for the diffusion of the variable (Implicit part)
  [in] | i_massflux | mass flux at interior faces
  [in] | b_massflux | mass flux at boundary faces
  [in] | i_visc | at interior faces for the r.h.s.
  [in] | b_visc | at border faces for the r.h.s.
  [in,out] | smbrp | right hand side