9.0
general documentation
Loading...
Searching...
No Matches
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-2025 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
39
40/*============================================================================
41 * Local Macro definitions
42 *============================================================================*/
43
44/*============================================================================
45 * Type definitions
46 *============================================================================*/
47
48/*============================================================================
49 * Type definitions
50 *============================================================================*/
51
53
54typedef enum {
55
59
61
63
71
72/* Cooling tower exchange zone structure definition */
73/*--------------------------------------------------*/
74
76
77 int num; /* Exchange zone number */
78 char *criteria; /* Exchange zone selection criteria */
79 int z_id; /* id of the volume zone */
80 char *name; /* Exchange zone name */
81 char *file_name; /* Exchange zone budget file name */
82 cs_ctwr_zone_type_t type; /* Zone type */
83
84 cs_real_t hmin; /* Minimum vertical height of exchange zone */
85 cs_real_t hmax; /* Maximum height of exchange zone */
86 cs_real_t delta_t; /* Temperature delta required for exchange zone
87 if positive */
88 cs_real_t relax; /* Relaxation of the imposed temperature */
89
90 cs_real_t t_l_bc; /* Water entry temperature */
91 cs_real_t q_l_bc; /* Water flow */
92
93 cs_real_t xap; /* Exchange law a_0 coefficient */
94 cs_real_t xnp; /* Exchange law n exponent */
95
96 cs_real_t surface_in; /* Water inlet surface */
97 cs_real_t surface_out; /* Water outlet surface */
98 cs_real_t surface; /* Total surface */
99
100 cs_real_t xleak_fac; /* Leakage factor (ratio of outlet/inlet
101 flow rate) */
102 cs_real_t v_liq_pack; /* Vertical liquid film velocity in packing */
103
104 cs_lnum_t n_cells; /* Number of air cells belonging to the zone */
105 cs_real_t vol_f; /* Cooling tower zone total volume */
106
107 int up_ct_id; /* Id of upstream exchange zone (if any) */
108
109 cs_lnum_t n_inlet_faces; /* Number of inlet faces */
110 cs_lnum_t n_outlet_faces; /* Number of outlet faces */
111 cs_lnum_t *inlet_faces_ids; /* List of inlet faces */
112 cs_lnum_t *outlet_faces_ids; /* List of outlet faces */
113
114 cs_lnum_t n_outlet_cells; /* Number of outlet cells */
115 cs_lnum_t *outlet_cells_ids; /* List of outlet cells */
116
117 cs_real_t p_in; /* Average inlet pressure */
118 cs_real_t p_out; /* Average outlet pressure */
119 cs_real_t q_l_in; /* Water entry flow */
120 cs_real_t q_l_out; /* Water exit flow */
121 cs_real_t t_l_in; /* Mean water entry temperature */
122 cs_real_t t_l_out; /* Mean water exit temperature */
123 cs_real_t h_l_in; /* Mean water entry enthalpy */
124 cs_real_t h_l_out; /* Mean water exit enthalpy */
125 cs_real_t t_h_in; /* Mean air entry temperature */
126 cs_real_t t_h_out; /* Mean air exit temperature */
127 cs_real_t xair_e; /* Mean air entry humidity */
128 cs_real_t xair_s; /* Mean air exit humidity */
129 cs_real_t h_h_in; /* Mean air entry enthalpy */
130 cs_real_t h_h_out; /* Mean air exit enthalpy */
131 cs_real_t q_h_in; /* Air entry flow */
132 cs_real_t q_h_out; /* Air exit flow */
133
134};
135
136typedef struct _cs_ctwr_zone_t cs_ctwr_zone_t;
137
139
141
142/*----------------------------------------------------------------------------
143 * Cooling Tower model options descriptor
144 *----------------------------------------------------------------------------*/
145
159
160
161/*============================================================================
162 * Static global variables
163 *============================================================================*/
164
165/* Pointer to cooling tower model options structure */
167
168/* Make number of cooling towers zones accessible */
169
170/*============================================================================
171 * Public function definitions
172 *============================================================================*/
173
174/*----------------------------------------------------------------------------
175 * Provide access to cs_ctwr_option
176 *----------------------------------------------------------------------------*/
177
180
181/*----------------------------------------------------------------------------
182 * Provide access to cs_ctwr_zone
183 *----------------------------------------------------------------------------*/
184
185cs_ctwr_zone_t **
187
188/*----------------------------------------------------------------------------
189 * Provide access to number of ct zones
190 *----------------------------------------------------------------------------*/
191
192int *
194
195
196/*----------------------------------------------------------------------------*/
213/*----------------------------------------------------------------------------*/
214
215void
216cs_ctwr_define(const char zone_criteria[],
217 int z_id,
218 cs_ctwr_zone_type_t zone_type,
219 cs_real_t delta_t,
220 cs_real_t relax,
221 cs_real_t t_l_bc,
222 cs_real_t q_l_bc,
223 cs_real_t xap,
224 cs_real_t xnp,
225 cs_real_t surface,
226 cs_real_t xleak_fac);
227
228/*----------------------------------------------------------------------------*/
232/*----------------------------------------------------------------------------*/
233
234void
236
237/*----------------------------------------------------------------------------*/
241/*----------------------------------------------------------------------------*/
242
243void
245
246/*----------------------------------------------------------------------------*/
250/*----------------------------------------------------------------------------*/
251
252void
254
255/*----------------------------------------------------------------------------*/
259/*----------------------------------------------------------------------------*/
260
261void
263
264/*----------------------------------------------------------------------------*/
268/*----------------------------------------------------------------------------*/
269
270void
272
273/*----------------------------------------------------------------------------*/
277/*----------------------------------------------------------------------------*/
278
279void
281
282/*----------------------------------------------------------------------------*/
290/*----------------------------------------------------------------------------*/
291
292void
294
295/*----------------------------------------------------------------------------
296 * Get pointer to exchange area.
297 *
298 * parameters:
299 * ct_id <-- Id (0 to n-1) of exchange area
300 *
301 * returns:
302 * pointer to exchange area structure
303 *----------------------------------------------------------------------------*/
304
305cs_ctwr_zone_t *
306cs_ctwr_by_id(int ct_id);
307
308/*----------------------------------------------------------------------------*/
309
311
312#endif /* __CS_CTWR_H__ */
cs_ctwr_option_t * cs_get_glob_ctwr_option(void)
Definition cs_ctwr.cpp:303
void cs_ctwr_log_balance(void)
Perform balances in packing zones.
Definition cs_ctwr.cpp:856
int * cs_get_glob_ctwr_n_zones(void)
Definition cs_ctwr.cpp:323
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:348
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:733
cs_ctwr_zone_type_t
Definition cs_ctwr.h:64
@ CS_CTWR_INJECTION
Definition cs_ctwr.h:68
@ CS_CTWR_COUNTER_CURRENT
Definition cs_ctwr.h:66
@ CS_CTWR_CROSS_CURRENT
Definition cs_ctwr.h:67
cs_ctwr_model_t
Definition cs_ctwr.h:54
@ CS_CTWR_MERKEL
Definition cs_ctwr.h:58
@ CS_CTWR_NONE
Definition cs_ctwr.h:56
@ CS_CTWR_POPPE
Definition cs_ctwr.h:57
void cs_ctwr_field_pointer_map(void)
Map fields used by the cooling tower module to pointers.
Definition cs_ctwr_variables.cpp:788
void cs_ctwr_build_all(void)
Define the cells belonging to the different packing zones.
Definition cs_ctwr.cpp:585
cs_ctwr_zone_t ** cs_get_glob_ctwr_zone(void)
Definition cs_ctwr.cpp:313
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:517
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:761
#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
Definition cs_ctwr.h:75
cs_real_t q_h_out
Definition cs_ctwr.h:132
cs_real_t h_l_in
Definition cs_ctwr.h:123
cs_real_t t_l_bc
Definition cs_ctwr.h:90
cs_lnum_t n_outlet_faces
Definition cs_ctwr.h:110
cs_ctwr_zone_type_t type
Definition cs_ctwr.h:82
cs_real_t q_l_out
Definition cs_ctwr.h:120
cs_real_t relax
Definition cs_ctwr.h:88
cs_lnum_t * outlet_faces_ids
Definition cs_ctwr.h:112
cs_real_t v_liq_pack
Definition cs_ctwr.h:102
cs_real_t t_h_in
Definition cs_ctwr.h:125
cs_real_t surface
Definition cs_ctwr.h:98
cs_real_t q_l_bc
Definition cs_ctwr.h:91
cs_lnum_t * inlet_faces_ids
Definition cs_ctwr.h:111
char * name
Definition cs_ctwr.h:80
cs_lnum_t n_outlet_cells
Definition cs_ctwr.h:114
cs_real_t vol_f
Definition cs_ctwr.h:105
cs_lnum_t * outlet_cells_ids
Definition cs_ctwr.h:115
cs_lnum_t n_inlet_faces
Definition cs_ctwr.h:109
cs_real_t hmax
Definition cs_ctwr.h:85
int z_id
Definition cs_ctwr.h:79
cs_lnum_t n_cells
Definition cs_ctwr.h:104
char * criteria
Definition cs_ctwr.h:78
char * file_name
Definition cs_ctwr.h:81
int num
Definition cs_ctwr.h:77
cs_real_t surface_in
Definition cs_ctwr.h:96
cs_real_t t_h_out
Definition cs_ctwr.h:126
cs_real_t xair_s
Definition cs_ctwr.h:128
cs_real_t xap
Definition cs_ctwr.h:93
cs_real_t q_l_in
Definition cs_ctwr.h:119
cs_real_t t_l_in
Definition cs_ctwr.h:121
cs_real_t q_h_in
Definition cs_ctwr.h:131
cs_real_t surface_out
Definition cs_ctwr.h:97
cs_real_t hmin
Definition cs_ctwr.h:84
cs_real_t delta_t
Definition cs_ctwr.h:86
cs_real_t h_l_out
Definition cs_ctwr.h:124
int up_ct_id
Definition cs_ctwr.h:107
cs_real_t h_h_in
Definition cs_ctwr.h:129
cs_real_t t_l_out
Definition cs_ctwr.h:122
cs_real_t xair_e
Definition cs_ctwr.h:127
cs_real_t p_in
Definition cs_ctwr.h:117
cs_real_t h_h_out
Definition cs_ctwr.h:130
cs_real_t xleak_fac
Definition cs_ctwr.h:100
cs_real_t xnp
Definition cs_ctwr.h:94
cs_real_t p_out
Definition cs_ctwr.h:118
Definition cs_ctwr.h:146
bool rain_evap
Definition cs_ctwr.h:150
cs_ctwr_model_t evap_model
Definition cs_ctwr.h:148
bool has_rain
Definition cs_ctwr.h:149
bool solve_rain_velocity
Definition cs_ctwr.h:153
bool air_rain_friction
Definition cs_ctwr.h:155
bool rain_to_packing
Definition cs_ctwr.h:156
bool mixture_model
Definition cs_ctwr.h:151