8.3
general documentation
cs_user_boundary_conditions.cpp File Reference

User functions for boundary condition definitions. More...

#include "cs_defs.h"
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "cs_headers.h"
+ Include dependency graph for cs_user_boundary_conditions.cpp:

Functions

void cs_user_boundary_conditions_setup (cs_domain_t *domain)
 Set boundary conditions to be applied. More...
 
void cs_user_boundary_conditions (cs_domain_t *domain, int bc_type[])
 User definition of boundary conditions. More...
 
void cs_user_boundary_conditions_ale (cs_domain_t *domain, int bc_type[], int ale_bc_type[], int impale[])
 User definition of boundary conditions for ALE. More...
 

Detailed Description

User functions for boundary condition definitions.

Function Documentation

◆ cs_user_boundary_conditions()

void cs_user_boundary_conditions ( cs_domain_t domain,
int  bc_type[] 
)

User definition of boundary conditions.

Parameters
[in,out]domainpointer to a cs_domain_t structure
[in,out]bc_typeboundary face types

The icodcl and rcodcl arrays are pre-initialized based on default and GUI-defined definitions, and may be modified here.

For a given variable field f, and a given face "face_id", these arrays may be used as follows:

  • Boundary condition type code given at: f->bc_coeffs->icodcl[face_id]
  • Dirichlet value defined at: f->bc_coeffs->rcodcl1[face_id]
  • Interior exchange coefficient (infinite if no exchange) at: f->bc_coeffs->rcodcl2[face_id]
  • Flux density defined at: f->bc_coeffs->rcodcl3[face_id]

For vector or tensor fields, these arrays are not interleaved, so for a given face "face_id" and field component "comp_id", access is as follows (where n_b_faces is domain->mesh->n_b_faces):

f->bc_coeffs->rcodcl1[n_b_faces*comp_id + face_id]
f->bc_coeffs->rcodcl2[n_b_faces*comp_id + face_id]
f->bc_coeffs->rcodcl3[n_b_faces*comp_id + face_id]

Only the icodcl code values from the first component are used in the case of vector or tensor fields, so the icodcl values can be defined as for a scalar.

◆ cs_user_boundary_conditions_ale()

void cs_user_boundary_conditions_ale ( cs_domain_t domain,
int  bc_type[],
int  ale_bc_type[],
int  impale[] 
)

User definition of boundary conditions for ALE.

See Boundary conditions for ALE (Arbitrary Lagrangian Eulerian) for additional details.

Parameters
[in,out]domainpointer to a cs_domain_t structure
[in,out]bc_typeboundary face types
[in,out]ale_bc_typeboundary face types for mesh velocity (see cs_boundary_ale_subtype_bits_t)
[in]impaleindicator for prescribed node displacement (0 or 1)

The icodcl and rcodcl arrays are pre-initialized based on default and GUI-defined definitions, and may be modified here.

For a given variable field f, and a given face "face_id", these arrays may be used as follows:

  • Boundary condition type code given at: f->bc_coeffs->icodcl[face_id]
  • Dirichlet value defined at: f->bc_coeffs->rcodcl1[face_id]
  • Interior exchange coefficient (infinite if no exchange) at: f->bc_coeffs->rcodcl2[face_id]
  • Flux density defined at: f->bc_coeffs->rcodcl3[face_id]

For vector or tensor fields, these arrays are not interleaved, so for a given face "face_id" and field component "comp_id", access is as follows (where n_b_faces is domain->mesh->n_b_faces):

f->bc_coeffs->rcodcl1[n_b_faces*comp_id + face_id]
f->bc_coeffs->rcodcl2[n_b_faces*comp_id + face_id]
f->bc_coeffs->rcodcl3[n_b_faces*comp_id + face_id]

Only the icodcl code values from the first component are used in the case of vector or tensor fields, so the icodcl values can be defined as for a scalar.

◆ cs_user_boundary_conditions_setup()

void cs_user_boundary_conditions_setup ( cs_domain_t domain)

Set boundary conditions to be applied.

This function is called just before cs_user_finalize_setup, and boundary conditions can be defined in either of those functions, depending on whichever is considered more readable or practical for a given use.

Parameters
[in,out]domainpointer to a cs_domain_t structure