9.0
general documentation
Loading...
Searching...
No Matches
cs_boundary_conditions_set_coeffs.cpp File Reference

Translation of the boundary conditions given by the user in a form that fits the solver. More...

#include "base/cs_defs.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include "bft/bft_printf.h"
#include "base/cs_1d_wall_thermal.h"
#include "base/cs_ale.h"
#include "base/cs_array.h"
#include "base/cs_assert.h"
#include "base/cs_base.h"
#include "base/cs_boundary.h"
#include "base/cs_boundary_conditions.h"
#include "base/cs_boundary_conditions_check.h"
#include "base/cs_boundary_conditions_coupling.h"
#include "base/cs_boundary_conditions_set_coeffs_symmetry.h"
#include "base/cs_boundary_conditions_set_coeffs_turb.h"
#include "base/cs_boundary_conditions_type.h"
#include "cfbl/cs_cf_boundary_conditions.h"
#include "base/cs_coupling.h"
#include "base/cs_dispatch.h"
#include "base/cs_field.h"
#include "base/cs_field_default.h"
#include "base/cs_field_operator.h"
#include "base/cs_field_pointer.h"
#include "alge/cs_gradient_boundary.h"
#include "gui/cs_gui_boundary_conditions.h"
#include "gui/cs_gui_mobile_mesh.h"
#include "gui/cs_gui_util.h"
#include "base/cs_ht_convert.h"
#include "base/cs_internal_coupling.h"
#include "turb/cs_les_inflow.h"
#include "base/cs_log.h"
#include "base/cs_mem.h"
#include "mesh/cs_mesh.h"
#include "mesh/cs_mesh_quantities.h"
#include "base/cs_mobile_structures.h"
#include "base/cs_parall.h"
#include "base/cs_parameters.h"
#include "base/cs_physical_constants.h"
#include "pprt/cs_physical_model.h"
#include "base/cs_prototypes.h"
#include "rayt/cs_rad_transfer.h"
#include "rayt/cs_rad_transfer_bcs.h"
#include "base/cs_sat_coupling.h"
#include "base/cs_syr_coupling.h"
#include "base/cs_thermal_model.h"
#include "base/cs_time_step.h"
#include "turb/cs_turbulence_model.h"
#include "base/cs_turbomachinery.h"
#include "base/cs_velocity_pressure.h"
#include "base/cs_vof.h"
#include "base/cs_wall_condensation.h"
#include "base/cs_wall_condensation_1d_thermal.h"
#include "base/cs_rotation.h"
#include "base/cs_boundary_conditions_set_coeffs.h"

Macros

#define NOZPPM   2000 /* max number of boundary conditions zone */

Functions

int * cs_f_boundary_conditions_get_bc_type (void)
void cs_f_ppprcl (void)
void cs_f_pptycl (bool init, int *itypfb)
void cs_f_user_boundary_conditions_wrapper (int itypfb[], const int izfppp[], cs_real_t dt[])
void cs_boundary_conditions_set_coeffs (int nvar, int iterns, int isvhb, int itrale, int italim, int itrfin, int ineefl, int itrfup, int isostd[], cs_real_t visvdr[], cs_real_t hbord[], cs_real_t theipb[], int nftcdt)
 Translation of the boundary conditions given by the user in a form that fits to the solver.
void cs_boundary_conditions_set_coeffs_init (void)
 Initialization of boundary condition arrays.
void cs_boundary_conditions_set_convective_outlet_scalar (cs_lnum_t f_id, cs_field_bc_coeffs_t *bc_coeffs, cs_real_t pimp, cs_real_t cfl, cs_real_t hint)
 Set convective oulet boundary condition for a scalar.
void cs_boundary_conditions_set_generalized_sym_vector_aniso (cs_lnum_t f_id, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t pimpv[3], const cs_real_t qimpv[3], const cs_real_t hint[6], const cs_nreal_t normal[3])
 Set generalized BC for an anisotropic symmetric vector for a given face.
