My Project
programmer's documentation
Functions
cs_boundary_conditions.c File Reference
#include "cs_defs.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <mpi.h>
#include <ple_locator.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_base.h"
#include "cs_coupling.h"
#include "cs_gradient.h"
#include "cs_gui_util.h"
#include "cs_field.h"
#include "cs_field_operator.h"
#include "cs_flag_check.h"
#include "cs_halo.h"
#include "cs_math.h"
#include "cs_mesh.h"
#include "cs_mesh_connect.h"
#include "cs_mesh_quantities.h"
#include "cs_parall.h"
#include "cs_parameters.h"
#include "cs_physical_model.h"
#include "cs_prototypes.h"
#include "cs_post.h"
#include "fvm_nodal.h"
#include "cs_boundary_conditions.h"
Include dependency graph for cs_boundary_conditions.c:

Functions

void cs_boundary_conditions_error (const int *bc_flag, const char *type_name)
 Handling of boundary condition definition errors and associated output. More...
 
ple_locator_t * cs_boundary_conditions_map (cs_mesh_location_type_t location_type, cs_lnum_t n_location_elts, cs_lnum_t n_faces, const cs_lnum_t *location_elts, const cs_lnum_t *faces, cs_real_3_t *coord_shift, int coord_stride, double tolerance)
 Locate shifted boundary face coordinates on possibly filtered cells or boundary faces for later interpolation. More...
 
void cs_boundary_conditions_mapped_set (const cs_field_t *f, ple_locator_t *locator, cs_mesh_location_type_t location_type, int normalize, int interpolate, cs_lnum_t n_faces, const cs_lnum_t *faces, cs_real_t *balance_w, int nvar, cs_real_t rcodcl[])
 Set mapped boundary conditions for a given field and mapping locator. More...
 
void cs_boundary_conditions_create (void)
 
void cs_boundary_conditions_free (void)
 
void cs_boundary_conditions_set_convective_outlet_scalar (cs_real_t *coefa, cs_real_t *cofaf, cs_real_t *coefb, cs_real_t *cofbf, cs_real_t pimp, cs_real_t cfl, cs_real_t hint)
 Set convective oulet boundary condition for a scalar. More...
 

Detailed Description

Boundary condition handling.

Function Documentation

◆ cs_boundary_conditions_create()

void cs_boundary_conditions_create ( void  )

◆ cs_boundary_conditions_error()

void cs_boundary_conditions_error ( const int *  bc_flag,
const char *  type_name 
)

Handling of boundary condition definition errors and associated output.

This function checks for errors, and simply returns if no errors are encountered. In case of error, it outputs helpful information so as to make it easier to locate the matching faces.

For each boundary face, bc_type defines the boundary condition type. As a convention here, zero values correspond to undefined types, positive values to defined types (with no error), and negative values to defined types with inconsistent or incompatible values, the absolute value indicating the original boundary condition type.

An optional label may be used if the error is related to another attribute than the boundary type, for appropriate error reporting.

Parameters
[in]bc_flagarray of BC type ids
[in]type_namename of attribute in error, or NULL

◆ cs_boundary_conditions_free()

void cs_boundary_conditions_free ( void  )

◆ cs_boundary_conditions_map()

ple_locator_t* cs_boundary_conditions_map ( cs_mesh_location_type_t  location_type,
cs_lnum_t  n_location_elts,
cs_lnum_t  n_faces,
const cs_lnum_t location_elts,
const cs_lnum_t faces,
cs_real_3_t coord_shift,
int  coord_stride,
double  tolerance 
)

Locate shifted boundary face coordinates on possibly filtered cells or boundary faces for later interpolation.

Parameters
[in]location_typematching values location (CS_MESH_LOCATION_CELLS or CS_MESH_LOCATION_BOUNDARY_FACES)
[in]n_location_eltsnumber of selected location elements
[in]n_facesnumber of selected boundary faces
[in]location_eltslist of selected location elements (0 to n-1), or NULL if no indirection is needed
[in]faceslist of selected boundary faces (0 to n-1), or NULL if no indirection is needed
[in]coord_shiftarray of coordinates shift relative to selected boundary faces
[in]coord_strideaccess stride in coord_shift: 0 for uniform shift, 1 for "per face" shift.
[in]tolerancerelative tolerance for point location.
Returns
associated locator structure

◆ cs_boundary_conditions_mapped_set()

void cs_boundary_conditions_mapped_set ( const cs_field_t f,
ple_locator_t *  locator,
cs_mesh_location_type_t  location_type,
int  normalize,
int  interpolate,
cs_lnum_t  n_faces,
const cs_lnum_t faces,
cs_real_t balance_w,
int  nvar,
cs_real_t  rcodcl[] 
)

Set mapped boundary conditions for a given field and mapping locator.

Parameters
[in]ffield whose boundary conditions are set
[in]locatorassociated mapping locator, as returned by cs_boundary_conditions_map.
[in]location_typematching values location (CS_MESH_LOCATION_CELLS or CS_MESH_LOCATION_BOUNDARY_FACES)
[in]normalizenormalization option: 0: values are simply mapped 1: values are mapped, then multiplied by a constant factor so that their surface integral on selected faces is preserved (relative to the input values) 2: as 1, but with a boundary-defined weight, defined by balance_w 3: as 1, but with a cell-defined weight, defined by balance_w
[in]interpolateinterpolation option: 0: values are simply based on matching cell or face center values 1: values are based on matching cell or face center values, corrected by gradient interpolation
[in]n_facesnumber of selected boundary faces
[in]faceslist of selected boundary faces (0 to n-1), or NULL if no indirection is needed
[in]balance_woptional balance weight, or NULL
[in]nvarnumber of variables requiring BC's
[in,out]rcodclboundary condition values

◆ cs_boundary_conditions_set_convective_outlet_scalar()

void cs_boundary_conditions_set_convective_outlet_scalar ( cs_real_t coefa,
cs_real_t cofaf,
cs_real_t coefb,
cs_real_t cofbf,
cs_real_t  pimp,
cs_real_t  cfl,
cs_real_t  hint 
)

Set convective oulet boundary condition for a scalar.

Parameters:

Parameters
[out]coefaexplicit BC coefficient for gradients
[out]cofafexplicit BC coefficient for diffusive flux
[out]coefbimplicit BC coefficient for gradients
[out]cofbfimplicit BC coefficient for diffusive flux
[in]pimpFlux value to impose
[in]cflLocal Courant number used to convect
[in]hintInternal exchange coefficient