8.1
general documentation
cs_boundary_conditions_priv.h
Go to the documentation of this file.
1 #ifndef __CS_BOUNDARY_CONDITIONS_PRIV_H__
2 #define __CS_BOUNDARY_CONDITIONS_PRIV_H__
3 
4 /*============================================================================
5  * Private types for boundary condition handling.
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2023 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 
30 #include "cs_defs.h"
31 
32 /*----------------------------------------------------------------------------
33  * Standard C library headers
34  *----------------------------------------------------------------------------*/
35 
36 /*----------------------------------------------------------------------------
37  * Local headers
38  *----------------------------------------------------------------------------*/
39 
40 #include "cs_function.h"
41 #include "cs_math.h"
42 #include "cs_mesh_location.h"
43 #include "cs_time_control.h"
44 #include "cs_zone.h"
45 
46 /*----------------------------------------------------------------------------*/
47 
49 
52 /*============================================================================
53  * Local Macro definitions
54  *============================================================================*/
55 
56 /*============================================================================
57  * Local type definitions
58  *============================================================================*/
59 
62 typedef enum {
63 
64  CS_BC_VEL_RESCALE_NONE,
65  CS_BC_VEL_RESCALE_MASS_FLOW_RATE,
66  CS_BC_VEL_RESCALE_VOLUME_FLOW_RATE
68 } cs_bc_velocity_rescale_t;
69 
72 /* Enum for boundary conditions of multiple turbulence values */
73 
74 typedef enum {
75 
76  CS_BC_TURB_NONE = 0,
77  CS_BC_TURB_BY_HYDRAULIC_DIAMETER,
78  CS_BC_TURB_BY_TURBULENT_INTENSITY
80 } cs_bc_turbulence_compute_t;
81 
83 #define CS_BC_OPEN_CONSTANT (1 << 1)
84 
86 #define CS_BC_OPEN_UNIFORM_QUANTITY (1 << 2)
87 
89 #define CS_BC_OPEN_UNIFORM_DIRECTION (1 << 3)
90 
92 #define CS_BC_OPEN_NORMAL_DIRECTION (1 << 4)
93 
95 /*----------------------------------------------------*/
96 
116 typedef struct {
117 
118  const cs_zone_t *zone;
120  cs_time_control_t tc;
122  int vel_flags;
124  cs_bc_velocity_rescale_t vel_rescale;
125  cs_bc_turbulence_compute_t turb_compute;
127  int bc_pm_zone_num;
131  cs_real_t vel_values[4];
137  cs_real_t *vel_buffer;
140  cs_real_t hyd_diameter;
141  cs_real_t turb_intensity;
143  cs_real_t c_pr;
145  cs_real_t c_tk;
148  cs_eval_at_location_t *vel_func;
150  void *vel_func_input;
153  cs_eval_at_location_t *flow_func;
156  void *flow_func_input;
159  cs_eval_at_location_t *scale_func;
161  void *scale_func_input;
164  cs_dof_func_t *dof_func;
168  void *model_inlet;
171  cs_destructor_t *model_inlet_del;
176 } cs_boundary_conditions_open_t;
177 
180 /*=============================================================================
181  * Semi-private function prototypes
182  *============================================================================*/
183 
184 /*----------------------------------------------------------------------------*/
192 /*----------------------------------------------------------------------------*/
193 
194 cs_boundary_conditions_open_t *
196 
197 /*----------------------------------------------------------------------------*/
205 /*----------------------------------------------------------------------------*/
206 
207 cs_boundary_conditions_open_t *
209 
210 /*----------------------------------------------------------------------------*/
211 
213 
214 #endif /* __CS_BOUNDARY_CONDITIONS_PRIV_H__ */
cs_boundary_conditions_open_t * cs_boundary_conditions_open_find_or_add(const cs_zone_t *zone)
Find or add an open boundary context for a given zone.
Definition: cs_boundary_conditions.c:1771
cs_boundary_conditions_open_t * cs_boundary_conditions_open_find(const cs_zone_t *zone)
Get an open boundary context structure for a given zone.
Definition: cs_boundary_conditions.c:1866
void *() cs_destructor_t(void *s)
Destroy a given structure.
Definition: cs_defs.h:595
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define END_C_DECLS
Definition: cs_defs.h:515
void() cs_eval_at_location_t(int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *input, void *vals)
Function pointer for evaluation of local function values.
Definition: cs_function.h:112
void() cs_dof_func_t(cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool dense_output, void *input, cs_real_t *retval)
Generic function pointer for computing a quantity at predefined locations such as degrees of freedom ...
Definition: cs_param_types.h:154
Definition: cs_time_control.h:96
Definition: cs_zone.h:55