void cs_boundary_conditions_set_generalized_dirichlet_vector_aniso (cs_lnum_t f_id, cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t pimpv[3], const cs_real_t qimpv[3], const cs_real_t hint[6], const cs_nreal_t normal[3])
 Set generalized Dirichlet BC for an anisotropic vector for a given face.
template<cs_lnum_t stride>
void cs_boundary_conditions_update_bc_coeff_face_values (cs_dispatch_context &ctx, cs_field_t *f, const cs_field_bc_coeffs_t *bc_coeffs, const int inc, const cs_equation_param_t *eqp, const cs_real_t pvar[][stride], cs_real_t val_ip[][stride], cs_real_t val_f[][stride], cs_real_t val_f_lim[][stride], cs_real_t val_f_d[][stride], cs_real_t val_f_d_lim[][stride])
 Update face value for gradient and diffusion when solving in increments.
template<cs_lnum_t stride>
void cs_boundary_conditions_update_bc_coeff_face_values (cs_dispatch_context &ctx, cs_field_t *f, const cs_real_t pvar[][stride])
template void cs_boundary_conditions_update_bc_coeff_face_values (cs_dispatch_context &ctx, cs_field_t *f, const cs_field_bc_coeffs_t *bc_coeffs, const int inc, const cs_equation_param_t *eqp, const cs_real_t pvar[][3], cs_real_t val_ip[][3], cs_real_t val_f[][3], cs_real_t val_f_lim[][3], cs_real_t val_f_d[][3], cs_real_t val_f_d_lim[][3])
template void cs_boundary_conditions_update_bc_coeff_face_values (cs_dispatch_context &ctx, cs_field_t *f, const cs_field_bc_coeffs_t *bc_coeffs, const int inc, const cs_equation_param_t *eqp, const cs_real_t pvar[][6], cs_real_t val_ip[][6], cs_real_t val_f[][6], cs_real_t val_f_lim[][6], cs_real_t val_f_d[][6], cs_real_t val_f_d_lim[][6])
template void cs_boundary_conditions_update_bc_coeff_face_values (cs_dispatch_context &ctx, cs_field_t *f, const cs_real_t pvar[][3])
template void cs_boundary_conditions_update_bc_coeff_face_values (cs_dispatch_context &ctx, cs_field_t *f, const cs_real_t pvar[][6])
void cs_boundary_conditions_ensure_bc_coeff_face_values_allocated (cs_field_bc_coeffs_t *bc_coeffs, cs_lnum_t n_b_faces, cs_lnum_t dim, cs_alloc_mode_t amode, bool limiter)
 Allocate BC coefficients face values if needed.

Detailed Description

Translation of the boundary conditions given by the user in a form that fits the solver.

Boundary condition coefficients computation.

Macro Definition Documentation

◆ NOZPPM

#define NOZPPM   2000 /* max number of boundary conditions zone */

Function Documentation

◆ cs_boundary_conditions_ensure_bc_coeff_face_values_allocated()

void cs_boundary_conditions_ensure_bc_coeff_face_values_allocated ( cs_field_bc_coeffs_t * bc_coeffs,
cs_lnum_t n_b_faces,
cs_lnum_t dim,
cs_alloc_mode_t amode,
bool limiter )

Allocate BC coefficients face values if needed.

Parameters
[in,out]bc_coeffspointer to boundary conditions coefficients.
[in]n_b_facesnumber of boundary faces
[in]dimassociated field dimension
[in]amodeallocation mode
[in]limiteris a limiter active ?

◆ cs_boundary_conditions_set_coeffs()

void cs_boundary_conditions_set_coeffs ( int nvar,
int iterns,
int isvhb,
int itrale,
int italim,
int itrfin,
int ineefl,
int itrfup,
int isostd[],
cs_real_t visvdr[],
cs_real_t hbord[],
cs_real_t theipb[],
int nftcdt )

Translation of the boundary conditions given by the user in a form that fits to the solver.

