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_porous_model.h"#include "base/cs_profiling.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 "atmo/cs_atmo.h"#include "ctwr/cs_ctwr_boundary_conditions.h"#include "cogz/cs_combustion_boundary_conditions.h"#include "comb/cs_coal_boundary_conditions.h"#include "base/cs_boundary_conditions_set_coeffs.h"Macros | |
| #define | NOZPPM 2000 /* max number of boundary conditions zone */ |
Functions | |
| template<bool need_flux_reconstruction> | |
| static void | _compute_bc_flux_grad (cs_dispatch_context &ctx, const int hyd_p_flag, const cs_real_t f_ext[][3], const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t val_ip_g[], const cs_real_t val_ip_d[], cs_real_t val_f[], cs_real_t flux[]) |
| static void | _compute_bc_grad (cs_dispatch_context &ctx, const int hyd_p_flag, const cs_real_t f_ext[][3], const cs_field_bc_coeffs_t *bc_coeffs, const cs_real_t val_ip_g[], cs_real_t val_f[]) |
| static void | _compute_bc_flux (cs_dispatch_context &ctx, const cs_field_bc_coeffs_t *bc_coeffs, const bool need_flux_reconstruction, const cs_real_t val_ip_d[], cs_real_t flux[]) |
| void | cs_boundary_conditions_set_coeffs (int nvar, int iterns, int isvhb, 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. More... | |
| void | cs_boundary_conditions_set_coeffs_init (void) |
| Initialization of boundary condition arrays. More... | |
| void | cs_boundary_conditions_set_convective_outlet_scalar (cs_real_t &a, cs_real_t &af, cs_real_t &b, cs_real_t &bf, cs_real_t pimp, cs_real_t cfl, cs_real_t hint) |
| Set convective oulet boundary condition for a scalar. More... | |
| CS_F_HOST_DEVICE void | cs_boundary_conditions_set_generalized_sym_vector_aniso (cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], 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. More... | |
| void | cs_boundary_conditions_set_generalized_dirichlet_vector_aniso (cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], 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. More... | |
| void | cs_boundary_conditions_update_bc_coeff_face_values (cs_dispatch_context &ctx, const cs_field_t *f, const cs_field_bc_coeffs_t *bc_coeffs, const int inc, const cs_equation_param_t *eqp, const bool need_compute_bc_grad, const bool need_compute_bc_flux, int hyd_p_flag, cs_real_t f_ext[][3], cs_real_t visel[], cs_real_t viscel[][6], const cs_real_t weighb[], const cs_real_t pvar[], cs_real_t val_f[], cs_real_t flux[]) |
| Update face value for gradient and diffusion when solving in increment. More... | |
| void | cs_boundary_conditions_update_bc_coeff_face_values (cs_dispatch_context &ctx, cs_field_t *f, const cs_equation_param_t *eqp, const bool need_compute_bc_grad, const bool need_compute_bc_flux, int hyd_p_flag, cs_real_t f_ext[][3], cs_real_t viscel[][6], const cs_real_t weighb[], const cs_real_t pvar[]) |
| Update boundary coefficient face values for gradient and diffusion when solving for a given field. More... | |
| template<cs_lnum_t stride> | |
| void | cs_boundary_conditions_update_bc_coeff_face_values_strided (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 flux[][stride], cs_real_t flux_lim[][stride]) |
| Update face value for gradient and diffusion when solving in increments. More... | |
| template<cs_lnum_t stride> | |
| void | cs_boundary_conditions_update_bc_coeff_face_values_strided (cs_dispatch_context &ctx, cs_field_t *f, const cs_real_t pvar[][stride]) |
| template void | cs_boundary_conditions_update_bc_coeff_face_values_strided (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 flux[][3], cs_real_t flux_lim[][3]) |
| template void | cs_boundary_conditions_update_bc_coeff_face_values_strided (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 flux[][6], cs_real_t flux_lim[][6]) |
| template void | cs_boundary_conditions_update_bc_coeff_face_values_strided (cs_dispatch_context &ctx, cs_field_t *f, const cs_real_t pvar[][3]) |
| template void | cs_boundary_conditions_update_bc_coeff_face_values_strided (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. More... | |
| void | cs_init_bc_coeffs_solve (cs_bc_coeffs_solve_t &c, cs_lnum_t n_b_faces, cs_lnum_t stride, cs_alloc_mode_t amode, bool limiter) |
| Initialize boundary condition coefficients solve arrays. More... | |
| void | cs_clear_bc_coeffs_solve (cs_bc_coeffs_solve_t &c) |
| Free boundary condition coefficients solve arrays. More... | |
Translation of the boundary conditions given by the user in a form that fits the solver.
Boundary condition coefficients computation.
| #define NOZPPM 2000 /* max number of boundary conditions zone */ |
|
static |
|
static |
|
static |
| 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.
| [in,out] | bc_coeffs | pointer to boundary conditions coefficients. |
| [in] | n_b_faces | number of boundary faces |
| [in] | dim | associated field dimension |
| [in] | amode | allocation mode |
| [in] | limiter | is a limiter active ? |
| void cs_boundary_conditions_set_coeffs | ( | int | nvar, |
| int | iterns, | ||
| int | isvhb, | ||
| 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
stored in the face center
of the variable
and its diffusive flux
are written as:
and
where
is the value of the variable
at the neighboring cell.
Please refer to the boundary conditions section of the theory guide for more informations, as well as the condli section.
| [in] | nvar | total number of variables |
| [in] | iterns | iteration number on Navier-Stokes equations |
| [in] | isvhb | id of field whose exchange coeffient should be saved at the walls, or -1. |
| [in] | italim | for ALE |
| [in] | itrfin | Last velocity-pressure sub-iteration indicator |
| [in] | ineefl | for ALE |
| [in] | itrfup | Update after velocity-pressure sub-iterations |
| [in,out] | isostd | indicator for standard outlet and reference face index |
| [in] | dt | time step (per cell) |
| [in,out] | visvdr | dynamic viscosity after V. Driest damping in boundary cells |
| [out] | hbord | exchange coefficient at boundary |
| [out] | theipb | value of thermal scalar at |
| [in] | nftcdt | Global indicator of condensation source terms (ie. sum on the processors of nfbpcd) cells associated to the face with condensation phenomenon |
| void cs_boundary_conditions_set_coeffs_init | ( | void | ) |
Initialization of boundary condition arrays.
| void cs_boundary_conditions_set_convective_outlet_scalar | ( | cs_real_t & | a, |
| cs_real_t & | af, | ||
| cs_real_t & | b, | ||
| cs_real_t & | bf, | ||
| cs_real_t | pimp, | ||
| cs_real_t | cfl, | ||
| cs_real_t | hint | ||
| ) |
Set convective oulet boundary condition for a scalar.
| [out] | a | explicit BC coefficient for gradients |
| [out] | af | explicit BC coefficient for diffusive flux |
| [out] | b | implicit BC coefficient for gradients |
| [out] | bf | implicit BC coefficient for diffusive flux |
| [in] | pimp | flux value to impose |
| [in] | cfl | local Courant number used to convect |
| [in] | hint | internal exchange coefficient |
| void cs_boundary_conditions_set_generalized_dirichlet_vector_aniso | ( | cs_real_t | a[3], |
| cs_real_t | af[3], | ||
| cs_real_t | b[3][3], | ||
| cs_real_t | bf[3][3], | ||
| 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.
| [out] | a | explicit BC coefficient for gradients |
| [out] | af | explicit BC coefficient for diffusive flux |
| [out] | b | implicit BC coefficient for gradients |
| [out] | bf | implicit BC coefficient for diffusive flux |
| [in] | pimpv | Dirichlet value to impose on the tangential components |
| [in] | qimpv | flux value to impose on the normal component |
| [in] | hint | internal exchange coefficient |
| [in] | normal | unit normal |
| CS_F_HOST_DEVICE void cs_boundary_conditions_set_generalized_sym_vector_aniso | ( | cs_real_t | a[3], |
| cs_real_t | af[3], | ||
| cs_real_t | b[3][3], | ||
| cs_real_t | bf[3][3], | ||
| 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.
| [out] | a | explicit BC coefficient for gradients |
| [out] | af | explicit BC coefficient for diffusive flux |
| [out] | b | implicit BC coefficient for gradients |
| [out] | bf | implicit BC coefficient for diffusive flux |
| [in] | pimpv | Dirichlet value to impose on the normal component |
| [in] | qimpv | flux value to impose on the tangential components |
| [in] | hint | internal exchange coefficient |
| [in] | normal | unit normal |
| void cs_boundary_conditions_update_bc_coeff_face_values | ( | cs_dispatch_context & | ctx, |
| const cs_field_t * | f, | ||
| const cs_field_bc_coeffs_t * | bc_coeffs, | ||
| const int | inc, | ||
| const cs_equation_param_t * | eqp, | ||
| const bool | need_compute_bc_grad, | ||
| const bool | need_compute_bc_flux, | ||
| int | hyd_p_flag, | ||
| cs_real_t | f_ext[][3], | ||
| cs_real_t | visel[], | ||
| cs_real_t | viscel[][6], | ||
| const cs_real_t | weighb[], | ||
| const cs_real_t | pvar[], | ||
| cs_real_t | val_f[], | ||
| cs_real_t | flux[] | ||
| ) |
Update face value for gradient and diffusion when solving in increment.
| [in] | ctx | reference to dispatch context |
| [in] | f | pointer to field |
| [in] | bc_coeffs | boundary condition structure |
| [in] | inc | 0 if an increment, 1 otherwise |
| [in] | eqp | equation parameters |
| [in] | need_compute_bc_grad | val_f must be computed |
| [in] | need_compute_bc_flux | flux must be computed |
| [in] | hyd_p_flag | hydrostatic pressure indicator |
| [in] | f_ext | exterior force generating pressure |
| [in] | visel | viscosity by cell, or nullptr |
| [in] | viscel | symmetric cell tensor |
| [in] | weighb | boundary face weight for cells i in case of tensor diffusion, or nullptr |
| [in] | var | variable values at cell centers |
| [in,out] | var_f | face values for the gradient computation |
| [in,out] | flux | face values for the diffusion computation |
| void cs_boundary_conditions_update_bc_coeff_face_values | ( | cs_dispatch_context & | ctx, |
| cs_field_t * | f, | ||
| const cs_equation_param_t * | eqp, | ||
| const bool | need_compute_bc_grad, | ||
| const bool | need_compute_bc_flux, | ||
| int | hyd_p_flag, | ||
| cs_real_t | f_ext[][3], | ||
| cs_real_t | viscel[][6], | ||
| const cs_real_t | weighb[], | ||
| const cs_real_t | pvar[] | ||
| ) |
Update boundary coefficient face values for gradient and diffusion when solving for a given field.
| [in] | ctx | reference to dispatch context |
| [in,out] | f | pointer to field |
| [in] | eqp | equation parameters |
| [in] | need_compute_bc_grad | val_f must be computed |
| [in] | need_compute_bc_flux | flux must be computed |
| [in] | hyd_p_flag | flag for hydrostatic pressure |
| [in] | f_ext | exterior force generating pressure |
| [in] | viscel | symmetric cell tensor |
| [in] | weighb | boundary face weight for cells i in case of tensor diffusion, or nullptr |
| [in] | pvar | variable values at cell centers |
| template void cs_boundary_conditions_update_bc_coeff_face_values_strided | ( | 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 | flux[][3], | ||
| cs_real_t | flux_lim[][3] | ||
| ) |
| template void cs_boundary_conditions_update_bc_coeff_face_values_strided | ( | 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 | flux[][6], | ||
| cs_real_t | flux_lim[][6] | ||
| ) |
| void cs_boundary_conditions_update_bc_coeff_face_values_strided | ( | 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 | flux[][stride], | ||
| cs_real_t | flux_lim[][stride] | ||
| ) |
Update face value for gradient and diffusion when solving in increments.
| [in] | ctx | reference to dispatch context |
| [in] | f | pointer to field |
| [in] | bc_coeffs | boundary condition structure for the variable |
| [in] | inc | 0 if an increment, 1 otherwise |
| [in] | eqp | equation parameters |
| [in] | pvar | variable values at cell centers |
| [in,out] | var_ip | boundary variable values at I' position |
| [in,out] | var_f | face values for the gradient computation |
| [in,out] | var_f_d | face values for the diffusion computation |
| [in,out] | var_f_d_lim | face values for the diffusion computation (with limiter) |
| template void cs_boundary_conditions_update_bc_coeff_face_values_strided | ( | cs_dispatch_context & | ctx, |
| cs_field_t * | f, | ||
| const cs_real_t | pvar[][3] | ||
| ) |
| template void cs_boundary_conditions_update_bc_coeff_face_values_strided | ( | cs_dispatch_context & | ctx, |
| cs_field_t * | f, | ||
| const cs_real_t | pvar[][6] | ||
| ) |
| void cs_boundary_conditions_update_bc_coeff_face_values_strided | ( | cs_dispatch_context & | ctx, |
| cs_field_t * | f, | ||
| const cs_real_t | pvar[][stride] | ||
| ) |
| void cs_clear_bc_coeffs_solve | ( | cs_bc_coeffs_solve_t & | c | ) |
Free boundary condition coefficients solve arrays.
| [in,out] | c | reference to structure to initialize. |
| void cs_init_bc_coeffs_solve | ( | cs_bc_coeffs_solve_t & | c, |
| cs_lnum_t | n_b_faces, | ||
| cs_lnum_t | stride, | ||
| cs_alloc_mode_t | amode, | ||
| bool | limiter | ||
| ) |
Initialize boundary condition coefficients solve arrays.
| [in,out] | c | reference to structure to initialize. |
| [in] | n_b_faces | number of boundary faces |
| [in] | stride | variable dimension |
| [in] | amode | allocation mode |
| [in] | limiter | is a limiter active ? |