8.3
general documentation
cs_wall_condensation.h
Go to the documentation of this file.
1#ifndef __CS_WALL_CONDENSATION_H__
2#define __CS_WALL_CONDENSATION_H__
3
4/*============================================================================
5 * Base wall condensation model.
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 "cs_defs.h"
35
36/*----------------------------------------------------------------------------*/
37
39
40/*============================================================================
41 * Type definitions
42 *============================================================================*/
43
46typedef enum {
47 CS_WALL_COND_MODEL_COPAIN = 0,
48 CS_WALL_COND_MODEL_COPAIN_BD = 1,
49 CS_WALL_COND_MODEL_UCHIDA = 2,
50 CS_WALL_COND_MODEL_DEHBI = 3,
51} cs_wall_cond_natural_conv_model_t;
52
53typedef enum {
54 CS_WALL_COND_MODEL_WALL_LAW = 0,
55 CS_WALL_COND_MODEL_SCHLICHTING = 1
56} cs_wall_cond_forced_conv_model_t;
57
58typedef enum {
59 CS_WALL_COND_MIXED_MAX = 0,
60 CS_WALL_COND_MIXED_INCROPERA = 1
61} cs_wall_cond_mixed_conv_model_t;
62
63typedef struct {
64
65 int icondb;
66 int icondv;
68 int nztag1d;
71 // Model type
72 cs_wall_cond_natural_conv_model_t natural_conv_model;
73 cs_wall_cond_forced_conv_model_t forced_conv_model;
74 cs_wall_cond_mixed_conv_model_t mixed_conv_model;
75
76 /* Surface wall condensation */
77
78 // Mesh related quantities
80 cs_lnum_t nfbpcd;
82 cs_lnum_t *ifbpcd;
87 cs_lnum_t *itypcd;
90 cs_lnum_t *izzftcd;
94 cs_real_t *spcond;
98 cs_real_t *hpcond;
100 cs_real_t *twall_cond;
103 cs_real_t *thermal_condensation_flux;
105 cs_real_t *convective_htc;
107 cs_real_t *condensation_htc;
109 cs_real_t *total_htc;
112 cs_real_t *flthr;
115 cs_real_t *dflthr;
116
117 // Zone related quantities
122 cs_lnum_t nzones;
128 cs_lnum_t *izcophc;
134 cs_lnum_t *izcophg;
141 cs_lnum_t *iztag1d;
145 cs_real_t *ztpar;
148 cs_real_t *zxrefcond;
149 cs_real_t *zprojcond;
150
151 /* Volume wall condensation */
152
155 cs_lnum_t ncmast;
160 cs_lnum_t nvolumes;
163 cs_lnum_t *ltmast;
168 cs_lnum_t *itypst;
171 cs_lnum_t *izmast;
176 cs_real_t *svcond;
180 cs_real_t *flxmst;
188 cs_lnum_t *itagms;
189
190} cs_wall_condensation_t;
191
192/*============================================================================
193 * Static global variables
194 *============================================================================*/
195
196/* Pointer to wall condensation descriptor structure */
197extern const cs_wall_condensation_t *cs_glob_wall_condensation;
198
201/*=============================================================================
202 * Public function prototypes
203 *============================================================================*/
204
205/*----------------------------------------------------------------------------*/
206/*
207 * \brief Provide writable access to _wall_cond structure.
208 *
209 * \return pointer to global wall_cond structure
210 */
211/*----------------------------------------------------------------------------*/
212
213cs_wall_condensation_t *
215
216/*----------------------------------------------------------------------------*/
217/*
218 * \brief Set the wall condensation model
219 *
220 * \param[in] model integer corresponding to the desired model
221 */
222/*----------------------------------------------------------------------------*/
223
224void
225cs_wall_condensation_set_model(cs_wall_cond_natural_conv_model_t model);
226
227/*----------------------------------------------------------------------------*/
228/*
229 * \brief Set the onoff state of wall condensation modeling
230 *
231 * \param[in] icondb integer corresponding to the onoff state (-1: off, 0: on)
232 * \param[in] icondv integer corresponding to the onoff state with
233 * metal structures (-1: off, 0: on)
234 */
235/*----------------------------------------------------------------------------*/
236
237void
239 int icondv);
240
241/*----------------------------------------------------------------------------*/
242/*
243 * \brief Create the context for wall condensation models.
244 */
245/*----------------------------------------------------------------------------*/
246
247void
249
250/*----------------------------------------------------------------------------*/
251/*
252 * \brief Free all structures related to wall condensation models
253 */
254/*----------------------------------------------------------------------------*/
255
256void
258
259/*----------------------------------------------------------------------------*/
260/*
261 * \brief Initialize wall condensation models.
262 *
263 * This includes building the associated meshes.
264 */
265/*----------------------------------------------------------------------------*/
266
267void
269
270/*----------------------------------------------------------------------------*/
271/*
272 * \brief Reset values
273 *
274 * \param[in] wall_cond wall_condensation strucutre
275 * \param[in] n_var number of variable
276 *
277 */
278/*----------------------------------------------------------------------------*/
279
280void
281cs_wall_condensation_reset(cs_wall_condensation_t *wall_cond, const int n_var);
282
283/*----------------------------------------------------------------------------*/
284/*
285 * \brief Return condensing volume structures surface at each cell.
286 *
287 * \param[out] surf array of volume structure surfaces at each cell
288 */
289/*----------------------------------------------------------------------------*/
290
291void
293
294/*----------------------------------------------------------------------------*/
295/*
296 * \brief Compute the wall condensation source terms.
297 */
298/*----------------------------------------------------------------------------*/
299
300void
302
303/*----------------------------------------------------------------------------*/
304/*
305 * \brief Output statistics about wall condensation source terms (for user log)
306 */
307/*----------------------------------------------------------------------------*/
308
309void
311
312/*----------------------------------------------------------------------------*/
313/*
314 * \brief Explicit and implicit sources terms from sources
315 * condensation computation.
316 *
317 * \param[in] f pointer to field structure
318 * \param[in] xcpp array of specific heat (Cp)
319 * \param[in] pvara variable value at time step beginning
320 * \param[in,out] st_exp explicit source term part linear in the variable
321 * \param[in,out] st_imp associated value with \c tsexp
322 * to be stored in the matrix
323 */
324/*----------------------------------------------------------------------------*/
325
326void
328 const cs_real_t xcpp[],
329 const cs_real_t pvara[],
330 cs_real_t st_exp[],
331 cs_real_t st_imp[]);
332
333/*----------------------------------------------------------------------------*/
334
336
337#endif /* __CS_WALL_CONDENSATION_H__ */
#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
const cs_wall_condensation_t * cs_glob_wall_condensation
Definition: cs_wall_condensation.cpp:163
cs_wall_condensation_t * cs_get_glob_wall_condensation(void)
Provide writable access to _wall_cond structure.
Definition: cs_wall_condensation.cpp:796
void cs_wall_condensation_free(void)
Free all structures related to wall condensation models.
Definition: cs_wall_condensation.cpp:943
void cs_wall_condensation_create(void)
Create the context for wall condensation models.
Definition: cs_wall_condensation.cpp:840
void cs_wall_condensation_source_terms(const cs_field_t *f, const cs_real_t xcpp[], const cs_real_t pvara[], cs_real_t st_exp[], cs_real_t st_imp[])
Explicit and implicit sources terms from sources condensation computation.
Definition: cs_wall_condensation.cpp:1317
void cs_wall_condensation_log(void)
Output statistics about wall condensation source terms (for user log)
Definition: cs_wall_condensation.cpp:1207
void cs_wall_condensation_volume_exchange_surf_at_cells(cs_real_t *surf)
Return condensing volume structures surface at each cell.
Definition: cs_wall_condensation.cpp:1049
void cs_wall_condensation_set_onoff_state(int icondb, int icondv)
Set the onoff state of wall condensation modeling.
Definition: cs_wall_condensation.cpp:826
void cs_wall_condensation_reset(cs_wall_condensation_t *wall_cond, const int n_var)
Definition: cs_wall_condensation.cpp:1081
void cs_wall_condensation_compute(cs_real_t total_htc[])
Compute the wall condensation source terms.
Definition: cs_wall_condensation.cpp:1107
void cs_wall_condensation_set_model(cs_wall_cond_natural_conv_model_t model)
Set the wall condensation model.
Definition: cs_wall_condensation.cpp:810
void cs_wall_condensation_initialize(void)
Initialize wall condensation models.
Definition: cs_wall_condensation.cpp:983
integer(c_int), pointer, save icondv
Specific condensation modelling if = -1 module not activated if = 0 condensation source terms with me...
Definition: ppincl.f90:255
integer(c_int), pointer, save icondb
Specific condensation modelling if = -1 module not activated if = 0 condensation source terms activat...
Definition: ppincl.f90:249
Field descriptor.
Definition: cs_field.h:131