The values at a boundary face $ \fib $ stored in the face center $ \centf $ of the variable $ P $ and its diffusive flux $ Q $ are written as:

\[P_{\face} = A_P^g + B_P^g P_{\centi}
\]

and

\[Q_{\face} = A_P^f + B_P^f P_{\centi}
\]

where $ P_\centi $ is the value of the variable $ P $ at the neighboring cell.

Warning
  • If we consider an increment of a variable, the boundary conditions read:

    \[  \delta P_{\face} = B_P^g \delta P_{\centi}
\]

    and

    \[  \delta Q_{\face} = -B_P^f \delta P_{\centi}
\]

  • For a vector field such as the velocity $ \vect{u} $ the boundary conditions may read:

    \[  \vect{u}_{\face} = \vect{A}_u^g + \tens{B}_u^g \vect{u}_{\centi}
\]

    and

    \[  \vect{Q}_{\face} = \vect{A}_u^f + \tens{B}_u^f \vect{u}_{\centi}
\]

    where $ \tens{B}_u^g $ and $ \tens{B}_u^f $ are 3x3 tensor matrix which coupled velocity components next to a boundary.

Please refer to the boundary conditions section of the theory guide for more informations, as well as the condli section.

Parameters
[in]nvartotal number of variables
[in]iternsiteration number on Navier-Stokes equations
[in]isvhbid of field whose exchange coeffient should be saved at the walls, or -1.
[in]itraleALE iteration number
[in]italimfor ALE
[in]itrfinLast velocity-pressure sub-iteration indicator
[in]ineeflfor ALE
[in]itrfupUpdate after velocity-pressure sub-iterations
[in,out]isostdindicator for standard outlet and reference face index
[out]visvdrdynamic viscosity after V. Driest damping in boundary cells
[out]hbordexchange coefficient at boundary
[out]theipbvalue of thermal scalar at $ \centip $ of boundary cells
[in]nftcdtGlobal indicator of condensation source terms (ie. sum on the processors of nfbpcd) cells associated to the face with condensation phenomenon

◆ cs_boundary_conditions_set_coeffs_init()

void cs_boundary_conditions_set_coeffs_init ( void )

Initialization of boundary condition arrays.

◆ cs_boundary_conditions_set_convective_outlet_scalar()

void cs_boundary_conditions_set_convective_outlet_scalar ( cs_lnum_t f_id,
cs_field_bc_coeffs_t * bc_coeffs,
cs_real_t pimp,
cs_real_t cfl,
cs_real_t hint )

Set convective oulet boundary condition for a scalar.

Parameters
[in]f_idface id
[out]bc_coeffsboundary conditions structure
[in]pimpflux value to impose
[in]cfllocal Courant number used to convect
[in]hintinternal exchange coefficient

◆ cs_boundary_conditions_set_generalized_dirichlet_vector_aniso()

void cs_boundary_conditions_set_generalized_dirichlet_vector_aniso ( cs_lnum_t f_id,
cs_field_bc_coeffs_t * bc_coeffs,
const cs_real_t pimpv[3],
const cs_real_t qimpv[3],
const cs_real_t hint[6],
const cs_nreal_t normal[3] )

Set generalized Dirichlet BC for an anisotropic vector for a given face.

Parameters
[in]f_idface id
[out]bc_coeffsboundary conditions structure
[in]pimpvDirichlet value to impose on the tangential components
[in]qimpvflux value to impose on the normal component
[in]hintinternal exchange coefficient
[in]normalunit normal

◆ cs_boundary_conditions_set_generalized_sym_vector_aniso()

void cs_boundary_conditions_set_generalized_sym_vector_aniso ( cs_lnum_t f_id,
cs_field_bc_coeffs_t * bc_coeffs,
const cs_real_t pimpv[3],
const cs_real_t qimpv[3],
const cs_real_t hint[6],
const cs_nreal_t normal[3] )

Set generalized BC for an anisotropic symmetric vector for a given face.

