7.1
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-2021 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 /*----------------------------------------------------------------------------*/
204 /*----------------------------------------------------------------------------*/
205 
206 void
208  const cs_mesh_t *mesh,
209  const cs_cdo_quantities_t *quant,
210  const cs_cdo_connect_t *connect,
211  const cs_equation_param_t *eqp,
212  const cs_cdo_bc_face_t *face_bc,
213  cs_cell_builder_t *cb,
214  cs_flag_t *bcflag,
215  cs_real_t *values);
216 
217 /*----------------------------------------------------------------------------*/
231 /*----------------------------------------------------------------------------*/
232 
233 void
235  const cs_cdo_quantities_t *quant,
236  const cs_cdo_connect_t *connect,
237  const cs_equation_param_t *eqp,
238  const cs_cdo_bc_face_t *face_bc,
239  cs_real_t t_eval,
240  cs_cell_builder_t *cb,
241  cs_real_t *values);
242 
243 /*----------------------------------------------------------------------------*/
253 /*----------------------------------------------------------------------------*/
254 
255 void
257  const cs_cdo_bc_face_t *face_bc,
258  cs_flag_t *vflag);
259 
260 /*----------------------------------------------------------------------------*/
270 /*----------------------------------------------------------------------------*/
271 
272 void
274  const cs_cdo_bc_face_t *face_bc,
275  cs_flag_t *edge_flag);
276 
277 /*----------------------------------------------------------------------------*/
289 /*----------------------------------------------------------------------------*/
290 
291 void
293  short int def_id,
294  short int f,
295  const cs_equation_param_t *eqp,
296  const cs_cell_mesh_t *cm,
297  double *neu_values);
298 
299 /*----------------------------------------------------------------------------*/
311 /*----------------------------------------------------------------------------*/
312 
313 void
315  short int def_id,
316  short int f,
317  const cs_equation_param_t *eqp,
318  const cs_cell_mesh_t *cm,
319  double *neu_values);
320 
321 /*----------------------------------------------------------------------------*/
332 /*----------------------------------------------------------------------------*/
333 
334 void
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 *rob_values);
341 
342 /*----------------------------------------------------------------------------*/
355 /*----------------------------------------------------------------------------*/
356 
357 void
359  const cs_mesh_t *mesh,
360  const cs_cdo_quantities_t *quant,
361  const cs_cdo_connect_t *connect,
362  const cs_equation_param_t *eqp,
363  cs_real_t *values);
364 
365 /*----------------------------------------------------------------------------*/
366 
368 
369 #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:1384
void cs_equation_compute_neumann_sv(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 vertices...
Definition: cs_equation_bc.c:1112
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_fb_set_cell_bc(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:544
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:177
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:178
void cs_equation_set_edge_bc_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:1050
#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:202
Definition: cs_cdo_connect.h:79
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:129
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:146
Definition: cs_mesh.h:84
Definition: cs_field_pointer.h:128
Definition: cs_cdo_bc.h:88
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:636
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:819
void cs_equation_set_vertex_bc_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:990
Set of local and temporary buffers.
Definition: cs_cdo_local.h:60
void cs_equation_vb_set_cell_bc(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_neumann_fb(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 faces.
Definition: cs_equation_bc.c:1204
void cs_equation_eb_set_cell_bc(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:476
#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
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:270
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:1293
Definition: mesh.f90:26