9.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-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 * Local headers
34 *----------------------------------------------------------------------------*/
35
36#include "base/cs_base.h"
37
38/*============================================================================
39 * Type definitions
40 *============================================================================*/
41
43/* -------------- */
44
45typedef enum {
46
70 /* End of balance terms */
71
73
75
77/* ---------------------------- */
78
79typedef enum {
80
92 /* End of balance terms */
93
95
97
98/*=============================================================================
99 * Public function prototypes
100 *============================================================================*/
101
102/*----------------------------------------------------------------------------*/
122/*----------------------------------------------------------------------------*/
123
124void
125cs_balance_by_zone_compute(const char *scalar_name,
126 cs_lnum_t n_cells_sel,
127 const cs_lnum_t cell_sel_ids[],
129
130/*----------------------------------------------------------------------------*/
151/*----------------------------------------------------------------------------*/
152
153void
154cs_balance_by_zone(const char *selection_crit,
155 const char *scalar_name);
156
157/*----------------------------------------------------------------------------*/
167/*----------------------------------------------------------------------------*/
168
169void
171 const cs_lnum_t cell_sel_ids[],
173
174/*----------------------------------------------------------------------------*/
182/*----------------------------------------------------------------------------*/
183
184void
185cs_pressure_drop_by_zone(const char *selection_crit);
186
187/*----------------------------------------------------------------------------*/
201/*----------------------------------------------------------------------------*/
202
203void
204cs_surface_balance(const char *selection_crit,
205 const char *scalar_name,
206 const cs_real_t normal[3]);
207
208/*----------------------------------------------------------------------------*/
233/*----------------------------------------------------------------------------*/
234
235void
236cs_flux_through_surface(const char *scalar_name,
237 const cs_real_t normal[3],
238 cs_lnum_t n_b_faces_sel,
239 cs_lnum_t n_i_faces_sel,
240 const cs_lnum_t b_face_sel_ids[],
241 const cs_lnum_t i_face_sel_ids[],
242 cs_real_t *balance,
243 cs_real_t *flux_b_faces,
244 cs_real_t *flux_i_faces);
245
246/*----------------------------------------------------------------------------*/
247
248#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:2043
cs_balance_p_term_t
Definition: cs_balance_by_zone.h:79
@ CS_BALANCE_P_OUT
Definition: cs_balance_by_zone.h:82
@ CS_BALANCE_P_RHOU_IN
Definition: cs_balance_by_zone.h:89
@ CS_BALANCE_P_N_TERMS
Definition: cs_balance_by_zone.h:94
@ CS_BALANCE_P_U_IN
Definition: cs_balance_by_zone.h:87
@ CS_BALANCE_P_IN
Definition: cs_balance_by_zone.h:81
@ CS_BALANCE_P_RHOGX_OUT
Definition: cs_balance_by_zone.h:86
@ CS_BALANCE_P_U2_OUT
Definition: cs_balance_by_zone.h:84
@ CS_BALANCE_P_RHOU_OUT
Definition: cs_balance_by_zone.h:90
@ CS_BALANCE_P_U_OUT
Definition: cs_balance_by_zone.h:88
@ CS_BALANCE_P_RHOGX_IN
Definition: cs_balance_by_zone.h:85
@ CS_BALANCE_P_U2_IN
Definition: cs_balance_by_zone.h:83
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:1412
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:515
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:1953
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:2165
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:1334
cs_balance_term_t
Definition: cs_balance_by_zone.h:45
@ CS_BALANCE_MASS_OUT
Definition: cs_balance_by_zone.h:53
@ CS_BALANCE_VOLUME
Definition: cs_balance_by_zone.h:47
@ CS_BALANCE_BOUNDARY_IN
Definition: cs_balance_by_zone.h:56
@ CS_BALANCE_BOUNDARY_COUPLED_E
Definition: cs_balance_by_zone.h:63
@ CS_BALANCE_DIV
Definition: cs_balance_by_zone.h:48
@ CS_BALANCE_BOUNDARY_WALL
Definition: cs_balance_by_zone.h:59
@ CS_BALANCE_BOUNDARY_COUPLED
Definition: cs_balance_by_zone.h:62
@ CS_BALANCE_INTERIOR_IN
Definition: cs_balance_by_zone.h:54
@ CS_BALANCE_MASS
Definition: cs_balance_by_zone.h:51
@ CS_BALANCE_BOUNDARY_WALL_R
Definition: cs_balance_by_zone.h:61
@ CS_BALANCE_BOUNDARY_SYM
Definition: cs_balance_by_zone.h:58
@ CS_BALANCE_BOUNDARY_COUPLED_I
Definition: cs_balance_by_zone.h:64
@ CS_BALANCE_BOUNDARY_WALL_S
Definition: cs_balance_by_zone.h:60
@ CS_BALANCE_TOTAL_NORMALIZED
Definition: cs_balance_by_zone.h:67
@ CS_BALANCE_MASS_IN
Definition: cs_balance_by_zone.h:52
@ CS_BALANCE_INTERIOR_OUT
Definition: cs_balance_by_zone.h:55
@ CS_BALANCE_TOTAL
Definition: cs_balance_by_zone.h:66
@ CS_BALANCE_N_TERMS
Definition: cs_balance_by_zone.h:72
@ CS_BALANCE_BOUNDARY_OUT
Definition: cs_balance_by_zone.h:57
@ CS_BALANCE_UNSTEADY
Definition: cs_balance_by_zone.h:49
@ CS_BALANCE_BOUNDARY_OTHER
Definition: cs_balance_by_zone.h:65
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325