Parameters
[in]f_idface id
[out]bc_coeffsboundary conditions structure
[in]pimpvDirichlet value to impose on the normal component
[in]qimpvflux value to impose on the tangential components
[in]hintinternal exchange coefficient
[in]normalunit normal

◆ cs_boundary_conditions_update_bc_coeff_face_values() [1/6]

template void cs_boundary_conditions_update_bc_coeff_face_values ( cs_dispatch_context & ctx,
cs_field_t * f,
const cs_field_bc_coeffs_t * bc_coeffs,
const int inc,
const cs_equation_param_t * eqp,
const cs_real_t pvar[][3],
cs_real_t val_ip[][3],
cs_real_t val_f[][3],
cs_real_t val_f_lim[][3],
cs_real_t val_f_d[][3],
cs_real_t val_f_d_lim[][3] )

◆ cs_boundary_conditions_update_bc_coeff_face_values() [2/6]

template void cs_boundary_conditions_update_bc_coeff_face_values ( cs_dispatch_context & ctx,
cs_field_t * f,
const cs_field_bc_coeffs_t * bc_coeffs,
const int inc,
const cs_equation_param_t * eqp,
const cs_real_t pvar[][6],
cs_real_t val_ip[][6],
cs_real_t val_f[][6],
cs_real_t val_f_lim[][6],
cs_real_t val_f_d[][6],
cs_real_t val_f_d_lim[][6] )

◆ cs_boundary_conditions_update_bc_coeff_face_values() [3/6]

template<cs_lnum_t stride>
void cs_boundary_conditions_update_bc_coeff_face_values ( cs_dispatch_context & ctx,
cs_field_t * f,
const cs_field_bc_coeffs_t * bc_coeffs,
const int inc,
const cs_equation_param_t * eqp,
const cs_real_t pvar[][stride],
cs_real_t val_ip[][stride],
cs_real_t val_f[][stride],
cs_real_t val_f_lim[][stride],
cs_real_t val_f_d[][stride],
cs_real_t val_f_d_lim[][stride] )

Update face value for gradient and diffusion when solving in increments.

Parameters
[in]ctxreference to dispatch context
[in]fpointer to field
[in]bc_coeffsboundary condition structure for the variable
[in]inc0 if an increment, 1 otherwise
[in]eqpequation parameters
[in]pvarvariable values at cell centers
[in,out]var_ipboundary variable values at I' position
[in,out]var_fface values for the gradient computation
[in,out]var_f_limface values for the gradient computation (with limiter)
[in,out]var_f_dface values for the diffusion computation
[in,out]var_f_d_limface values for the diffusion computation (with limiter)

◆ cs_boundary_conditions_update_bc_coeff_face_values() [4/6]

template void cs_boundary_conditions_update_bc_coeff_face_values ( cs_dispatch_context & ctx,
cs_field_t * f,
const cs_real_t pvar[][3] )

◆ cs_boundary_conditions_update_bc_coeff_face_values() [5/6]

template void cs_boundary_conditions_update_bc_coeff_face_values ( cs_dispatch_context & ctx,
cs_field_t * f,
const cs_real_t pvar[][6] )

◆ cs_boundary_conditions_update_bc_coeff_face_values() [6/6]

template<cs_lnum_t stride>
void cs_boundary_conditions_update_bc_coeff_face_values ( cs_dispatch_context & ctx,
cs_field_t * f,
const cs_real_t pvar[][stride] )

◆ cs_f_boundary_conditions_get_bc_type()

int * cs_f_boundary_conditions_get_bc_type ( void )

◆ cs_f_ppprcl()

void cs_f_ppprcl ( void )

◆ cs_f_pptycl()

void cs_f_pptycl ( bool init,
int * itypfb )

◆ cs_f_user_boundary_conditions_wrapper()

void cs_f_user_boundary_conditions_wrapper ( int itypfb[],
const int izfppp[],
cs_real_t dt[] )