8.3
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-2024 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 "cs_cdo_bc.h"
34#include "cs_cdo_connect.h"
35#include "cs_cdo_local.h"
36#include "cs_cdo_quantities.h"
37#include "cs_equation_param.h"
38#include "cs_macfb_builder.h"
39#include "cs_time_step.h"
40#include "cs_xdef_eval.h"
41
42/*----------------------------------------------------------------------------*/
43
45
46/*============================================================================
47 * Macro definitions
48 *============================================================================*/
49
50/*============================================================================
51 * Type definitions
52 *============================================================================*/
53
54/*----------------------------------------------------------------------------*/
66/*----------------------------------------------------------------------------*/
67
68typedef void
69(cs_cdo_apply_boundary_t)(short int f,
70 const cs_equation_param_t *eqp,
71 const cs_cell_mesh_t *cm,
72 const cs_property_data_t *pty,
74 cs_cell_sys_t *csys);
75
76/*----------------------------------------------------------------------------*/
87/*----------------------------------------------------------------------------*/
88
89typedef void
91 const cs_cell_mesh_t *cm,
93 cs_hodge_t *hodge,
95 cs_cell_sys_t *csys);
96
97/*============================================================================
98 * Public function prototypes
99 *============================================================================*/
100
101/*----------------------------------------------------------------------------*/
112/*----------------------------------------------------------------------------*/
113
114void
116 const cs_cdo_quantities_t *cdoq,
117 const cs_equation_param_t *eqp,
118 cs_real_t *values);
119
120/*----------------------------------------------------------------------------*/
134/*----------------------------------------------------------------------------*/
135
136void
138 const cs_equation_param_t *eqp,
139 const cs_cdo_bc_face_t *face_bc,
140 const cs_flag_t vtx_bc_flag[],
141 const cs_real_t dir_values[],
142 cs_real_t t_eval,
143 cs_cell_sys_t *csys,
145
146/*----------------------------------------------------------------------------*/
158/*----------------------------------------------------------------------------*/
159
160void
162 const cs_equation_param_t *eqp,
163 const cs_cdo_bc_face_t *face_bc,
164 const cs_real_t dir_values[],
165 cs_cell_sys_t *csys,
167
168/*----------------------------------------------------------------------------*/
180/*----------------------------------------------------------------------------*/
181
182void
184 const cs_equation_param_t *eqp,
185 const cs_cdo_bc_face_t *face_bc,
186 const cs_real_t dir_values[],
187 cs_cell_sys_t *csys,
189
190/*----------------------------------------------------------------------------*/
202/*----------------------------------------------------------------------------*/
203
205 const cs_equation_param_t *eqp,
206 const cs_cdo_bc_face_t *face_bc,
207 const cs_real_t dir_values[],
208 cs_macfb_builder_t *macb,
209 cs_cell_sys_t *csys);
210
211/*----------------------------------------------------------------------------*/
223/*----------------------------------------------------------------------------*/
224
225void
227 const cs_equation_param_t *eqp,
228 const cs_cdo_bc_face_t *face_bc,
229 const cs_real_t dir_values[],
230 cs_cell_sys_t *csys,
232
233
234/*----------------------------------------------------------------------------*/
244/*----------------------------------------------------------------------------*/
245
246void
248 const cs_cdo_bc_face_t *face_bc,
249 cs_flag_t *vflag);
250
251/*----------------------------------------------------------------------------*/
261/*----------------------------------------------------------------------------*/
262
263void
265 const cs_cdo_bc_face_t *face_bc,
266 cs_flag_t *edge_flag);
267
268/*----------------------------------------------------------------------------*/
282/*----------------------------------------------------------------------------*/
283
284void
286 const cs_mesh_t *mesh,
287 const cs_cdo_quantities_t *quant,
288 const cs_cdo_connect_t *connect,
289 const cs_equation_param_t *eqp,
290 const cs_cdo_bc_face_t *face_bc,
291 cs_flag_t *bcflag,
292 cs_real_t *values);
293
294/*----------------------------------------------------------------------------*/
308/*----------------------------------------------------------------------------*/
309
310void
312 const cs_cdo_quantities_t *quant,
313 const cs_cdo_connect_t *connect,
314 const cs_equation_param_t *eqp,
315 const cs_cdo_bc_face_t *face_bc,
316 cs_real_t t_eval,
317 cs_real_t *values);
318
319/*----------------------------------------------------------------------------*/
332/*----------------------------------------------------------------------------*/
333
334void
336 short int def_id,
337 short int f,
338 const cs_equation_param_t *eqp,
339 const cs_cell_mesh_t *cm,
340 double *neu_values);
341
342/*----------------------------------------------------------------------------*/
355/*----------------------------------------------------------------------------*/
356
357void
359 short int def_id,
360 short int f,
361 const cs_equation_param_t *eqp,
362 const cs_cell_mesh_t *cm,
363 double *neu_values);
364
365/*----------------------------------------------------------------------------*/
378/*----------------------------------------------------------------------------*/
379
380void
382 short int def_id,
383 short int f,
384 const cs_equation_param_t *eqp,
385 const cs_cell_mesh_t *cm,
386 double *neu_values);
387
388/*----------------------------------------------------------------------------*/
401/*----------------------------------------------------------------------------*/
402
403void
405 short int def_id,
406 short int f,
407 const cs_equation_param_t *eqp,
408 const cs_cell_mesh_t *cm,
409 double *neu_values);
410
411/*----------------------------------------------------------------------------*/
424/*----------------------------------------------------------------------------*/
425
426void
428 short int def_id,
429 short int f,
430 const cs_equation_param_t *eqp,
431 const cs_cell_mesh_t *cm,
432 double *neu_values);
433
434/*----------------------------------------------------------------------------*/
446/*----------------------------------------------------------------------------*/
447
448void
450 short int def_id,
451 short int f,
452 const cs_equation_param_t *eqp,
453 const cs_cell_mesh_t *cm,
454 double *rob_values);
455
456/*----------------------------------------------------------------------------*/
470/*----------------------------------------------------------------------------*/
471
472void
474 const cs_mesh_t *mesh,
475 const cs_cdo_quantities_t *quant,
476 const cs_cdo_connect_t *connect,
477 const cs_equation_param_t *eqp,
478 cs_real_t *values);
479
480/*----------------------------------------------------------------------------*/
487/*----------------------------------------------------------------------------*/
488
489void
491
492/*----------------------------------------------------------------------------*/
493
495
496#endif /* __CS_EQUATION_BC_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
unsigned short int cs_flag_t
Definition: cs_defs.h:344
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:1044
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:90
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:69
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:1108
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:544
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:1312
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:2046
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:1550
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:2146
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:2233
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:739
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:1762
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:1949
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:427
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:619
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:1656
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:984
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:1854
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:344
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:887
@ fm
Definition: cs_field_pointer.h:129
Definition: mesh.f90:26
Definition: cs_cdo_bc.h:106
Definition: cs_cdo_connect.h:61
Definition: cs_cdo_quantities.h:139
Set of local and temporary buffers.
Definition: cs_cdo_local.h:60
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:203
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:147
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:192
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:280
Structure associated to a discrete Hodge operator *.
Definition: cs_hodge.h:183
Definition: cs_macfb_builder.h:54
Definition: cs_mesh.h:85
Structure storing the evaluation of a property and its related data.
Definition: cs_property.h:223