9.2
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-2026 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 "base/cs_defs.h"
31
32/*----------------------------------------------------------------------------
33 * Standard C library headers
34 *----------------------------------------------------------------------------*/
35
36/*----------------------------------------------------------------------------
37 * Local headers
38 *----------------------------------------------------------------------------*/
39
40#include "base/cs_function.h"
41#include "base/cs_math.h"
44#include "base/cs_zone.h"
45
46/*----------------------------------------------------------------------------*/
47
50/*============================================================================
51 * Local Macro definitions
52 *============================================================================*/
53
54/*============================================================================
55 * Local type definitions
56 *============================================================================*/
57
60typedef enum {
61
62 CS_BC_VEL_RESCALE_NONE,
63 CS_BC_VEL_RESCALE_MASS_FLOW_RATE,
64 CS_BC_VEL_RESCALE_VOLUME_FLOW_RATE
66} cs_bc_velocity_rescale_t;
67
70/* Enum for boundary conditions of multiple turbulence values */
71
72typedef enum {
73
74 CS_BC_TURB_NONE = 0,
75 CS_BC_TURB_BY_HYDRAULIC_DIAMETER,
76 CS_BC_TURB_BY_TURBULENT_INTENSITY
78} cs_bc_turbulence_compute_t;
79
81#define CS_BC_OPEN_CONSTANT (1 << 1)
82
84#define CS_BC_OPEN_UNIFORM_QUANTITY (1 << 2)
85
87#define CS_BC_OPEN_UNIFORM_DIRECTION (1 << 3)
88
90#define CS_BC_OPEN_NORMAL_DIRECTION (1 << 4)
91
93/*----------------------------------------------------*/
94
114typedef struct {
115
116 const cs_zone_t *zone;
120 int vel_flags;
122 cs_bc_velocity_rescale_t vel_rescale;
123 cs_bc_turbulence_compute_t turb_compute;
125 int bc_pm_zone_num;
129 cs_real_t vel_values[4];
135 cs_real_t *vel_buffer;
138 cs_real_t hyd_diameter;
139 cs_real_t turb_intensity;
141 cs_real_t c_pr;
143 cs_real_t c_tk;
146 cs_eval_at_location_t *vel_func;
148 void *vel_func_input;
151 cs_eval_at_location_t *flow_func;
154 void *flow_func_input;
157 cs_eval_at_location_t *scale_func;
159 void *scale_func_input;
162 cs_dof_func_t *dof_func;
166 void *model_inlet;
169 cs_destructor_t *model_inlet_del;
174} cs_boundary_conditions_open_t;
175
178/*=============================================================================
179 * Semi-private function prototypes
180 *============================================================================*/
181
182/*----------------------------------------------------------------------------*/
190/*----------------------------------------------------------------------------*/
191
192cs_boundary_conditions_open_t *
194
195/*----------------------------------------------------------------------------*/
203/*----------------------------------------------------------------------------*/
204
205cs_boundary_conditions_open_t *
207
208/*----------------------------------------------------------------------------*/
209
210#endif /* CS_BOUNDARY_CONDITIONS_PRIV_H */
Definition: cs_time_control.h:92
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.
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.
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
void *() cs_destructor_t(void *s)
Destroy a given structure.
Definition: cs_defs.h:621
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:108
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_zone.h:51