My Project
programmer's 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  * Routines 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-2019 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_xdef_eval.h"
36 #include "cs_cdo_quantities.h"
37 #include "cs_cdo_local.h"
38 #include "cs_equation_param.h"
39 #include "cs_time_step.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
49 /*============================================================================
50  * Type definitions
51  *============================================================================*/
52 
53 /*----------------------------------------------------------------------------*/
64 /*----------------------------------------------------------------------------*/
65 
66 typedef void
68  const cs_equation_param_t *eqp,
69  const cs_cell_mesh_t *cm,
71  cs_cell_sys_t *csys);
72 
73 /*----------------------------------------------------------------------------*/
83 /*----------------------------------------------------------------------------*/
84 
85 typedef void
87  const cs_cell_mesh_t *cm,
90  cs_cell_sys_t *csys);
91 
92 /*============================================================================
93  * Public function prototypes
94  *============================================================================*/
95 
96 /*----------------------------------------------------------------------------*/
107 /*----------------------------------------------------------------------------*/
108 
109 void
111  const cs_cdo_quantities_t *cdoq,
112  const cs_equation_param_t *eqp,
113  cs_real_t *values);
114 
115 /*----------------------------------------------------------------------------*/
129 /*----------------------------------------------------------------------------*/
130 
131 void
133  const cs_equation_param_t *eqp,
134  const cs_cdo_bc_face_t *face_bc,
135  const cs_flag_t vtx_bc_flag[],
136  const cs_real_t dir_values[],
137  cs_real_t t_eval,
138  cs_cell_sys_t *csys,
139  cs_cell_builder_t *cb);
140 
141 /*----------------------------------------------------------------------------*/
154 /*----------------------------------------------------------------------------*/
155 
156 void
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_real_t t_eval,
162  cs_cell_sys_t *csys,
163  cs_cell_builder_t *cb);
164 
165 /*----------------------------------------------------------------------------*/
180 /*----------------------------------------------------------------------------*/
181 
182 void
184  const cs_mesh_t *mesh,
185  const cs_cdo_quantities_t *quant,
186  const cs_cdo_connect_t *connect,
187  const cs_equation_param_t *eqp,
188  const cs_cdo_bc_face_t *face_bc,
189  cs_cell_builder_t *cb,
190  cs_flag_t *bcflag,
191  cs_real_t *bcvals);
192 
193 /*----------------------------------------------------------------------------*/
207 /*----------------------------------------------------------------------------*/
208 
209 void
211  const cs_cdo_quantities_t *quant,
212  const cs_cdo_connect_t *connect,
213  const cs_equation_param_t *eqp,
214  const cs_cdo_bc_face_t *face_bc,
215  cs_real_t t_eval,
216  cs_cell_builder_t *cb,
217  cs_real_t *values);
218 
219 /*----------------------------------------------------------------------------*/
229 /*----------------------------------------------------------------------------*/
230 
231 void
233  const cs_cdo_bc_face_t *face_bc,
234  cs_flag_t *vflag);
235 
236 /*----------------------------------------------------------------------------*/
248 /*----------------------------------------------------------------------------*/
249 
250 void
252  short int def_id,
253  short int f,
254  const cs_equation_param_t *eqp,
255  const cs_cell_mesh_t *cm,
256  double *neu_values);
257 
258 /*----------------------------------------------------------------------------*/
270 /*----------------------------------------------------------------------------*/
271 
272 void
274  short int def_id,
275  short int f,
276  const cs_equation_param_t *eqp,
277  const cs_cell_mesh_t *cm,
278  double *neu_values);
279 
280 /*----------------------------------------------------------------------------*/
291 /*----------------------------------------------------------------------------*/
292 
293 void
295  short int def_id,
296  short int f,
297  const cs_equation_param_t *eqp,
298  const cs_cell_mesh_t *cm,
299  double *rob_values);
300 
301 /*----------------------------------------------------------------------------*/
302 
304 
305 #endif /* __CS_EQUATION_BC_H__ */
cs_equation_init_boundary_flux_from_bc
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:175
cs_equation_compute_dirichlet_vb
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 *bcvals)
Compute the values of the Dirichlet BCs when DoFs are attached to vertices.
Definition: cs_equation_bc.c:459
cs_equation_compute_robin
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:1039
fm
Definition: cs_field_pointer.h:134
cs_face_mesh_t
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:212
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
cs_equation_vb_set_cell_bc
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:263
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_cdo_bc.h
cs_cdo_quantities.h
cs_cdo_enforce_bc_t
void() cs_cdo_enforce_bc_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Enforcement of a boundary condition (Dirichlet, Robin, sliding...)
Definition: cs_equation_bc.h:86
mesh
Definition: mesh.f90:26
cs_equation_set_vertex_bc_flag
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:798
cs_equation_param_t
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:148
cs_cdo_bc_face_t
Definition: cs_cdo_bc.h:86
cs_cdo_quantities_t
Definition: cs_cdo_quantities.h:94
cs_equation_compute_dirichlet_fb
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:654
cs_cdo_connect_t
Definition: cs_cdo_connect.h:74
cs_equation_fb_set_cell_bc
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_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 Face-based schemes.
Definition: cs_equation_bc.c:366
cs_cell_builder_t
Set of local and temporary buffers useful for building the algebraic system with a cellwise process....
Definition: cs_cdo_local.h:56
cs_xdef_eval.h
cs_cdo_connect.h
cs_time_step.h
cs_cdo_apply_boundary_t
void() cs_cdo_apply_boundary_t(short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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:67
cs_equation_compute_neumann_fb
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:954
cs_flag_t
unsigned short int cs_flag_t
Definition: cs_defs.h:304
cs_equation_param.h
Structure and routines handling the specific settings related to a cs_equation_t structure.
cs_cell_sys_t
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:93
cs_equation_compute_neumann_sv
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:864
cs_cell_mesh_t
Set of local quantities and connectivities related to a mesh cell This is a key structure for all cel...
Definition: cs_cdo_local.h:146
cs_mesh_t
Definition: cs_mesh.h:63
cs_cdo_local.h