9.2
general documentation
cs_ctwr.h
Go to the documentation of this file.
1#ifndef CS_CTWR_H
2#define CS_CTWR_H
3
4/*============================================================================
5 * Cooling towers related functions
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/*----------------------------------------------------------------------------
31 * Local headers
32 *----------------------------------------------------------------------------*/
33
34#include "base/cs_defs.h"
35
36/*============================================================================
37 * Local Macro definitions
38 *============================================================================*/
39
40/*============================================================================
41 * Type definitions
42 *============================================================================*/
43
44/*============================================================================
45 * Type definitions
46 *============================================================================*/
47
50typedef enum {
51
57
60typedef enum {
61
67
68/* Cooling tower exchange zone structure definition */
69/*--------------------------------------------------*/
70
72
73 int num; /* Exchange zone number */
74 char *criteria; /* Exchange zone selection criteria */
75 int z_id; /* id of the volume zone */
76 char *name; /* Exchange zone name */
77 char *file_name; /* Exchange zone budget file name */
78 cs_ctwr_zone_type_t type; /* Zone type */
79
80 cs_real_t hmin; /* Minimum vertical height of exchange zone */
81 cs_real_t hmax; /* Maximum height of exchange zone */
82 cs_real_t delta_t; /* Temperature delta required for exchange zone
83 if positive */
84 cs_real_t relax; /* Relaxation of the imposed temperature */
85
86 cs_real_t t_l_bc; /* Water entry temperature */
87 cs_real_t q_l_bc; /* Water flow */
88
89 cs_real_t xap; /* Exchange law a_0 coefficient */
90 cs_real_t xnp; /* Exchange law n exponent */
91
92 cs_real_t surface_in; /* Water inlet surface */
93 cs_real_t surface_out; /* Water outlet surface */
94 cs_real_t surface; /* Total surface */
95
96 cs_real_t xleak_fac; /* Leakage factor (ratio of outlet/inlet
97 flow rate) */
98 cs_real_t v_liq_pack; /* Vertical liquid film velocity in packing */
99
100 cs_lnum_t n_cells; /* Number of air cells belonging to the zone */
101 cs_real_t vol_f; /* Cooling tower zone total volume */
102
103 int up_ct_id; /* Id of upstream exchange zone (if any) */
104
105 cs_lnum_t n_inlet_faces; /* Number of inlet faces */
106 cs_lnum_t n_outlet_faces; /* Number of outlet faces */
107 cs_lnum_t *inlet_faces_ids; /* List of inlet faces */
108 cs_lnum_t *outlet_faces_ids; /* List of outlet faces */
109
110 cs_lnum_t n_outlet_cells; /* Number of outlet cells */
111 cs_lnum_t *outlet_cells_ids; /* List of outlet cells */
112
113 cs_real_t p_in; /* Average inlet pressure */
114 cs_real_t p_out; /* Average outlet pressure */
115 cs_real_t q_l_in; /* Water entry flow */
116 cs_real_t q_l_out; /* Water exit flow */
117 cs_real_t t_l_in; /* Mean water entry temperature */
118 cs_real_t t_l_out; /* Mean water exit temperature */
119 cs_real_t h_l_in; /* Mean water entry enthalpy */
120 cs_real_t h_l_out; /* Mean water exit enthalpy */
121 cs_real_t t_h_in; /* Mean air entry temperature */
122 cs_real_t t_h_out; /* Mean air exit temperature */
123 cs_real_t xair_e; /* Mean air entry humidity */
124 cs_real_t xair_s; /* Mean air exit humidity */
125 cs_real_t h_h_in; /* Mean air entry enthalpy */
126 cs_real_t h_h_out; /* Mean air exit enthalpy */
127 cs_real_t q_h_in; /* Air entry flow */
128 cs_real_t q_h_out; /* Air exit flow */
129
130};
131
132typedef struct _cs_ctwr_zone_t cs_ctwr_zone_t;
133
138/*----------------------------------------------------------------------------
139 * Cooling Tower model options descriptor
140 *----------------------------------------------------------------------------*/
141
142typedef struct {
143
155
156
157/*============================================================================
158 * Static global variables
159 *============================================================================*/
160
161/* Pointer to cooling tower model options structure */
163
164/* Make number of cooling towers zones accessible */
165
166/*============================================================================
167 * Public function definitions
168 *============================================================================*/
169
170/*----------------------------------------------------------------------------
171 * Provide access to cs_ctwr_option
172 *----------------------------------------------------------------------------*/
173
176
177/*----------------------------------------------------------------------------
178 * Provide access to cs_ctwr_zone
179 *----------------------------------------------------------------------------*/
180
181cs_ctwr_zone_t **
183
184/*----------------------------------------------------------------------------
185 * Provide access to number of ct zones
186 *----------------------------------------------------------------------------*/
187
188int *
190
191
192/*----------------------------------------------------------------------------*/
209/*----------------------------------------------------------------------------*/
210
211void
212cs_ctwr_define(const char zone_criteria[],
213 int z_id,
214 cs_ctwr_zone_type_t zone_type,
215 cs_real_t delta_t,
216 cs_real_t relax,
217 cs_real_t t_l_bc,
218 cs_real_t q_l_bc,
219 cs_real_t xap,
220 cs_real_t xnp,
221 cs_real_t surface,
222 cs_real_t xleak_fac);
223
224/*----------------------------------------------------------------------------*/
228/*----------------------------------------------------------------------------*/
229
230void
232
233/*----------------------------------------------------------------------------*/
237/*----------------------------------------------------------------------------*/
238
239void
241
242/*----------------------------------------------------------------------------*/
246/*----------------------------------------------------------------------------*/
247
248void
250
251/*----------------------------------------------------------------------------*/
255/*----------------------------------------------------------------------------*/
256
257void
259
260/*----------------------------------------------------------------------------*/
264/*----------------------------------------------------------------------------*/
265
266void
268
269/*----------------------------------------------------------------------------*/
273/*----------------------------------------------------------------------------*/
274
275void
277
278/*----------------------------------------------------------------------------*/
286/*----------------------------------------------------------------------------*/
287
288void
290
291/*----------------------------------------------------------------------------
292 * Get pointer to exchange area.
293 *
294 * parameters:
295 * ct_id <-- Id (0 to n-1) of exchange area
296 *
297 * returns:
298 * pointer to exchange area structure
299 *----------------------------------------------------------------------------*/
300
301cs_ctwr_zone_t *
302cs_ctwr_by_id(int ct_id);
303
304/*----------------------------------------------------------------------------*/
305
306#endif /* CS_CTWR_H */
cs_ctwr_option_t * cs_get_glob_ctwr_option(void)
Definition: cs_ctwr.cpp:291
void cs_ctwr_log_balance(void)
Perform balances in packing zones.
Definition: cs_ctwr.cpp:867
int * cs_get_glob_ctwr_n_zones(void)
Definition: cs_ctwr.cpp:311
void cs_ctwr_define(const char zone_criteria[], int z_id, cs_ctwr_zone_type_t zone_type, cs_real_t delta_t, cs_real_t relax, cs_real_t t_l_bc, cs_real_t q_l_bc, cs_real_t xap, cs_real_t xnp, cs_real_t surface, cs_real_t xleak_fac)
Define a cooling tower exchange zone.
Definition: cs_ctwr.cpp:336
cs_ctwr_zone_t * cs_ctwr_by_id(int ct_id)
void cs_ctwr_all_destroy(void)
Destroy cs_ctwr_t structures.
Definition: cs_ctwr.cpp:721
cs_ctwr_zone_type_t
Definition: cs_ctwr.h:60
@ CS_CTWR_INJECTION
Definition: cs_ctwr.h:64
@ CS_CTWR_COUNTER_CURRENT
Definition: cs_ctwr.h:62
@ CS_CTWR_CROSS_CURRENT
Definition: cs_ctwr.h:63
cs_ctwr_model_t
Definition: cs_ctwr.h:50
@ CS_CTWR_MERKEL
Definition: cs_ctwr.h:54
@ CS_CTWR_NONE
Definition: cs_ctwr.h:52
@ CS_CTWR_POPPE
Definition: cs_ctwr.h:53
void cs_ctwr_field_pointer_map(void)
Map fields used by the cooling tower module to pointers.
Definition: cs_ctwr_variables.cpp:783
void cs_ctwr_build_all(void)
Define the cells belonging to the different packing zones.
Definition: cs_ctwr.cpp:573
cs_ctwr_zone_t ** cs_get_glob_ctwr_zone(void)
Definition: cs_ctwr.cpp:301
void cs_ctwr_transport_vars(int iflag)
Convert injected liquid scalars from and to their transported form.
void cs_ctwr_define_zones(void)
Define zones.
Definition: cs_ctwr.cpp:505
const cs_ctwr_option_t * cs_glob_ctwr_option
void cs_ctwr_log_setup(void)
Log Packing zone definition setup information.
Definition: cs_ctwr.cpp:749
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
Definition: cs_ctwr.h:71
cs_real_t q_h_out
Definition: cs_ctwr.h:128
cs_real_t h_l_in
Definition: cs_ctwr.h:119
cs_real_t t_l_bc
Definition: cs_ctwr.h:86
cs_lnum_t n_outlet_faces
Definition: cs_ctwr.h:106
cs_ctwr_zone_type_t type
Definition: cs_ctwr.h:78
cs_real_t q_l_out
Definition: cs_ctwr.h:116
cs_real_t relax
Definition: cs_ctwr.h:84
cs_lnum_t * outlet_faces_ids
Definition: cs_ctwr.h:108
cs_real_t v_liq_pack
Definition: cs_ctwr.h:98
cs_real_t t_h_in
Definition: cs_ctwr.h:121
cs_real_t surface
Definition: cs_ctwr.h:94
cs_real_t q_l_bc
Definition: cs_ctwr.h:87
cs_lnum_t * inlet_faces_ids
Definition: cs_ctwr.h:107
char * name
Definition: cs_ctwr.h:76
cs_lnum_t n_outlet_cells
Definition: cs_ctwr.h:110
cs_real_t vol_f
Definition: cs_ctwr.h:101
cs_lnum_t * outlet_cells_ids
Definition: cs_ctwr.h:111
cs_lnum_t n_inlet_faces
Definition: cs_ctwr.h:105
cs_real_t hmax
Definition: cs_ctwr.h:81
int z_id
Definition: cs_ctwr.h:75
cs_lnum_t n_cells
Definition: cs_ctwr.h:100
char * criteria
Definition: cs_ctwr.h:74
char * file_name
Definition: cs_ctwr.h:77
int num
Definition: cs_ctwr.h:73
cs_real_t surface_in
Definition: cs_ctwr.h:92
cs_real_t t_h_out
Definition: cs_ctwr.h:122
cs_real_t xair_s
Definition: cs_ctwr.h:124
cs_real_t xap
Definition: cs_ctwr.h:89
cs_real_t q_l_in
Definition: cs_ctwr.h:115
cs_real_t t_l_in
Definition: cs_ctwr.h:117
cs_real_t q_h_in
Definition: cs_ctwr.h:127
cs_real_t surface_out
Definition: cs_ctwr.h:93
cs_real_t hmin
Definition: cs_ctwr.h:80
cs_real_t delta_t
Definition: cs_ctwr.h:82
cs_real_t h_l_out
Definition: cs_ctwr.h:120
int up_ct_id
Definition: cs_ctwr.h:103
cs_real_t h_h_in
Definition: cs_ctwr.h:125
cs_real_t t_l_out
Definition: cs_ctwr.h:118
cs_real_t xair_e
Definition: cs_ctwr.h:123
cs_real_t p_in
Definition: cs_ctwr.h:113
cs_real_t h_h_out
Definition: cs_ctwr.h:126
cs_real_t xleak_fac
Definition: cs_ctwr.h:96
cs_real_t xnp
Definition: cs_ctwr.h:90
cs_real_t p_out
Definition: cs_ctwr.h:114
Definition: cs_ctwr.h:142
bool rain_evap
Definition: cs_ctwr.h:146
cs_ctwr_model_t evap_model
Definition: cs_ctwr.h:144
bool has_rain
Definition: cs_ctwr.h:145
bool solve_rain_velocity
Definition: cs_ctwr.h:149
bool air_rain_friction
Definition: cs_ctwr.h:151
bool rain_to_packing
Definition: cs_ctwr.h:152
bool mixture_model
Definition: cs_ctwr.h:147