8.0
general documentation
Loading...
Searching...
No Matches
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 schemes
7 *============================================================================*/
8
9/*
10 This file is part of code_saturne, a general-purpose CFD tool.
11
12 Copyright (C) 1998-2023 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_quantities.h"
36#include "cs_cdo_local.h"
37#include "cs_equation_param.h"
38#include "cs_time_step.h"
39#include "cs_xdef_eval.h"
40
41/*----------------------------------------------------------------------------*/
42
44
45/*============================================================================
46 * Macro definitions
47 *============================================================================*/
48
49/*============================================================================
50 * Type definitions
51 *============================================================================*/
52
53/*----------------------------------------------------------------------------*/
65/*----------------------------------------------------------------------------*/
66
67typedef void
68(cs_cdo_apply_boundary_t)(short int f,
69 const cs_equation_param_t *eqp,
70 const cs_cell_mesh_t *cm,
71 const cs_property_data_t *pty,
73 cs_cell_sys_t *csys);
74
75/*----------------------------------------------------------------------------*/
86/*----------------------------------------------------------------------------*/
87
88typedef void
90 const cs_cell_mesh_t *cm,
92 cs_hodge_t *hodge,
94 cs_cell_sys_t *csys);
95
96/*============================================================================
97 * Public function prototypes
98 *============================================================================*/
99
100/*----------------------------------------------------------------------------*/
111/*----------------------------------------------------------------------------*/
112
113void
115 const cs_cdo_quantities_t *cdoq,
116 const cs_equation_param_t *eqp,
117 cs_real_t *values);
118
119/*----------------------------------------------------------------------------*/
133/*----------------------------------------------------------------------------*/
134
135void
137 const cs_equation_param_t *eqp,
138 const cs_cdo_bc_face_t *face_bc,
139 const cs_flag_t vtx_bc_flag[],
140 const cs_real_t dir_values[],
141 cs_real_t t_eval,
142 cs_cell_sys_t *csys,
144
145/*----------------------------------------------------------------------------*/
157/*----------------------------------------------------------------------------*/
158
159void
161 const cs_equation_param_t *eqp,
162 const cs_cdo_bc_face_t *face_bc,
163 const cs_real_t dir_values[],
164 cs_cell_sys_t *csys,
166
167/*----------------------------------------------------------------------------*/
179/*----------------------------------------------------------------------------*/
180
181void
183 const cs_equation_param_t *eqp,
184 const cs_cdo_bc_face_t *face_bc,
185 const cs_real_t dir_values[],
186 cs_cell_sys_t *csys,
188
189/*----------------------------------------------------------------------------*/
201/*----------------------------------------------------------------------------*/
202
203void
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_cell_sys_t *csys,
210
211
212/*----------------------------------------------------------------------------*/
222/*----------------------------------------------------------------------------*/
223
224void
226 const cs_cdo_bc_face_t *face_bc,
227 cs_flag_t *vflag);
228
229/*----------------------------------------------------------------------------*/
239/*----------------------------------------------------------------------------*/
240
241void
243 const cs_cdo_bc_face_t *face_bc,
244 cs_flag_t *edge_flag);
245
246/*----------------------------------------------------------------------------*/
261/*----------------------------------------------------------------------------*/
262
263void
265 const cs_mesh_t *mesh,
266 const cs_cdo_quantities_t *quant,
267 const cs_cdo_connect_t *connect,
268 const cs_equation_param_t *eqp,
269 const cs_cdo_bc_face_t *face_bc,
271 cs_flag_t *bcflag,
272 cs_real_t *values);
273
274/*----------------------------------------------------------------------------*/
288/*----------------------------------------------------------------------------*/
289
290void
292 const cs_cdo_quantities_t *quant,
293 const cs_cdo_connect_t *connect,
294 const cs_equation_param_t *eqp,
295 const cs_cdo_bc_face_t *face_bc,
296 cs_real_t t_eval,
298 cs_real_t *values);
299
300/*----------------------------------------------------------------------------*/
313/*----------------------------------------------------------------------------*/
314
315void
317 const cs_cdo_quantities_t *quant,
318 const cs_cdo_connect_t *connect,
319 const cs_equation_param_t *eqp,
320 const cs_cdo_bc_face_t *face_bc,
321 cs_real_t t_eval,
322 cs_real_t *values);
323
324/*----------------------------------------------------------------------------*/
336/*----------------------------------------------------------------------------*/
337
338void
340 short int def_id,
341 short int f,
342 const cs_equation_param_t *eqp,
343 const cs_cell_mesh_t *cm,
344 double *neu_values);
345
346/*----------------------------------------------------------------------------*/
359/*----------------------------------------------------------------------------*/
360
361void
363 short int def_id,
364 short int f,
365 const cs_equation_param_t *eqp,
366 const cs_cell_mesh_t *cm,
367 double *neu_values);
368
369/*----------------------------------------------------------------------------*/
382/*----------------------------------------------------------------------------*/
383
384void
386 short int def_id,
387 short int f,
388 const cs_equation_param_t *eqp,
389 const cs_cell_mesh_t *cm,
390 double *neu_values);
391
392/*----------------------------------------------------------------------------*/
405/*----------------------------------------------------------------------------*/
406
407void
409 short int def_id,
410 short int f,
411 const cs_equation_param_t *eqp,
412 const cs_cell_mesh_t *cm,
413 double *neu_values);
414
415/*----------------------------------------------------------------------------*/
428/*----------------------------------------------------------------------------*/
429
430void
432 short int def_id,
433 short int f,
434 const cs_equation_param_t *eqp,
435 const cs_cell_mesh_t *cm,
436 double *neu_values);
437
438/*----------------------------------------------------------------------------*/
451/*----------------------------------------------------------------------------*/
452
453void
455 short int def_id,
456 short int f,
457 const cs_equation_param_t *eqp,
458 const cs_cell_mesh_t *cm,
459 double *neu_values);
460
461/*----------------------------------------------------------------------------*/
472/*----------------------------------------------------------------------------*/
473
474void
476 short int def_id,
477 short int f,
478 const cs_equation_param_t *eqp,
479 const cs_cell_mesh_t *cm,
480 double *rob_values);
481
482/*----------------------------------------------------------------------------*/
495/*----------------------------------------------------------------------------*/
496
497void
499 const cs_mesh_t *mesh,
500 const cs_cdo_quantities_t *quant,
501 const cs_cdo_connect_t *connect,
502 const cs_equation_param_t *eqp,
503 cs_real_t *values);
504
505/*----------------------------------------------------------------------------*/
512/*----------------------------------------------------------------------------*/
513
514void
516
517/*----------------------------------------------------------------------------*/
518
520
521#endif /* __CS_EQUATION_BC_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:509
double cs_real_t
Floating-point value.
Definition cs_defs.h:319
#define END_C_DECLS
Definition cs_defs.h:510
unsigned short int cs_flag_t
Definition cs_defs.h:321
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.c:840
void cs_equation_compute_neumann_cb(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 CDO cell-based schemes.
Definition cs_equation_bc.c:1474
void cs_equation_compute_dirichlet_vb(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_cell_builder_t *cb, 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.c:905
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.c:490
void cs_equation_compute_dirichlet_fb(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_cell_builder_t *cb, cs_real_t *values)
Compute the values of the Dirichlet BCs when DoFs are attached to CDO face-based schemes.
Definition cs_equation_bc.c:1089
void cs_equation_compute_dirichlet_cb(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 when DoFs are attached to CDO cell-based schemes.
Definition cs_equation_bc.c:1281
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.c:1558
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.c:2203
void cs_equation_compute_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.
Definition cs_equation_bc.c:2013
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.c:1756
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:89
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.c:1926
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.c:373
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:68
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 Face-based schemes.
Definition cs_equation_bc.c:565
void cs_equation_compute_circulation_eb(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 tangential component lying on the domain boundary. Kind of BCs used when Do...
Definition cs_equation_bc.c:2116
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.c:1657
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.c:780
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.c:1840
void cs_equation_init_boundary_flux_from_bc(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.c:284
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.c:685
@ fm
Definition cs_field_pointer.h:128
Definition mesh.f90:26
Definition cs_cdo_bc.h:109
Definition cs_cdo_connect.h:61
Definition cs_cdo_quantities.h:137
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:279
Structure associated to a discrete Hodge operator *.
Definition cs_hodge.h:183
Definition cs_mesh.h:85
Structure storing the evaluation of a property and its related data.
Definition cs_property.h:211