My Project
programmer's documentation
cs_boundary.h
Go to the documentation of this file.
1 #ifndef __CS_BOUNDARY_H__
2 #define __CS_BOUNDARY_H__
3 
4 /*============================================================================
5  * Handle the boundaries of a computational domain
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2019 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------
29  * Local headers
30  *----------------------------------------------------------------------------*/
31 
32 #include "cs_base.h"
33 #include "cs_defs.h"
34 
35 /*----------------------------------------------------------------------------*/
36 
38 
39 /*============================================================================
40  * Macro definitions
41  *============================================================================*/
42 
43 /* Name of the boundary zone gathering all domain boundary walls */
44 #define CS_BOUNDARY_WALLS_NAME "cs_boundary_walls"
45 
46 /*============================================================================
47  * Type definitions
48  *============================================================================*/
49 
50 /* Physic-driven boundary */
51 typedef enum {
52 
59 
60  /* Physic-driven boundary types for ALE*/
68 
70 
72 
77 typedef struct {
78 
83  int *zone_ids;
86 
87 /*============================================================================
88  * Static global variables
89  *============================================================================*/
90 
91 extern cs_boundary_t *cs_glob_boundaries; /* Pointer to the shared boundaries
92  * on the computational domain */
93 
94 /*============================================================================
95  * Public function prototypes
96  *============================================================================*/
97 
98 /*----------------------------------------------------------------------------*/
106 /*----------------------------------------------------------------------------*/
107 
108 const char *
110 
111 /*----------------------------------------------------------------------------*/
120 /*----------------------------------------------------------------------------*/
121 
122 bool
124 
125 /*----------------------------------------------------------------------------*/
134 /*----------------------------------------------------------------------------*/
135 
136 int
137 cs_boundary_id_by_zone_id(const cs_boundary_t *boundaries,
138  int z_id);
139 
140 /*----------------------------------------------------------------------------*/
148 /*----------------------------------------------------------------------------*/
149 
150 void
153 
154 /*----------------------------------------------------------------------------*/
162 /*----------------------------------------------------------------------------*/
163 
166 
167 /*----------------------------------------------------------------------------*/
173 /*----------------------------------------------------------------------------*/
174 
175 void
176 cs_boundary_free(cs_boundary_t **p_boundaries);
177 
178 /*----------------------------------------------------------------------------*/
186 /*----------------------------------------------------------------------------*/
187 
188 void
191  const char *zone_name);
192 
193 /*----------------------------------------------------------------------------*/
202 /*----------------------------------------------------------------------------*/
203 
204 void
206  cs_lnum_t n_b_faces,
207  cs_boundary_type_t *bf_type);
208 
209 /*----------------------------------------------------------------------------*/
215 /*----------------------------------------------------------------------------*/
216 
217 void
219 
220 /*----------------------------------------------------------------------------*/
226 /*----------------------------------------------------------------------------*/
227 
228 void
230 
231 /*----------------------------------------------------------------------------*/
232 
234 
235 #endif /* __CS_BOUNDARY_H__ */
cs_boundary_type_t
cs_boundary_type_t
Definition: cs_boundary.h:51
cs_boundary_free
void cs_boundary_free(cs_boundary_t **p_boundaries)
Free all metadate related to the domain boundaries.
Definition: cs_boundary.c:359
cs_boundary_set_default
void cs_boundary_set_default(cs_boundary_t *boundaries, cs_boundary_type_t type)
Set the default boundary related to the given cs_boundary_t structure.
Definition: cs_boundary.c:310
cs_boundary_create
cs_boundary_t * cs_boundary_create(cs_boundary_type_t type)
Create a default boundary structure for the computational domain.
Definition: cs_boundary.c:336
cs_defs.h
CS_BOUNDARY_INLET
Definition: cs_boundary.h:55
CS_BOUNDARY_OUTLET
Definition: cs_boundary.h:56
cs_boundary_t::zone_ids
int * zone_ids
Definition: cs_boundary.h:83
cs_boundary_get_name
const char * cs_boundary_get_name(cs_boundary_type_t type)
Get the name of the domain boundary condition.
Definition: cs_boundary.c:239
cs_boundary_t
Structure storing information related to the "physical" boundaries that one want to set on the comput...
Definition: cs_boundary.h:77
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
CS_BOUNDARY_PRESSURE_INLET_OUTLET
Definition: cs_boundary.h:57
cs_boundary_def_wall_zones
void cs_boundary_def_wall_zones(cs_boundary_t *boundaries)
Add a new zone gathering all CS_BOUNDARY_WALL zone type.
Definition: cs_boundary.c:452
CS_BOUNDARY_ALE_INTERNAL_COUPLING
Definition: cs_boundary.h:65
CS_BOUNDARY_ALE_FIXED
Definition: cs_boundary.h:61
CS_BOUNDARY_ALE_SLIDING
Definition: cs_boundary.h:62
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
CS_BOUNDARY_ALE_IMPOSED_DISP
Definition: cs_boundary.h:64
CS_BOUNDARY_N_TYPES
Definition: cs_boundary.h:69
CS_BOUNDARY_ALE_IMPOSED_VEL
Definition: cs_boundary.h:63
cs_boundary_t::types
cs_boundary_type_t * types
Definition: cs_boundary.h:82
cs_boundary_t::n_boundaries
int n_boundaries
Definition: cs_boundary.h:81
cs_boundary_add
void cs_boundary_add(cs_boundary_t *bdy, cs_boundary_type_t type, const char *zone_name)
Add a new boundary type for a given boundary zone.
Definition: cs_boundary.c:383
CS_BOUNDARY_ALE_FREE_SURFACE
Definition: cs_boundary.h:67
CS_BOUNDARY_SLIDING_WALL
Definition: cs_boundary.h:54
cs_boundary_build_type_array
void cs_boundary_build_type_array(const cs_boundary_t *boundaries, cs_lnum_t n_b_faces, cs_boundary_type_t *bf_type)
Build an array on boundary faces which specify the type of boundary for each face.
Definition: cs_boundary.c:422
cs_glob_boundaries
cs_boundary_t * cs_glob_boundaries
cs_boundary_log_setup
void cs_boundary_log_setup(const cs_boundary_t *bdy)
Summarize the setup of the boundary of the computational domain.
Definition: cs_boundary.c:481
CS_BOUNDARY_ALE_EXTERNAL_COUPLING
Definition: cs_boundary.h:66
CS_BOUNDARY_SYMMETRY
Definition: cs_boundary.h:58
cs_boundary_id_by_zone_id
int cs_boundary_id_by_zone_id(const cs_boundary_t *boundaries, int z_id)
Retrieve the related id associated to a boundary from its zone id.
Definition: cs_boundary.c:284
cs_boundary_t::default_type
cs_boundary_type_t default_type
Definition: cs_boundary.h:79
CS_BOUNDARY_WALL
Definition: cs_boundary.h:53
type
void const cs_int_t * type
Definition: cs_measures_util.h:425
cs_boundary_has_pressure_boundary
bool cs_boundary_has_pressure_boundary(const cs_boundary_t *boundaries)
Check if there is a pressure-related boundary among the prescribed bounadries.
Definition: cs_boundary.c:259
cs_base.h