8.1
general documentation
cs_gradient_boundary.h File Reference
#include "cs_base.h"
#include "cs_halo.h"
#include "cs_mesh.h"
#include "cs_mesh_quantities.h"
+ Include dependency graph for cs_gradient_boundary.h:

Go to the source code of this file.

Functions

void cs_gradient_boundary_iprime_lsq_s (const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, cs_lnum_t n_faces, const cs_lnum_t *face_ids, cs_halo_type_t halo_type, double clip_coeff, const cs_real_t *bc_coeff_a, const cs_real_t *bc_coeff_b, const cs_real_t c_weight[], const cs_real_t var[], cs_real_t *restrict var_iprime)
 Compute the values of a scalar at boundary face I' positions using least-squares interpolation. More...
 
void cs_gradient_boundary_iprime_lsq_s_ani (const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, cs_lnum_t n_faces, const cs_lnum_t *face_ids, double clip_coeff, const cs_real_t *bc_coeff_a, const cs_real_t *bc_coeff_b, const cs_real_t c_weight[][6], const cs_real_t var[], cs_real_t *restrict var_iprime)
 Compute the values of a scalar at boundary face I' positions using least-squares interpolation with anisotropic weighting. More...
 
void cs_gradient_boundary_iprime_lsq_v (const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, cs_lnum_t n_faces, const cs_lnum_t *face_ids, cs_halo_type_t halo_type, double clip_coeff, const cs_real_t bc_coeff_a[][3], const cs_real_t bc_coeff_b[][3][3], const cs_real_t c_weight[], const cs_real_t var[][3], cs_real_t var_iprime[restrict][3])
 Compute the values of a vector at boundary face I' positions using least-squares interpolation. More...
 
void cs_gradient_boundary_iprime_lsq_t (const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, cs_lnum_t n_faces, const cs_lnum_t *face_ids, cs_halo_type_t halo_type, double clip_coeff, const cs_real_t bc_coeff_a[][6], const cs_real_t bc_coeff_b[][6][6], const cs_real_t c_weight[], const cs_real_t var[][6], cs_real_t var_iprime[restrict][6])
 Compute the values of a symmetric tensor at boundary face I' positions using least-squares interpolation. More...
 

Function Documentation

◆ cs_gradient_boundary_iprime_lsq_s()

void cs_gradient_boundary_iprime_lsq_s ( const cs_mesh_t m,
const cs_mesh_quantities_t fvq,
cs_lnum_t  n_faces,
const cs_lnum_t face_ids,
cs_halo_type_t  halo_type,
double  clip_coeff,
const cs_real_t bc_coeff_a,
const cs_real_t bc_coeff_b,
const cs_real_t  c_weight[],
const cs_real_t  var[],
cs_real_t *restrict  var_iprime 
)

Compute the values of a scalar at boundary face I' positions using least-squares interpolation.

This assumes ghost cell values for the variable (var) are up-to-date.

A simple limiter is applied to ensure the maximum principle is preserved (using non-reconstructed values in case of non-homogeneous Neumann conditions).

Remarks

To compute the values at I', we only need the gradient along II', so in most cases, we could simply assume a Neumann BC for a given face.

We still use the provided BC's when possible, for the following cases:

  • Given a non-uniform Dirichlet condition and a non-orthogonal mesh, the Dirichlet values at face centers (shifted by II' relative to I') can convey a portion of the information of the gradient along II'.
  • For cells with multiple boundary faces, information from faces whose normals are not orthogonal to II' can also provide a significant contribution to the normal.
Parameters
[in]mpointer to associated mesh structure
[in]fvqpointer to associated finite volume quantities
[in]n_facesnumber of faces at which to compute values
[in]face_idsids of boundary faces at which to compute values, or NULL for all
[in]halo_typehalo (cell neighborhood) type
[in]clip_coeffclipping (limiter) coefficient (no limiter if < 0)
[in]bc_coeff_aboundary condition term a, or NULL
[in]bc_coeff_bboundary condition term b, or NULL
[in]c_weightcell variable weight, or NULL
[in]varvariable values et cell centers
[out]var_iprimevariable values et face iprime locations

◆ cs_gradient_boundary_iprime_lsq_s_ani()

void cs_gradient_boundary_iprime_lsq_s_ani ( const cs_mesh_t m,
const cs_mesh_quantities_t fvq,
cs_lnum_t  n_faces,
const cs_lnum_t face_ids,
double  clip_coeff,
const cs_real_t bc_coeff_a,
const cs_real_t bc_coeff_b,
const cs_real_t  c_weight[][6],
const cs_real_t  var[],
cs_real_t *restrict  var_iprime 
)

