9.2
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-2026 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 * Type definitions
38 *============================================================================*/
39
42typedef enum {
43 CS_WALL_COND_MODEL_COPAIN = 0,
44 CS_WALL_COND_MODEL_COPAIN_BD = 1,
45 CS_WALL_COND_MODEL_UCHIDA = 2,
46 CS_WALL_COND_MODEL_DEHBI = 3,
47} cs_wall_cond_natural_conv_model_t;
48
49typedef enum {
50 CS_WALL_COND_MODEL_WALL_LAW = 0,
51 CS_WALL_COND_MODEL_SCHLICHTING = 1
52} cs_wall_cond_forced_conv_model_t;
53
54typedef enum {
55 CS_WALL_COND_MIXED_MAX = 0,
56 CS_WALL_COND_MIXED_INCROPERA = 1
57} cs_wall_cond_mixed_conv_model_t;
58
59typedef struct {
60
61 int icondb;
62 int icondv;
64 int nztag1d;
67 // Model type
68 cs_wall_cond_natural_conv_model_t natural_conv_model;
69 cs_wall_cond_forced_conv_model_t forced_conv_model;
70 cs_wall_cond_mixed_conv_model_t mixed_conv_model;
71
72 /* Surface wall condensation */
73
74 // Mesh related quantities
76 cs_lnum_t nfbpcd;
78 cs_lnum_t *ifbpcd;
83 cs_lnum_t *itypcd;
86 cs_lnum_t *izzftcd;
90 cs_real_t *spcond;
94 cs_real_t *hpcond;
96 cs_real_t *twall_cond;
99 cs_real_t *thermal_condensation_flux;
101 cs_real_t *convective_htc;
103 cs_real_t *condensation_htc;
105 cs_real_t *total_htc;
108 cs_real_t *flthr;
111 cs_real_t *dflthr;
112
113 // Zone related quantities
118 cs_lnum_t nzones;
124 cs_lnum_t *izcophc;
130 cs_lnum_t *izcophg;
137 cs_lnum_t *iztag1d;
141 cs_real_t *ztpar;
144 cs_real_t *zxrefcond;
145 cs_real_t *zprojcond;
146
147 /* Volume wall condensation */
148
151 cs_lnum_t ncmast;
156 cs_lnum_t nvolumes;
159 cs_lnum_t *ltmast;
164 cs_lnum_t *itypst;
167 cs_lnum_t *izmast;
172 cs_real_t *svcond;
176 cs_real_t *flxmst;
184 cs_lnum_t *itagms;
185
186} cs_wall_condensation_t;
187
188/*============================================================================
189 * Static global variables
190 *============================================================================*/
191
192/* Pointer to wall condensation descriptor structure */
193extern const cs_wall_condensation_t *cs_glob_wall_condensation;
194
197/*=============================================================================
198 * Public function prototypes
199 *============================================================================*/
200
201/*----------------------------------------------------------------------------*/
202/*
203 * \brief Provide writable access to _wall_cond structure.
204 *
205 * \return pointer to global wall_cond structure
206 */
207/*----------------------------------------------------------------------------*/
208
209cs_wall_condensation_t *
211
212/*----------------------------------------------------------------------------*/
213/*
214 * \brief Set the wall condensation model
215 *
216 * \param[in] model integer corresponding to the desired model
217 */
218/*----------------------------------------------------------------------------*/
219
220void
221cs_wall_condensation_set_model(cs_wall_cond_natural_conv_model_t model);
222
223/*----------------------------------------------------------------------------*/
224/*
225 * \brief Set the onoff state of wall condensation modeling
226 *
227 * \param[in] icondb integer corresponding to the onoff state (-1: off, 0: on)
228 * \param[in] icondv integer corresponding to the onoff state with
229 * metal structures (-1: off, 0: on)
230 */
231/*----------------------------------------------------------------------------*/
232
233void
235 int icondv);
236
237/*----------------------------------------------------------------------------*/
238/*
239 * \brief Create the context for wall condensation models.
240 */
241/*----------------------------------------------------------------------------*/
242
243void
245
246/*----------------------------------------------------------------------------*/
247/*
248 * \brief Free all structures related to wall condensation models
249 */
250/*----------------------------------------------------------------------------*/
251
252void
254
255/*----------------------------------------------------------------------------*/
256/*
257 * \brief Initialize wall condensation models.
258 *
259 * This includes building the associated meshes.
260 */
261/*----------------------------------------------------------------------------*/
262
263void
265
266/*----------------------------------------------------------------------------*/
267/*
268 * \brief Reset values
269 *
270 * \param[in] wall_cond wall_condensation strucutre
271 * \param[in] n_var number of variable
272 *
273 */
274/*----------------------------------------------------------------------------*/
275
276void
277cs_wall_condensation_reset(cs_wall_condensation_t *wall_cond, const int n_var);
278
279/*----------------------------------------------------------------------------*/
280/*
281 * \brief Return condensing volume structures surface at each cell.
282 *
283 * \param[out] surf array of volume structure surfaces at each cell
284 */
285/*----------------------------------------------------------------------------*/
286
287void
289
290/*----------------------------------------------------------------------------*/
291/*
292 * \brief Compute the wall condensation source terms.
293 */
294/*----------------------------------------------------------------------------*/
295
296void
298
299/*----------------------------------------------------------------------------*/
300/*
301 * \brief Output statistics about wall condensation source terms (for user log)
302 */
303/*----------------------------------------------------------------------------*/
304
305void
307
308/*----------------------------------------------------------------------------*/
309/*
310 * \brief Explicit and implicit sources terms from sources
311 * condensation computation.
312 *
313 * \param[in] f pointer to field structure
314 * \param[in] xcpp array of specific heat (Cp)
315 * \param[in] pvara variable value at time step beginning
316 * \param[in,out] st_exp explicit source term part linear in the variable
317 * \param[in,out] st_imp associated value with \c tsexp
318 * to be stored in the matrix
319 */
320/*----------------------------------------------------------------------------*/
321
322void
324 const cs_real_t xcpp[],
325 const cs_real_t pvara[],
326 cs_real_t st_exp[],
327 cs_real_t st_imp[]);
328
329/*----------------------------------------------------------------------------*/
330
331#endif /* CS_WALL_CONDENSATION_H */
Field descriptor.
Definition: cs_field.h:275
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
const cs_wall_condensation_t * cs_glob_wall_condensation
Definition: cs_wall_condensation.cpp:161
cs_wall_condensation_t * cs_get_glob_wall_condensation(void)
Provide writable access to _wall_cond structure.
Definition: cs_wall_condensation.cpp:768
void cs_wall_condensation_free(void)
Free all structures related to wall condensation models.
Definition: cs_wall_condensation.cpp:915
void cs_wall_condensation_create(void)
Create the context for wall condensation models.
Definition: cs_wall_condensation.cpp:812
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:1287
void cs_wall_condensation_log(void)
Output statistics about wall condensation source terms (for user log)
Definition: cs_wall_condensation.cpp:1177
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:1019
void cs_wall_condensation_set_onoff_state(int icondb, int icondv)
Set the onoff state of wall condensation modeling.
Definition: cs_wall_condensation.cpp:798
void cs_wall_condensation_reset(cs_wall_condensation_t *wall_cond, const int n_var)
Definition: cs_wall_condensation.cpp:1051
void cs_wall_condensation_compute(cs_real_t total_htc[])
Compute the wall condensation source terms.
Definition: cs_wall_condensation.cpp:1077
void cs_wall_condensation_set_model(cs_wall_cond_natural_conv_model_t model)
Set the wall condensation model.
Definition: cs_wall_condensation.cpp:782
void cs_wall_condensation_initialize(void)
Initialize wall condensation models.
Definition: cs_wall_condensation.cpp:955