7.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 schemes
7  *============================================================================*/
8 
9 /*
10  This file is part of code_saturne, a general-purpose CFD tool.
11 
12  Copyright (C) 1998-2022 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 
67 typedef void
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 
88 typedef 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 
113 void
115  const cs_cdo_quantities_t *cdoq,
116  const cs_equation_param_t *eqp,
117  cs_real_t *values);
118 
119 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 
135 void
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,
143  cs_cell_builder_t *cb);
144 
145 /*----------------------------------------------------------------------------*/
157 /*----------------------------------------------------------------------------*/
158 
159 void
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,
165  cs_cell_builder_t *cb);
166 
167 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 
181 void
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,
187  cs_cell_builder_t *cb);
188 
189 /*----------------------------------------------------------------------------*/
199 /*----------------------------------------------------------------------------*/
200 
201 void
203  const cs_cdo_bc_face_t *face_bc,
204  cs_flag_t *vflag);
205 
206 /*----------------------------------------------------------------------------*/
216 /*----------------------------------------------------------------------------*/
217 
218 void
220  const cs_cdo_bc_face_t *face_bc,
221  cs_flag_t *edge_flag);
222 
223 /*----------------------------------------------------------------------------*/
238 /*----------------------------------------------------------------------------*/
239 
240 void
242  const cs_mesh_t *mesh,
243  const cs_cdo_quantities_t *quant,
244  const cs_cdo_connect_t *connect,
245  const cs_equation_param_t *eqp,
246  const cs_cdo_bc_face_t *face_bc,
247  cs_cell_builder_t *cb,
248  cs_flag_t *bcflag,
249  cs_real_t *values);
250 
251 /*----------------------------------------------------------------------------*/
265 /*----------------------------------------------------------------------------*/
266 
267 void
269  const cs_cdo_quantities_t *quant,
270  const cs_cdo_connect_t *connect,
271  const cs_equation_param_t *eqp,
272  const cs_cdo_bc_face_t *face_bc,
273  cs_real_t t_eval,
274  cs_cell_builder_t *cb,
275  cs_real_t *values);
276 
277 /*----------------------------------------------------------------------------*/
290 /*----------------------------------------------------------------------------*/
291 
292 void
294  short int def_id,
295  short int f,
296  const cs_equation_param_t *eqp,
297  const cs_cell_mesh_t *cm,
298  double *neu_values);
299 
300 /*----------------------------------------------------------------------------*/
313 /*----------------------------------------------------------------------------*/
314 
315 void
317  short int def_id,
318  short int f,
319  const cs_equation_param_t *eqp,
320  const cs_cell_mesh_t *cm,
321  double *neu_values);
322 
323 /*----------------------------------------------------------------------------*/
336 /*----------------------------------------------------------------------------*/
337 
338 void
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 
361 void
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 
384 void
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 /*----------------------------------------------------------------------------*/
403 /*----------------------------------------------------------------------------*/
404 
405 void
407  short int def_id,
408  short int f,
409  const cs_equation_param_t *eqp,
410  const cs_cell_mesh_t *cm,
411  double *rob_values);
412 
413 /*----------------------------------------------------------------------------*/
426 /*----------------------------------------------------------------------------*/
427 
428 void
430  const cs_mesh_t *mesh,
431  const cs_cdo_quantities_t *quant,
432  const cs_cdo_connect_t *connect,
433  const cs_equation_param_t *eqp,
434  cs_real_t *values);
435 
436 /*----------------------------------------------------------------------------*/
443 /*----------------------------------------------------------------------------*/
444 
445 void
447 
448 /*----------------------------------------------------------------------------*/
449 
451 
452 #endif /* __CS_EQUATION_BC_H__ */
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:1664
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:682
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
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:186
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
Structure storing the evaluation of a property and its related data.
Definition: cs_property.h:199
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:489
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:203
Definition: cs_cdo_connect.h:61
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. Case of vector-valued equation (not the full Neumann)
Definition: cs_equation_bc.c:1497
Structure associated to a discrete Hodge operator *.
Definition: cs_hodge.h:186
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
Definition: cs_cdo_quantities.h:132
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
Definition: cs_mesh.h:84
Definition: cs_field_pointer.h:128
Definition: cs_cdo_bc.h:109
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:807
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:742
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:1270
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:990
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:1348
Set of local and temporary buffers.
Definition: cs_cdo_local.h:60
#define END_C_DECLS
Definition: cs_defs.h:511
unsigned short int cs_flag_t
Definition: cs_defs.h:324
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:283
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:1751
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:279
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:372
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:1572
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:1422
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:1192
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:564
Definition: mesh.f90:26