Compute the values of a scalar at boundary face I' positions using least-squares interpolation with anisotropic weighting.

This assumes ghost cell values for the variable (var) are up-to-date.

A simple limiter is applied to ensure the maximum principle is preserved (using non-reconstructed values in case of non-homogeneous Neumann conditions).

Remarks
The same remark applies as for cs_gradient_boundary_iprime_lsq_s.
Parameters
[in]mpointer to associated mesh structure
[in]fvqpointer to associated finite volume quantities
[in]n_facesnumber of faces at which to compute values
[in]face_idsids of boundary faces at which to compute values, or NULL for all
[in]clip_coeffclipping (limiter) coefficient (no limiter if < 0)
[in]bc_coeff_aboundary condition term a, or NULL
[in]bc_coeff_bboundary condition term b, or NULL
[in]c_weightcell variable weight, or NULL
[in]varvariable values et cell centers
[out]var_iprimevariable values et face iprime locations

◆ cs_gradient_boundary_iprime_lsq_t()

void cs_gradient_boundary_iprime_lsq_t ( const cs_mesh_t m,
const cs_mesh_quantities_t fvq,
cs_lnum_t  n_faces,
const cs_lnum_t face_ids,
cs_halo_type_t  halo_type,
double  clip_coeff,
const cs_real_t  bc_coeff_a[][6],
const cs_real_t  bc_coeff_b[][6][6],
const cs_real_t  c_weight[],
const cs_real_t  var[][6],
cs_real_t  var_iprime[restrict][6] 
)

Compute the values of a symmetric tensor at boundary face I' positions using least-squares interpolation.

This assumes ghost cell values which might be used are already synchronized.

A simple limiter is applied to ensure the maximum principle is preserved (using non-reconstructed values in case of non-homogeneous Neumann conditions).

This function uses a local iterative approach to compute the cell gradient, as handling of the boundary condition terms b in higher dimensions would otherwise require solving higher-dimensional systems, often at a higher cost.

Remarks

To compute the values at I', we only need the gradient along II', so in most cases, we could simply assume a Neuman BC.

The same logic is applied as for cs_gradient_boundary_iprime_lsq_s.

Parameters
[in]mpointer to associated mesh structure
[in]fvqpointer to associated finite volume quantities
[in]n_facesnumber of faces at which to compute values
[in]face_idsids of boundary faces at which to compute values, or NULL for all
[in]halo_typehalo (cell neighborhood) type
[in]clip_coeffclipping (limiter) coefficient (no limiter if < 0)
[in]bc_coeff_aboundary condition term a, or NULL
[in]bc_coeff_bboundary condition term b, or NULL
[in]c_weightcell variable weight, or NULL
[in]varvariable values et cell centers
[out]var_iprimevariable values et face iprime locations

◆ cs_gradient_boundary_iprime_lsq_v()

void cs_gradient_boundary_iprime_lsq_v ( const cs_mesh_t m,
const cs_mesh_quantities_t fvq,
cs_lnum_t  n_faces,
const cs_lnum_t face_ids,
cs_halo_type_t  halo_type,
double  clip_coeff,
const cs_real_t  bc_coeff_a[][3],
const cs_real_t  bc_coeff_b[][3][3],
const cs_real_t  c_weight[],
const cs_real_t  var[][3],
cs_real_t  var_iprime[restrict][3] 
)

Compute the values of a vector at boundary face I' positions using least-squares interpolation.

This assumes ghost cell values which might be used are already synchronized.

A simple limiter is applied to ensure the maximum principle is preserved (using non-reconstructed values in case of non-homogeneous Neumann conditions).

This function uses a local iterative approach to compute the cell gradient, as handling of the boundary condition terms b in higher dimensions would otherwise require solving higher-dimensional systems, often at a higher cost.

Remarks

To compute the values at I', we only need the gradient along II', so in most cases, we could simply assume a Neuman BC.

The same logic is applied as for cs_gradient_boundary_iprime_lsq_s.

Parameters
[in]mpointer to associated mesh structure
[in]fvqpointer to associated finite volume quantities
[in]n_facesnumber of faces at which to compute values
[in]face_idsids of boundary faces at which to compute values, or NULL for all
[in]halo_typehalo (cell neighborhood) type
[in]clip_coeffclipping (limiter) coefficient (no limiter if < 0)
[in]bc_coeff_aboundary condition term a, or NULL
[in]bc_coeff_bboundary condition term b, or NULL
[in]c_weightcell variable weight, or NULL
[in]varvariable values et cell centers
[out]var_iprimevariable values et face iprime locations