7.2
general documentation
cs_balance_by_zone.h
Go to the documentation of this file.
1 #ifndef __CS_BALANCE_BY_ZONE_H__
2 #define __CS_BALANCE_BY_ZONE_H__
3 
4 /*============================================================================
5  * Scalar balance on zones.
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2022 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  * Local headers
34  *----------------------------------------------------------------------------*/
35 
36 #include "cs_base.h"
37 
38 /*----------------------------------------------------------------------------*/
39 
41 
42 /*============================================================================
43  * Type definitions
44  *============================================================================*/
45 
47 /* -------------- */
48 
49 typedef enum {
50 
74  /* End of balance terms */
75 
77 
79 
81 /* ---------------------------- */
82 
83 typedef enum {
84 
96  /* End of balance terms */
97 
99 
101 
102 /*=============================================================================
103  * Public function prototypes
104  *============================================================================*/
105 
106 /*----------------------------------------------------------------------------*/
126 /*----------------------------------------------------------------------------*/
127 
128 void
129 cs_balance_by_zone_compute(const char *scalar_name,
130  cs_lnum_t n_cells_sel,
131  const cs_lnum_t cell_sel_ids[],
132  cs_real_t balance[CS_BALANCE_N_TERMS]);
133 
134 /*----------------------------------------------------------------------------*/
155 /*----------------------------------------------------------------------------*/
156 
157 void
158 cs_balance_by_zone(const char *selection_crit,
159  const char *scalar_name);
160 
161 /*----------------------------------------------------------------------------*/
171 /*----------------------------------------------------------------------------*/
172 
173 void
175  const cs_lnum_t cell_sel_ids[],
177 
178 /*----------------------------------------------------------------------------*/
186 /*----------------------------------------------------------------------------*/
187 
188 void
189 cs_pressure_drop_by_zone(const char *selection_crit);
190 
191 /*----------------------------------------------------------------------------*/
205 /*----------------------------------------------------------------------------*/
206 
207 void
208 cs_surface_balance(const char *selection_crit,
209  const char *scalar_name,
210  const cs_real_t normal[3]);
211 
212 /*----------------------------------------------------------------------------*/
237 /*----------------------------------------------------------------------------*/
238 
239 void
240 cs_flux_through_surface(const char *scalar_name,
241  const cs_real_t normal[3],
242  cs_lnum_t n_b_faces_sel,
243  cs_lnum_t n_i_faces_sel,
244  const cs_lnum_t b_face_sel_ids[],
245  const cs_lnum_t i_face_sel_ids[],
246  cs_real_t *balance,
247  cs_real_t *flux_b_faces,
248  cs_real_t *flux_i_faces);
249 
250 /*----------------------------------------------------------------------------*/
251 
253 
254 #endif /* __CS_BALANCE_BY_ZONE_H__ */
Definition: cs_balance_by_zone.h:58
void cs_pressure_drop_by_zone_compute(cs_lnum_t n_cells_sel, const cs_lnum_t cell_sel_ids[], cs_real_t balance[CS_BALANCE_P_N_TERMS])
Computes one term of the head loss balance (pressure drop) on a on a volume zone defined by selected ...
Definition: cs_balance_by_zone.c:1772
Definition: cs_balance_by_zone.h:88
Definition: cs_balance_by_zone.h:76
Definition: cs_balance_by_zone.h:94
Definition: cs_balance_by_zone.h:56
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
Definition: cs_balance_by_zone.h:53
Definition: cs_balance_by_zone.h:85
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
void cs_balance_by_zone_compute(const char *scalar_name, cs_lnum_t n_cells_sel, const cs_lnum_t cell_sel_ids[], cs_real_t balance[CS_BALANCE_N_TERMS])
Compute the different terms of the balance of a given scalar, on a volume zone defined by selected ce...
Definition: cs_balance_by_zone.c:773
Definition: cs_balance_by_zone.h:70
Definition: cs_balance_by_zone.h:65
Definition: cs_balance_by_zone.h:66
Definition: cs_balance_by_zone.h:57
Definition: cs_balance_by_zone.h:59
Definition: cs_balance_by_zone.h:71
Definition: cs_balance_by_zone.h:68
Definition: cs_balance_by_zone.h:87
Definition: cs_balance_by_zone.h:52
Definition: cs_balance_by_zone.h:69
Definition: cs_balance_by_zone.h:64
Definition: cs_balance_by_zone.h:67
Definition: cs_balance_by_zone.h:98
Definition: cs_balance_by_zone.h:90
Definition: cs_balance_by_zone.h:55
void cs_pressure_drop_by_zone(const char *selection_crit)
Computes one term of the head loss balance (pressure drop) on a volumic zone defined by the criterion...
Definition: cs_balance_by_zone.c:2319
Definition: cs_balance_by_zone.h:92
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:316
#define END_C_DECLS
Definition: cs_defs.h:511
Definition: cs_balance_by_zone.h:93
void cs_flux_through_surface(const char *scalar_name, const cs_real_t normal[3], cs_lnum_t n_b_faces_sel, cs_lnum_t n_i_faces_sel, const cs_lnum_t b_face_sel_ids[], const cs_lnum_t i_face_sel_ids[], cs_real_t *balance, cs_real_t *flux_b_faces, cs_real_t *flux_i_faces)
Get the face by face surface flux of a given scalar, through a surface area defined by the given face...
Definition: cs_balance_by_zone.c:2532
Definition: cs_balance_by_zone.h:61
cs_balance_term_t
Definition: cs_balance_by_zone.h:49
cs_balance_p_term_t
Definition: cs_balance_by_zone.h:83
Definition: cs_balance_by_zone.h:63
Definition: cs_balance_by_zone.h:60
Definition: cs_balance_by_zone.h:91
void cs_balance_by_zone(const char *selection_crit, const char *scalar_name)
Compute and log the different terms of the balance of a given scalar, on a volumic zone defined by se...
Definition: cs_balance_by_zone.c:1694
void cs_surface_balance(const char *selection_crit, const char *scalar_name, const cs_real_t normal[3])
Compute the surface balance of a given scalar.
Definition: cs_balance_by_zone.c:2409
Definition: cs_balance_by_zone.h:89
Definition: cs_balance_by_zone.h:51
Definition: cs_balance_by_zone.h:62
Definition: cs_balance_by_zone.h:86