programmer's documentation
cs_ctwr.h
Go to the documentation of this file.
1 #ifndef __CS_CTWR_H__
2 #define __CS_CTWR_H__
3 
4 /*============================================================================
5  * Main for 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-2018 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  * PLE library headers
32  *----------------------------------------------------------------------------*/
33 
34 #include <ple_locator.h>
35 
36 /*----------------------------------------------------------------------------
37  * Local headers
38  *----------------------------------------------------------------------------*/
39 
40 #include "fvm_nodal.h"
41 
42 #include "cs_base.h"
43 #include "cs_halo.h"
44 #include "cs_mesh.h"
45 #include "cs_mesh_quantities.h"
46 
47 /*----------------------------------------------------------------------------*/
48 
50 
51 /*============================================================================
52  * Local Macro definitions
53  *============================================================================*/
54 
55 /*============================================================================
56  * Type definitions
57  *============================================================================*/
58 
59 /*============================================================================
60  * Type definitions
61  *============================================================================*/
62 
65 typedef enum {
66 
72 
75 typedef enum {
76 
82 
83 typedef struct _cs_ctwr_zone_t cs_ctwr_zone_t;
84 
89 /*============================================================================
90  * Static global variables
91  *============================================================================*/
92 
93 /*============================================================================
94  * Public function definitions
95  *============================================================================*/
96 
97 /*----------------------------------------------------------------------------*/
113 /*----------------------------------------------------------------------------*/
114 
115 void
116 cs_ctwr_define(const char zone_criteria[],
117  cs_ctwr_model_t model,
118  cs_ctwr_zone_type_t zone_type,
119  cs_real_t delta_t,
120  cs_real_t relax,
121  cs_real_t t_l_bc,
122  cs_real_t q_l_bc,
123  cs_real_t xap,
124  cs_real_t xnp,
125  cs_real_t surface);
126 
127 /*----------------------------------------------------------------------------*/
131 /*----------------------------------------------------------------------------*/
132 
133 void
135 
136 /*----------------------------------------------------------------------------*/
148 /*----------------------------------------------------------------------------*/
149 
150 void
152  const cs_real_t molmassrat,
153  cs_real_t mass_source[]);
154 
155 /*----------------------------------------------------------------------------*/
160 /*----------------------------------------------------------------------------*/
161 
162 void
163 cs_ctwr_build_zones(void);
164 
165 /*----------------------------------------------------------------------------*/
170 /*----------------------------------------------------------------------------*/
171 
172 void
173 cs_ctwr_build_all(void);
174 
175 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 
181 void
182 cs_ctwr_all_destroy(void);
183 
184 /*----------------------------------------------------------------------------*/
188 /*----------------------------------------------------------------------------*/
189 
190 void
191 cs_ctwr_log_setup(void);
192 
193 /*----------------------------------------------------------------------------*/
197 /*----------------------------------------------------------------------------*/
198 
199 void
200 cs_ctwr_log_balance(void);
201 
202 /*----------------------------------------------------------------------------*/
211 /*----------------------------------------------------------------------------*/
212 
213 void
215  cs_real_t t0,
216  cs_real_t p0,
217  cs_real_t molmassrat);
218 
219 /*----------------------------------------------------------------------------*/
226 /*----------------------------------------------------------------------------*/
227 
228 void
229 cs_ctwr_init_flow_vars(cs_real_t liq_mass_flow[]);
230 
231 /*----------------------------------------------------------------------------*/
241 /*----------------------------------------------------------------------------*/
242 
243 void
245  cs_real_t t0,
246  cs_real_t p0,
247  cs_real_t molmassrat);
248 
249 /*----------------------------------------------------------------------------*/
260 /*----------------------------------------------------------------------------*/
261 
262 void
263 cs_ctwr_source_term(int f_id,
264  const cs_real_t p0,
265  const cs_real_t molmassrat,
266  cs_real_t exp_st[],
267  cs_real_t imp_st[]);
268 
269 /*----------------------------------------------------------------------------*/
277 /*----------------------------------------------------------------------------*/
278 
279 void
280 cs_ctwr_transport_vars(int iflag);
281 
282 /*----------------------------------------------------------------------------
283  * Get pointer to exchange area.
284  *
285  * parameters:
286  * ct_id <-- Id (0 to n-1) of exchange area
287  *
288  * returns:
289  * pointer to exchange area structure
290  *----------------------------------------------------------------------------*/
291 
293 cs_ctwr_by_id(int ct_id);
294 
295 /*----------------------------------------------------------------------------*/
296 
298 
299 #endif /* __CS_CTWR_H__ */
void cs_ctwr_log_balance(void)
Perform balances in packing zones.
Definition: cs_ctwr.c:634
Definition: cs_ctwr.h:67
void cs_ctwr_build_all(void)
Define the cells belonging to the different packing zones.
Definition: cs_ctwr.c:517
void cs_ctwr_bulk_mass_source_term(const cs_real_t p0, const cs_real_t molmassrat, cs_real_t mass_source[])
Phase change mass source term from the evaporating liquid to the bulk, humid air. ...
Definition: cs_ctwr.c:1782
void cs_ctwr_log_setup(void)
Log Packing zone definition setup information.
Definition: cs_ctwr.c:574
Definition: cs_ctwr.h:78
#define BEGIN_C_DECLS
Definition: cs_defs.h:451
void cs_ctwr_define(const char zone_criteria[], cs_ctwr_model_t model, 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)
Define a cooling tower exchange zone.
Definition: cs_ctwr.c:350
void cs_ctwr_all_destroy(void)
Destroy cs_ctwr_t structures.
Definition: cs_ctwr.c:545
void cs_ctwr_transport_vars(int iflag)
Convert injected liquid scalars from and to their transported form.
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
Definition: cs_ctwr.h:69
void cs_ctwr_build_zones(void)
Define zones.
Definition: cs_ctwr.c:486
real(c_double), pointer, save p0
reference pressure for the total pressure.
Definition: cstphy.f90:169
Definition: cs_ctwr.h:68
cs_ctwr_zone_type_t
Definition: cs_ctwr.h:75
cs_ctwr_model_t
Definition: cs_ctwr.h:65
void cs_ctwr_source_term(int f_id, const cs_real_t p0, const cs_real_t molmassrat, cs_real_t exp_st[], cs_real_t imp_st[])
Phase change source terms - Exchange terms between the injected liquid and the water vapor phase in t...
Definition: cs_ctwr.c:1414
real(c_double), pointer, save t0
reference temperature.
Definition: cstphy.f90:216
void cs_ctwr_init_flow_vars(cs_real_t liq_mass_flow[])
Initialize the flow variables relevant to the cooling tower scalars inside the packing zones...
Definition: cs_ctwr.c:1003
void cs_ctwr_phyvar_update(cs_real_t rho0, cs_real_t t0, cs_real_t p0, cs_real_t molmassrat)
Update the thermo physical properties fields for the humid air and the liquid.
Definition: cs_ctwr.c:1224
cs_ctwr_zone_t * cs_ctwr_by_id(int ct_id)
Definition: cs_ctwr.c:1818
struct _cs_ctwr_zone_t cs_ctwr_zone_t
Definition: cs_ctwr.h:83
#define END_C_DECLS
Definition: cs_defs.h:452
void cs_ctwr_init_field_vars(cs_real_t rho0, cs_real_t t0, cs_real_t p0, cs_real_t molmassrat)
Initialize the field variables.
Definition: cs_ctwr.c:823
void cs_ctwr_field_pointer_map(void)
Map fields used by the cooling tower module to pointers.
Definition: cs_ctwr.c:463
Definition: cs_ctwr.h:79
Definition: cs_ctwr.h:77