8.3
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-2024 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
49typedef enum {
50
74 /* End of balance terms */
75
77
79
81/* ---------------------------- */
82
83typedef enum {
84
96 /* End of balance terms */
97
99
101
102/*=============================================================================
103 * Public function prototypes
104 *============================================================================*/
105
106/*----------------------------------------------------------------------------*/
126/*----------------------------------------------------------------------------*/
127
128void
129cs_balance_by_zone_compute(const char *scalar_name,
130 cs_lnum_t n_cells_sel,
131 const cs_lnum_t cell_sel_ids[],
133
134/*----------------------------------------------------------------------------*/
155/*----------------------------------------------------------------------------*/
156
157void
158cs_balance_by_zone(const char *selection_crit,
159 const char *scalar_name);
160
161/*----------------------------------------------------------------------------*/
171/*----------------------------------------------------------------------------*/
172
173void
175 const cs_lnum_t cell_sel_ids[],
177
178/*----------------------------------------------------------------------------*/
186/*----------------------------------------------------------------------------*/
187
188void
189cs_pressure_drop_by_zone(const char *selection_crit);
190
191/*----------------------------------------------------------------------------*/
205/*----------------------------------------------------------------------------*/
206
207void
208cs_surface_balance(const char *selection_crit,
209 const char *scalar_name,
210 const cs_real_t normal[3]);
211
212/*----------------------------------------------------------------------------*/
237/*----------------------------------------------------------------------------*/
238
239void
240cs_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__ */
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.cpp:2393
cs_balance_p_term_t
Definition: cs_balance_by_zone.h:83
@ CS_BALANCE_P_OUT
Definition: cs_balance_by_zone.h:86
@ CS_BALANCE_P_RHOU_IN
Definition: cs_balance_by_zone.h:93
@ CS_BALANCE_P_N_TERMS
Definition: cs_balance_by_zone.h:98
@ CS_BALANCE_P_U_IN
Definition: cs_balance_by_zone.h:91
@ CS_BALANCE_P_IN
Definition: cs_balance_by_zone.h:85
@ CS_BALANCE_P_RHOGX_OUT
Definition: cs_balance_by_zone.h:90
@ CS_BALANCE_P_U2_OUT
Definition: cs_balance_by_zone.h:88
@ CS_BALANCE_P_RHOU_OUT
Definition: cs_balance_by_zone.h:94
@ CS_BALANCE_P_U_OUT
Definition: cs_balance_by_zone.h:92
@ CS_BALANCE_P_RHOGX_IN
Definition: cs_balance_by_zone.h:89
@ CS_BALANCE_P_U2_IN
Definition: cs_balance_by_zone.h:87
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.cpp:1759
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.cpp:762
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.cpp:2303
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.cpp:2516
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.cpp:1681
cs_balance_term_t
Definition: cs_balance_by_zone.h:49
@ CS_BALANCE_MASS_OUT
Definition: cs_balance_by_zone.h:57
@ CS_BALANCE_VOLUME
Definition: cs_balance_by_zone.h:51
@ CS_BALANCE_BOUNDARY_IN
Definition: cs_balance_by_zone.h:60
@ CS_BALANCE_BOUNDARY_COUPLED_E
Definition: cs_balance_by_zone.h:67
@ CS_BALANCE_DIV
Definition: cs_balance_by_zone.h:52
@ CS_BALANCE_BOUNDARY_WALL
Definition: cs_balance_by_zone.h:63
@ CS_BALANCE_BOUNDARY_COUPLED
Definition: cs_balance_by_zone.h:66
@ CS_BALANCE_INTERIOR_IN
Definition: cs_balance_by_zone.h:58
@ CS_BALANCE_MASS
Definition: cs_balance_by_zone.h:55
@ CS_BALANCE_BOUNDARY_WALL_R
Definition: cs_balance_by_zone.h:65
@ CS_BALANCE_BOUNDARY_SYM
Definition: cs_balance_by_zone.h:62
@ CS_BALANCE_BOUNDARY_COUPLED_I
Definition: cs_balance_by_zone.h:68
@ CS_BALANCE_BOUNDARY_WALL_S
Definition: cs_balance_by_zone.h:64
@ CS_BALANCE_TOTAL_NORMALIZED
Definition: cs_balance_by_zone.h:71
@ CS_BALANCE_MASS_IN
Definition: cs_balance_by_zone.h:56
@ CS_BALANCE_INTERIOR_OUT
Definition: cs_balance_by_zone.h:59
@ CS_BALANCE_TOTAL
Definition: cs_balance_by_zone.h:70
@ CS_BALANCE_N_TERMS
Definition: cs_balance_by_zone.h:76
@ CS_BALANCE_BOUNDARY_OUT
Definition: cs_balance_by_zone.h:61
@ CS_BALANCE_UNSTEADY
Definition: cs_balance_by_zone.h:53
@ CS_BALANCE_BOUNDARY_OTHER
Definition: cs_balance_by_zone.h:69
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335