My Project
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-2019 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 
81 
82 typedef struct _cs_ctwr_zone_t cs_ctwr_zone_t;
83 
88 /*----------------------------------------------------------------------------
89  * Cooling Tower model options descriptor
90  *----------------------------------------------------------------------------*/
91 
92 typedef struct {
94  bool has_rain;
96 
97 /*============================================================================
98  * Static global variables
99  *============================================================================*/
100 
101 /* Pointer to cooling tower model options structure */
103 
104 /*============================================================================
105  * Public function definitions
106  *============================================================================*/
107 
108 /*----------------------------------------------------------------------------
109  * Provide acces to cs_ctwr_option
110  *----------------------------------------------------------------------------*/
111 
114 
115 /*----------------------------------------------------------------------------*/
131 /*----------------------------------------------------------------------------*/
132 
133 void
134 cs_ctwr_define(const char zone_criteria[],
135  cs_ctwr_zone_type_t zone_type,
137  cs_real_t relax,
138  cs_real_t t_l_bc,
139  cs_real_t q_l_bc,
140  cs_real_t xap,
141  cs_real_t xnp,
142  cs_real_t surface,
143  cs_real_t xleak_fac);
144 
145 /*----------------------------------------------------------------------------*/
149 /*----------------------------------------------------------------------------*/
150 
151 void
153 
154 /*----------------------------------------------------------------------------*/
166 /*----------------------------------------------------------------------------*/
167 
168 void
170  const cs_real_t molmassrat,
171  cs_real_t mass_source[]);
172 
173 /*----------------------------------------------------------------------------*/
178 /*----------------------------------------------------------------------------*/
179 
180 void
181 cs_ctwr_build_zones(void);
182 
183 /*----------------------------------------------------------------------------*/
188 /*----------------------------------------------------------------------------*/
189 
190 void
191 cs_ctwr_build_all(void);
192 
193 /*----------------------------------------------------------------------------*/
197 /*----------------------------------------------------------------------------*/
198 
199 void
200 cs_ctwr_all_destroy(void);
201 
202 /*----------------------------------------------------------------------------*/
206 /*----------------------------------------------------------------------------*/
207 
208 void
209 cs_ctwr_log_setup(void);
210 
211 /*----------------------------------------------------------------------------*/
215 /*----------------------------------------------------------------------------*/
216 
217 void
218 cs_ctwr_log_balance(void);
219 
220 /*----------------------------------------------------------------------------*/
229 /*----------------------------------------------------------------------------*/
230 
231 void
233  cs_real_t t0,
234  cs_real_t p0,
236 
237 /*----------------------------------------------------------------------------*/
247 /*----------------------------------------------------------------------------*/
248 
249 void
251  cs_real_t t0,
252  cs_real_t p0,
255 
256 /*----------------------------------------------------------------------------*/
263 /*----------------------------------------------------------------------------*/
264 
265 void
266 cs_ctwr_init_flow_vars(cs_real_t liq_mass_flow[]);
267 
268 /*----------------------------------------------------------------------------*/
278 /*----------------------------------------------------------------------------*/
279 
280 void
282  cs_real_t t0,
283  cs_real_t p0,
285 
286 /*----------------------------------------------------------------------------*/
297 /*----------------------------------------------------------------------------*/
298 
299 void
301  const cs_real_t p0,
302  const cs_real_t molmassrat,
303  cs_real_t exp_st[],
304  cs_real_t imp_st[]);
305 
306 /*----------------------------------------------------------------------------*/
314 /*----------------------------------------------------------------------------*/
315 
316 void
317 cs_ctwr_transport_vars(int iflag);
318 
319 /*----------------------------------------------------------------------------
320  * Get pointer to exchange area.
321  *
322  * parameters:
323  * ct_id <-- Id (0 to n-1) of exchange area
324  *
325  * returns:
326  * pointer to exchange area structure
327  *----------------------------------------------------------------------------*/
328 
330 cs_ctwr_by_id(int ct_id);
331 
332 /*----------------------------------------------------------------------------*/
333 
335 
336 #endif /* __CS_CTWR_H__ */
f_id
void const int * f_id
Definition: cs_gui.h:292
cs_ctwr_phyvar_update
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:1523
cs_ctwr_build_zones
void cs_ctwr_build_zones(void)
Define zones.
Definition: cs_ctwr.c:520
t0
void const cs_real_t const cs_real_t const cs_real_t * t0
Definition: cs_ctwr_air_props.h:128
cs_ctwr_model_t
cs_ctwr_model_t
Definition: cs_ctwr.h:65
CS_CTWR_NONE
Definition: cs_ctwr.h:67
cs_ctwr_define
void cs_ctwr_define(const char zone_criteria[], 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.c:349
cs_ctwr_init_flow_vars
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:1061
molmassrat
void const cs_real_t const cs_real_t const cs_real_t const cs_real_t * molmassrat
Definition: cs_ctwr_air_props.h:128
cs_ctwr_option_t
Definition: cs_ctwr.h:92
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_ctwr_log_setup
void cs_ctwr_log_setup(void)
Log Packing zone definition setup information.
Definition: cs_ctwr.c:625
ctincl::humidity0
real(c_double), pointer, save humidity0
Initial absolute humidity in the cooling tower.
Definition: ctincl.f90:45
CS_CTWR_CROSS_CURRENT
Definition: cs_ctwr.h:78
cs_ctwr_by_id
cs_ctwr_zone_t * cs_ctwr_by_id(int ct_id)
Definition: cs_ctwr.c:2242
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_mesh_quantities.h
delta_t
void cs_int_t cs_int_t cs_int_t cs_real_t cs_real_t cs_real_t cs_real_t cs_real_t * delta_t
Definition: cs_at_plugin.h:63
cs_ctwr_field_pointer_map
void cs_ctwr_field_pointer_map(void)
Map fields used by the cooling tower module to pointers.
Definition: cs_ctwr.c:497
cs_ctwr_transport_vars
void cs_ctwr_transport_vars(int iflag)
Convert injected liquid scalars from and to their transported form.
cs_mesh.h
cs_halo.h
cs_ctwr_option_t::has_rain
bool has_rain
Definition: cs_ctwr.h:94
cs_ctwr_restart_field_vars
void cs_ctwr_restart_field_vars(cs_real_t rho0, cs_real_t t0, cs_real_t p0, cs_real_t humidity0, cs_real_t molmassrat)
Reset the field variables based on the restart values.
Definition: cs_ctwr.c:1285
cs_ctwr_bulk_mass_source_term
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:2206
cs_ctwr_build_all
void cs_ctwr_build_all(void)
Define the cells belonging to the different packing zones.
Definition: cs_ctwr.c:565
cs_ctwr_source_term
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:1725
cs_ctwr_zone_t
struct _cs_ctwr_zone_t cs_ctwr_zone_t
Definition: cs_ctwr.h:82
cs_ctwr_init_field_vars
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:882
cs_ctwr_option_t::evap_model
int evap_model
Definition: cs_ctwr.h:93
fvm_nodal.h
CS_CTWR_POPPE
Definition: cs_ctwr.h:68
CS_CTWR_COUNTER_CURRENT
Definition: cs_ctwr.h:77
cs_ctwr_all_destroy
void cs_ctwr_all_destroy(void)
Destroy cs_ctwr_t structures.
Definition: cs_ctwr.c:595
cs_glob_ctwr_option
const cs_ctwr_option_t * cs_glob_ctwr_option
cs_ctwr_log_balance
void cs_ctwr_log_balance(void)
Perform balances in packing zones.
Definition: cs_ctwr.c:699
p0
void const cs_real_t * p0
Definition: cs_ctwr_air_props.h:85
CS_CTWR_MERKEL
Definition: cs_ctwr.h:69
cs_ctwr_zone_type_t
cs_ctwr_zone_type_t
Definition: cs_ctwr.h:75
cs_base.h
cs_get_glob_ctwr_option
cs_ctwr_option_t * cs_get_glob_ctwr_option(void)
Definition: cs_ctwr.c:325