8.3
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-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/*----------------------------------------------------------------------------
31 * Local headers
32 *----------------------------------------------------------------------------*/
33
34#include "fvm_nodal.h"
35
36#include "cs_base.h"
37#include "cs_halo.h"
38#include "cs_mesh.h"
39#include "cs_mesh_quantities.h"
40
41/*----------------------------------------------------------------------------*/
42
44
45/*============================================================================
46 * Local Macro definitions
47 *============================================================================*/
48
49/*============================================================================
50 * Type definitions
51 *============================================================================*/
52
53/*============================================================================
54 * Type definitions
55 *============================================================================*/
56
59typedef enum {
60
66
69typedef enum {
70
76
77/* Cooling tower exchange zone structure definition */
78/*--------------------------------------------------*/
79
81
82 int num; /* Exchange zone number */
83 char *criteria; /* Exchange zone selection criteria */
84 int z_id; /* id of the volume zone */
85 char *name; /* Exchange zone name */
86 char *file_name; /* Exchange zone budget file name */
87 cs_ctwr_zone_type_t type; /* Zone type */
88
89 cs_real_t hmin; /* Minimum vertical height of exchange zone */
90 cs_real_t hmax; /* Maximum height of exchange zone */
91 cs_real_t delta_t; /* Temperature delta required for exchange zone
92 if positive */
93 cs_real_t relax; /* Relaxation of the imposed temperature */
94
95 cs_real_t t_l_bc; /* Water entry temperature */
96 cs_real_t q_l_bc; /* Water flow */
97
98 cs_real_t xap; /* Exchange law a_0 coefficient */
99 cs_real_t xnp; /* Exchange law n exponent */
100
101 cs_real_t surface_in; /* Water inlet surface */
102 cs_real_t surface_out; /* Water outlet surface */
103 cs_real_t surface; /* Total surface */
104
105 cs_real_t xleak_fac; /* Leakage factor (ratio of outlet/inlet
106 flow rate) */
107 cs_real_t v_liq_pack; /* Vertical liquid film velocity in packing */
108
109 cs_lnum_t n_cells; /* Number of air cells belonging to the zone */
110 cs_real_t vol_f; /* Cooling tower zone total volume */
111
112 int up_ct_id; /* Id of upstream exchange zone (if any) */
113
114 cs_lnum_t n_inlet_faces; /* Number of inlet faces */
115 cs_lnum_t n_outlet_faces; /* Number of outlet faces */
116 cs_lnum_t *inlet_faces_ids; /* List of inlet faces */
117 cs_lnum_t *outlet_faces_ids; /* List of outlet faces */
118
119 cs_lnum_t n_outlet_cells; /* Number of outlet cells */
120 cs_lnum_t *outlet_cells_ids; /* List of outlet cells */
121
122 cs_real_t p_in; /* Average inlet pressure */
123 cs_real_t p_out; /* Average outlet pressure */
124 cs_real_t q_l_in; /* Water entry flow */
125 cs_real_t q_l_out; /* Water exit flow */
126 cs_real_t t_l_in; /* Mean water entry temperature */
127 cs_real_t t_l_out; /* Mean water exit temperature */
128 cs_real_t h_l_in; /* Mean water entry enthalpy */
129 cs_real_t h_l_out; /* Mean water exit enthalpy */
130 cs_real_t t_h_in; /* Mean air entry temperature */
131 cs_real_t t_h_out; /* Mean air exit temperature */
132 cs_real_t xair_e; /* Mean air entry humidity */
133 cs_real_t xair_s; /* Mean air exit humidity */
134 cs_real_t h_h_in; /* Mean air entry enthalpy */
135 cs_real_t h_h_out; /* Mean air exit enthalpy */
136 cs_real_t q_h_in; /* Air entry flow */
137 cs_real_t q_h_out; /* Air exit flow */
138
139};
140
141typedef struct _cs_ctwr_zone_t cs_ctwr_zone_t;
142
147/*----------------------------------------------------------------------------
148 * Cooling Tower model options descriptor
149 *----------------------------------------------------------------------------*/
150
151typedef struct {
152
164
165
166/*============================================================================
167 * Static global variables
168 *============================================================================*/
169
170/* Pointer to cooling tower model options structure */
172
173/* Make number of cooling towers zones accessible */
174
175/*============================================================================
176 * Public function definitions
177 *============================================================================*/
178
179/*----------------------------------------------------------------------------
180 * Provide access to cs_ctwr_option
181 *----------------------------------------------------------------------------*/
182
185
186/*----------------------------------------------------------------------------
187 * Provide access to cs_ctwr_zone
188 *----------------------------------------------------------------------------*/
189
190cs_ctwr_zone_t **
192
193/*----------------------------------------------------------------------------
194 * Provide access to number of ct zones
195 *----------------------------------------------------------------------------*/
196
197int *
199
200
201/*----------------------------------------------------------------------------*/
218/*----------------------------------------------------------------------------*/
219
220void
221cs_ctwr_define(const char zone_criteria[],
222 int z_id,
223 cs_ctwr_zone_type_t zone_type,
224 cs_real_t delta_t,
225 cs_real_t relax,
226 cs_real_t t_l_bc,
227 cs_real_t q_l_bc,
228 cs_real_t xap,
229 cs_real_t xnp,
230 cs_real_t surface,
231 cs_real_t xleak_fac);
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/*----------------------------------------------------------------------------*/
282/*----------------------------------------------------------------------------*/
283
284void
286
287/*----------------------------------------------------------------------------*/
295/*----------------------------------------------------------------------------*/
296
297void
299
300/*----------------------------------------------------------------------------
301 * Get pointer to exchange area.
302 *
303 * parameters:
304 * ct_id <-- Id (0 to n-1) of exchange area
305 *
306 * returns:
307 * pointer to exchange area structure
308 *----------------------------------------------------------------------------*/
309
310cs_ctwr_zone_t *
311cs_ctwr_by_id(int ct_id);
312
313/*----------------------------------------------------------------------------*/
314
316
317#endif /* __CS_CTWR_H__ */
cs_ctwr_option_t * cs_get_glob_ctwr_option(void)
Definition: cs_ctwr.cpp:307
void cs_ctwr_log_balance(void)
Perform balances in packing zones.
Definition: cs_ctwr.cpp:860
int * cs_get_glob_ctwr_n_zones(void)
Definition: cs_ctwr.cpp:327
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:352
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:737
cs_ctwr_zone_type_t
Definition: cs_ctwr.h:69
@ CS_CTWR_INJECTION
Definition: cs_ctwr.h:73
@ CS_CTWR_COUNTER_CURRENT
Definition: cs_ctwr.h:71
@ CS_CTWR_CROSS_CURRENT
Definition: cs_ctwr.h:72
cs_ctwr_model_t
Definition: cs_ctwr.h:59
@ CS_CTWR_MERKEL
Definition: cs_ctwr.h:63
@ CS_CTWR_NONE
Definition: cs_ctwr.h:61
@ CS_CTWR_POPPE
Definition: cs_ctwr.h:62
void cs_ctwr_field_pointer_map(void)
Map fields used by the cooling tower module to pointers.
Definition: cs_ctwr_variables.cpp:794
void cs_ctwr_build_all(void)
Define the cells belonging to the different packing zones.
Definition: cs_ctwr.cpp:589
cs_ctwr_zone_t ** cs_get_glob_ctwr_zone(void)
Definition: cs_ctwr.cpp:317
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:521
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:765
#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:80
cs_real_t q_h_out
Definition: cs_ctwr.h:137
cs_real_t h_l_in
Definition: cs_ctwr.h:128
cs_real_t t_l_bc
Definition: cs_ctwr.h:95
cs_lnum_t n_outlet_faces
Definition: cs_ctwr.h:115
cs_ctwr_zone_type_t type
Definition: cs_ctwr.h:87
cs_real_t q_l_out
Definition: cs_ctwr.h:125
cs_real_t relax
Definition: cs_ctwr.h:93
cs_lnum_t * outlet_faces_ids
Definition: cs_ctwr.h:117
cs_real_t v_liq_pack
Definition: cs_ctwr.h:107
cs_real_t t_h_in
Definition: cs_ctwr.h:130
cs_real_t surface
Definition: cs_ctwr.h:103
cs_real_t q_l_bc
Definition: cs_ctwr.h:96
cs_lnum_t * inlet_faces_ids
Definition: cs_ctwr.h:116
char * name
Definition: cs_ctwr.h:85
cs_lnum_t n_outlet_cells
Definition: cs_ctwr.h:119
cs_real_t vol_f
Definition: cs_ctwr.h:110
cs_lnum_t * outlet_cells_ids
Definition: cs_ctwr.h:120
cs_lnum_t n_inlet_faces
Definition: cs_ctwr.h:114
cs_real_t hmax
Definition: cs_ctwr.h:90
int z_id
Definition: cs_ctwr.h:84
cs_lnum_t n_cells
Definition: cs_ctwr.h:109
char * criteria
Definition: cs_ctwr.h:83
char * file_name
Definition: cs_ctwr.h:86
int num
Definition: cs_ctwr.h:82
cs_real_t surface_in
Definition: cs_ctwr.h:101
cs_real_t t_h_out
Definition: cs_ctwr.h:131
cs_real_t xair_s
Definition: cs_ctwr.h:133
cs_real_t xap
Definition: cs_ctwr.h:98
cs_real_t q_l_in
Definition: cs_ctwr.h:124
cs_real_t t_l_in
Definition: cs_ctwr.h:126
cs_real_t q_h_in
Definition: cs_ctwr.h:136
cs_real_t surface_out
Definition: cs_ctwr.h:102
cs_real_t hmin
Definition: cs_ctwr.h:89
cs_real_t delta_t
Definition: cs_ctwr.h:91
cs_real_t h_l_out
Definition: cs_ctwr.h:129
int up_ct_id
Definition: cs_ctwr.h:112
cs_real_t h_h_in
Definition: cs_ctwr.h:134
cs_real_t t_l_out
Definition: cs_ctwr.h:127
cs_real_t xair_e
Definition: cs_ctwr.h:132
cs_real_t p_in
Definition: cs_ctwr.h:122
cs_real_t h_h_out
Definition: cs_ctwr.h:135
cs_real_t xleak_fac
Definition: cs_ctwr.h:105
cs_real_t xnp
Definition: cs_ctwr.h:99
cs_real_t p_out
Definition: cs_ctwr.h:123
Definition: cs_ctwr.h:151
bool rain_evap
Definition: cs_ctwr.h:155
cs_ctwr_model_t evap_model
Definition: cs_ctwr.h:153
bool has_rain
Definition: cs_ctwr.h:154
bool solve_rain_velocity
Definition: cs_ctwr.h:158
bool air_rain_friction
Definition: cs_ctwr.h:160
bool rain_to_packing
Definition: cs_ctwr.h:161
bool mixture_model
Definition: cs_ctwr.h:156