Gradient reconstruction at boundaries and associated functions. More...
#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_ext_neighborhood.h"
#include "cs_field.h"
#include "cs_halo.h"
#include "cs_internal_coupling.h"
#include "cs_gradient_priv.h"
#include "cs_math.h"
#include "cs_mesh.h"
#include "cs_mesh_adjacencies.h"
#include "cs_mesh_quantities.h"
#include "cs_parall.h"
#include "cs_gradient_boundary.h"
Functions | |
void | cs_gradient_boundary_iprime_lsq_s (const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, const cs_internal_coupling_t *cpl, 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_v (const cs_mesh_t *m, const cs_mesh_quantities_t *fvq, const cs_internal_coupling_t *cpl, 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[][6], cs_real_t *restrict var_iprime[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, const cs_internal_coupling_t *cpl, 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 *restrict var_iprime[6]) |
Compute the values of a symmetric tensor at boundary face I' positions using least-squares interpolation. More... | |
Gradient reconstruction at boundaries and associated functions.
void cs_gradient_boundary_iprime_lsq_s | ( | const cs_mesh_t * | m, |
const cs_mesh_quantities_t * | fvq, | ||
const cs_internal_coupling_t * | cpl, | ||
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).
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:
For coupled faces (with internal coupling), we assume a Neumann BC, as the values that could be computed at the intersections of the segments joining coupled cell centers and the matching boundary face do not currently account for the non-linearity associated with wall laws.
A more precise computation for cells with multiple coupled boundary faces would be possible by using multiple passes, first estimating boundary face values without recontruction, then using that information for faces which are not tangential to II' in a second pass. Note though that as the mesh is refined, the portion of the boundary adjacent to cells with multiple coupled faces (i.e. at corners and ridges) diminishes.
[in] | m | pointer to associated mesh structure |
[in] | fvq | pointer to associated finite volume quantities |
[in] | cpl | structure associated with internal coupling, or NULL |
[in] | n_faces | number of faces at which to compute values |
[in] | face_ids | ids of boundary faces at which to compute values, or NULL for all |
[in] | halo_type | halo (cell neighborhood) type |
[in] | clip_coeff | clipping (limiter) coefficient (no limiter if < 0) |
[in] | bc_coeff_a | boundary condition term a, or NULL |
[in] | bc_coeff_b | boundary condition term b, or NULL |
[in] | c_weight | cell variable weight, or NULL |
[in] | var | variable values et cell centers |
[out] | var_iprime | variable values et face iprime locations |
void cs_gradient_boundary_iprime_lsq_t | ( | const cs_mesh_t * | m, |
const cs_mesh_quantities_t * | fvq, | ||
const cs_internal_coupling_t * | cpl, | ||
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 *restrict | var_iprime[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.
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.
[in] | m | pointer to associated mesh structure |
[in] | fvq | pointer to associated finite volume quantities |
[in] | cpl | structure associated with internal coupling, or NULL |
[in] | n_faces | number of faces at which to compute values |
[in] | face_ids | ids of boundary faces at which to compute values, or NULL for all |
[in] | halo_type | halo (cell neighborhood) type |
[in] | clip_coeff | clipping (limiter) coefficient (no limiter if < 0) |
[in] | bc_coeff_a | boundary condition term a, or NULL |
[in] | bc_coeff_b | boundary condition term b, or NULL |
[in] | c_weight | cell variable weight, or NULL |
[in] | var | variable values et cell centers |
[out] | var_iprime | variable values et face iprime locations |
void cs_gradient_boundary_iprime_lsq_v | ( | const cs_mesh_t * | m, |
const cs_mesh_quantities_t * | fvq, | ||
const cs_internal_coupling_t * | cpl, | ||
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[][6], | ||
cs_real_t *restrict | var_iprime[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.
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.
[in] | m | pointer to associated mesh structure |
[in] | fvq | pointer to associated finite volume quantities |
[in] | cpl | structure associated with internal coupling, or NULL |
[in] | n_faces | number of faces at which to compute values |
[in] | face_ids | ids of boundary faces at which to compute values, or NULL for all |
[in] | halo_type | halo (cell neighborhood) type |
[in] | clip_coeff | clipping (limiter) coefficient (no limiter if < 0) |
[in] | bc_coeff_a | boundary condition term a, or NULL |
[in] | bc_coeff_b | boundary condition term b, or NULL |
[in] | c_weight | cell variable weight, or NULL |
[in] | var | variable values et cell centers |
[out] | var_iprime | variable values et face iprime locations |