9.2
general documentation
cs_equation_bc.h
Go to the documentation of this file.
1#ifndef CS_EQUATION_BC_H
2#define CS_EQUATION_BC_H
3
4/*============================================================================
5 * Functions to handle the evaluation of boundary conditions when building the
6 * algebraic system in CDO/HHO/MAC schemes
7 *============================================================================*/
8
9/*
10 This file is part of code_saturne, a general-purpose CFD tool.
11
12 Copyright (C) 1998-2026 EDF S.A.
13
14 This program is free software; you can redistribute it and/or modify it under
15 the terms of the GNU General Public License as published by the Free Software
16 Foundation; either version 2 of the License, or (at your option) any later
17 version.
18
19 This program is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22 details.
23
24 You should have received a copy of the GNU General Public License along with
25 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26 Street, Fifth Floor, Boston, MA 02110-1301, USA.
27*/
28
29/*----------------------------------------------------------------------------
30 * Local headers
31 *----------------------------------------------------------------------------*/
32
33#include "base/cs_time_step.h"
34#include "cdo/cs_cdo_bc.h"
35#include "cdo/cs_cdo_connect.h"
36#include "cdo/cs_cdo_local.h"
40#include "cdo/cs_xdef_eval.h"
41
42/*============================================================================
43 * Macro definitions
44 *============================================================================*/
45
46/*============================================================================
47 * Type definitions
48 *============================================================================*/
49
50/*----------------------------------------------------------------------------*/
62/*----------------------------------------------------------------------------*/
63
64typedef void
65(cs_cdo_apply_boundary_t)(short int f,
66 const cs_equation_param_t *eqp,
67 const cs_cell_mesh_t *cm,
68 const cs_property_data_t *pty,
70 cs_cell_sys_t *csys);
71
72/*----------------------------------------------------------------------------*/
83/*----------------------------------------------------------------------------*/
84
85typedef void
87 const cs_cell_mesh_t *cm,
89 cs_hodge_t *hodge,
91 cs_cell_sys_t *csys);
92
93/*============================================================================
94 * Public function prototypes
95 *============================================================================*/
96
97/*----------------------------------------------------------------------------*/
108/*----------------------------------------------------------------------------*/
109
110void
112 const cs_cdo_quantities_t *cdoq,
113 const cs_equation_param_t *eqp,
114 cs_real_t *values);
115
116/*----------------------------------------------------------------------------*/
130/*----------------------------------------------------------------------------*/
131
132void
134 const cs_equation_param_t *eqp,
135 const cs_cdo_bc_face_t *face_bc,
136 const cs_flag_t vtx_bc_flag[],
137 const cs_real_t dir_values[],
138 cs_real_t t_eval,
139 cs_cell_sys_t *csys,
141
142/*----------------------------------------------------------------------------*/
154/*----------------------------------------------------------------------------*/
155
156void
158 const cs_equation_param_t *eqp,
159 const cs_cdo_bc_face_t *face_bc,
160 const cs_real_t dir_values[],
161 cs_cell_sys_t *csys,
163
164/*----------------------------------------------------------------------------*/
176/*----------------------------------------------------------------------------*/
177
178void
180 const cs_equation_param_t *eqp,
181 const cs_cdo_bc_face_t *face_bc,
182 const cs_real_t dir_values[],
183 cs_cell_sys_t *csys,
185
186/*----------------------------------------------------------------------------*/
198/*----------------------------------------------------------------------------*/
199
201 const cs_equation_param_t *eqp,
202 const cs_cdo_bc_face_t *face_bc,
203 const cs_real_t dir_values[],
204 cs_macfb_builder_t *macb,
205 cs_cell_sys_t *csys);
206
207/*----------------------------------------------------------------------------*/
219/*----------------------------------------------------------------------------*/
220
221void
223 const cs_equation_param_t *eqp,
224 const cs_cdo_bc_face_t *face_bc,
225 const cs_real_t dir_values[],
226 cs_cell_sys_t *csys,
228
229
230/*----------------------------------------------------------------------------*/
240/*----------------------------------------------------------------------------*/
241
242void
244 const cs_cdo_bc_face_t *face_bc,
245 cs_flag_t *vflag);
246
247/*----------------------------------------------------------------------------*/
257/*----------------------------------------------------------------------------*/
258
259void
261 const cs_cdo_bc_face_t *face_bc,
262 cs_flag_t *edge_flag);
263
264/*----------------------------------------------------------------------------*/
278/*----------------------------------------------------------------------------*/
279
280void
282 const cs_mesh_t *mesh,
283 const cs_cdo_quantities_t *quant,
284 const cs_cdo_connect_t *connect,
285 const cs_equation_param_t *eqp,
286 const cs_cdo_bc_face_t *face_bc,
287 cs_flag_t *bcflag,
288 cs_real_t *values);
289
290/*----------------------------------------------------------------------------*/
304/*----------------------------------------------------------------------------*/
305
306void
308 const cs_cdo_quantities_t *quant,
309 const cs_cdo_connect_t *connect,
310 const cs_equation_param_t *eqp,
311 const cs_cdo_bc_face_t *face_bc,
312 cs_real_t t_eval,
313 cs_real_t *values);
314
315/*----------------------------------------------------------------------------*/
327/*----------------------------------------------------------------------------*/
328
329void
331 const cs_field_t *val_c,
332 const cs_time_step_t *ts,
333 cs_real_t *values);
334
335/*----------------------------------------------------------------------------*/
348/*----------------------------------------------------------------------------*/
349
350void
352 short int def_id,
353 short int f,
354 const cs_equation_param_t *eqp,
355 const cs_cell_mesh_t *cm,
356 double *neu_values);
357
358/*----------------------------------------------------------------------------*/
371/*----------------------------------------------------------------------------*/
372
373void
375 short int def_id,
376 short int f,
377 const cs_equation_param_t *eqp,
378 const cs_cell_mesh_t *cm,
379 double *neu_values);
380
381/*----------------------------------------------------------------------------*/
394/*----------------------------------------------------------------------------*/
395
396void
398 short int def_id,
399 short int f,
400 const cs_equation_param_t *eqp,
401 const cs_cell_mesh_t *cm,
402 double *neu_values);
403
404/*----------------------------------------------------------------------------*/
417/*----------------------------------------------------------------------------*/
418
419void
421 short int def_id,
422 short int f,
423 const cs_equation_param_t *eqp,
424 const cs_cell_mesh_t *cm,
425 double *neu_values);
426
427/*----------------------------------------------------------------------------*/
440/*----------------------------------------------------------------------------*/
441
442void
444 short int def_id,
445 short int f,
446 const cs_equation_param_t *eqp,
447 const cs_cell_mesh_t *cm,
448 double *neu_values);
449
450/*----------------------------------------------------------------------------*/
462/*----------------------------------------------------------------------------*/
463
464void
466 short int def_id,
467 short int f,
468 const cs_equation_param_t *eqp,
469 const cs_cell_mesh_t *cm,
470 double *rob_values);
471
472/*----------------------------------------------------------------------------*/
489/*----------------------------------------------------------------------------*/
490
491void
493 short int def_id,
494 short int f,
495 const cs_equation_param_t *eqp,
496 const cs_cell_mesh_t *cm,
497 const cs_real_t nu,
498 const cs_real_t k,
499 const cs_real_t hfc,
500 const cs_real_t *uc,
501 const cs_real_t *uf,
502 double *rob_values);
503
504/*----------------------------------------------------------------------------*/
518/*----------------------------------------------------------------------------*/
519
520void
522 const cs_mesh_t *mesh,
523 const cs_cdo_quantities_t *quant,
524 const cs_cdo_connect_t *connect,
525 const cs_equation_param_t *eqp,
526 cs_real_t *values);
527
528/*----------------------------------------------------------------------------*/
535/*----------------------------------------------------------------------------*/
536
537void
539
540#endif /* CS_EQUATION_BC_H */
Field descriptor.
Definition: cs_field.h:275
time step descriptor
Definition: cs_time_step.h:60
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
unsigned short int cs_flag_t
Definition: cs_defs.h:334
void cs_equation_bc_set_edge_flag(const cs_cdo_connect_t *connect, const cs_cdo_bc_face_t *face_bc, cs_flag_t *edge_flag)
Define an array of flags for each edge collecting the flags of associated boundary faces.
Definition: cs_equation_bc.cpp:1218
void() cs_cdo_enforce_bc_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Enforcement of a boundary condition (Dirichlet, Robin, sliding...)
Definition: cs_equation_bc.h:86
void() cs_cdo_apply_boundary_t(short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *pty, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Apply a boundary condition for a given face (inlet, outlet, wall, sliding wall, symmetry....
Definition: cs_equation_bc.h:65
void cs_equation_bc_dirichlet_at_vertices(cs_real_t t_eval, const cs_mesh_t *mesh, const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_equation_param_t *eqp, const cs_cdo_bc_face_t *face_bc, cs_flag_t *bcflag, cs_real_t *values)
Compute the values of the Dirichlet BCs when DoFs are attached to vertices.
Definition: cs_equation_bc.cpp:1282
void cs_equation_bc_set_cw_eb(const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, const cs_cdo_bc_face_t *face_bc, const cs_real_t dir_values[], cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Set the BC into a cellwise view of the current system. Case of edge-based schemes.
Definition: cs_equation_bc.cpp:706
void cs_equation_bc_cw_turb_smooth_wall(cs_real_t t_eval, short int def_id, short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_real_t nu, const cs_real_t k, const cs_real_t hfc, const cs_real_t *uc, const cs_real_t *uf, double *rob_values)
Compute the values of the Robin BCs for a face (cell-wise compute relying on the cs_cell_mesh_t struc...
Definition: cs_equation_bc.cpp:2376
void cs_equation_bc_dirichlet_at_faces(const cs_mesh_t *mesh, const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_equation_param_t *eqp, const cs_cdo_bc_face_t *face_bc, cs_real_t t_eval, cs_real_t *values)
Compute the values of the Dirichlet BCs at boundary faces. This can be applied to CDO face-based sche...
Definition: cs_equation_bc.cpp:1488
void cs_equation_bc_cw_robin(cs_real_t t_eval, short int def_id, short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, double *rob_values)
Compute the values of the Robin BCs for a face (cell-wise compute relying on the cs_cell_mesh_t struc...
Definition: cs_equation_bc.cpp:2266
void cs_equation_compute_neumann_svb(cs_real_t t_eval, short int def_id, short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, double *neu_values)
Compute the values of the Neumann BCs when DoFs are scalar-valued and attached to a vertex-based sche...
Definition: cs_equation_bc.cpp:1725
void cs_equation_bc_circulation_at_edges(cs_real_t t_eval, const cs_mesh_t *mesh, const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_equation_param_t *eqp, cs_real_t *values)
Compute the values of the circulation along primal edges lying on the domain boundary (the integral o...
Definition: cs_equation_bc.cpp:2556
void cs_equation_bc_update_for_increment(cs_cell_sys_t *csys)
Update the boundary conditions to fullfill the constraint when an incremental solve is set.
Definition: cs_equation_bc.cpp:2643
void cs_equation_bc_set_cw_macfb(const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, const cs_cdo_bc_face_t *face_bc, const cs_real_t dir_values[], cs_macfb_builder_t *macb, cs_cell_sys_t *csys)
Set the BC into a cellwise view of the current system. Case of MAC Face-based schemes.
Definition: cs_equation_bc.cpp:901
void cs_equation_compute_neumann_sfb(cs_real_t t_eval, short int def_id, short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, double *neu_values)
Compute the values of the Neumann BCs when DoFs are attached to the face f. Case of scalar-valued equ...
Definition: cs_equation_bc.cpp:1937
void cs_equation_compute_neumann_vfb(cs_real_t t_eval, short int def_id, short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, double *neu_values)
Compute the values of the Neumann BCs at the face f when DoFs are attached to faces....
Definition: cs_equation_bc.cpp:2169
void cs_equation_bc_set_cw_vb(const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, const cs_cdo_bc_face_t *face_bc, const cs_flag_t vtx_bc_flag[], const cs_real_t dir_values[], cs_real_t t_eval, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Set the BC into a cellwise view of the current system. Case of vertex-based schemes.
Definition: cs_equation_bc.cpp:589
void cs_equation_bc_set_cw_fb(const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, const cs_cdo_bc_face_t *face_bc, const cs_real_t dir_values[], cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Set the BC into a cellwise view of the current system. Case of CDO Face-based schemes.
Definition: cs_equation_bc.cpp:781
void cs_equation_compute_full_neumann_svb(cs_real_t t_eval, short int def_id, short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, double *neu_values)
Compute the values of the Neumann BCs when DoFs are scalar-valued and attached to a vertex-based sche...
Definition: cs_equation_bc.cpp:1831
void cs_equation_bc_set_vertex_flag(const cs_cdo_connect_t *connect, const cs_cdo_bc_face_t *face_bc, cs_flag_t *vflag)
Define an array of flags for each vertex collecting the flags of associated boundary faces.
Definition: cs_equation_bc.cpp:1158
void cs_equation_compute_full_neumann_sfb(cs_real_t t_eval, short int def_id, short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, double *neu_values)
Compute the values of the Neumann BCs when DoFs are attached to the face f. Case of scalar-valued equ...
Definition: cs_equation_bc.cpp:2035
void cs_equation_bc_init_boundary_flux(cs_real_t t_eval, const cs_cdo_quantities_t *cdoq, const cs_equation_param_t *eqp, cs_real_t *values)
Set the values for the normal boundary flux stemming from the Neumann boundary conditions (zero is le...
Definition: cs_equation_bc.cpp:504
void cs_equation_bc_mapped_inlet_at_faces(const cs_cdo_quantities_t *quant, const cs_field_t *val_c, const cs_time_step_t *ts, cs_real_t *values)
Compute the values of the Dirichlet BCs at boundary faces for mapped inlet only. Be careful,...
Definition: cs_equation_bc.cpp:2129
void cs_equation_bc_set_cw_cb(const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, const cs_cdo_bc_face_t *face_bc, const cs_real_t dir_values[], cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Set the BC into a cellwise view of the current system. Case of Face-based schemes.
Definition: cs_equation_bc.cpp:1061
@ k
Definition: cs_field_pointer.h:68
@ fm
Definition: cs_field_pointer.h:126
Definition: mesh.f90:26
Definition: cs_cdo_bc.h:105
Definition: cs_cdo_connect.h:57
Definition: cs_cdo_quantities.h:142
Set of local and temporary buffers.
Definition: cs_cdo_local.h:56
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:242
Set of arrays and local (small) dense matrices related to a mesh cell This is a key structure for bui...
Definition: cs_cdo_local.h:163
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:190
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:432
Structure associated to a discrete Hodge operator *.
Definition: cs_hodge.h:179
Definition: cs_macfb_builder.h:50
Definition: cs_mesh.h:85
Structure storing the evaluation of a property and its related data.
Definition: cs_property.h:219