8.3
general documentation
cs_1d_wall_thermal.h
Go to the documentation of this file.
1#ifndef __CS_1D_WALL_THERMAL_H__
2#define __CS_1D_WALL_THERMAL_H__
3
4/*============================================================================
5 * Modelling the thermal wall with 1D approach
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 * Standard C library headers
32 *----------------------------------------------------------------------------*/
33
34/*----------------------------------------------------------------------------
35 * Local headers
36 *----------------------------------------------------------------------------*/
37
38#include "cs_base.h"
39
40/*----------------------------------------------------------------------------*/
41
43
44/*=============================================================================
45 * Macro definitions
46 *============================================================================*/
47
48/*============================================================================
49 * Type definitions
50 *============================================================================*/
51
52/*----------------------------------------------------------------------------
53 * 1D Wall Thermal local model type (local to a coupled boundary face)
54 *----------------------------------------------------------------------------*/
55
56typedef struct {
57
58 int nppt1d; /* Number of discretisation cells in the 1D wall
59 * at a given boundary face which is coupled
60 * with a 1D wall thermal module.*/
61
62 int iclt1d; /* Boundary condition type at the external (pseudo)
63 * wall:
64 - 1: Dirichlet,
65 - 2: Flux condition. */
66
67 cs_real_t eppt1d; /* Thickness of the 1D wall for the nfpt1d boundary faces
68 * which are coupled with a 1D wall thermal module. */
69
70 cs_real_t rgpt1d; /* Geometry of the pseudo wall mesh (refined as a fluid
71 * if rgt1d is smaller than 1.*/
72
73 cs_real_t tept1d; /* External temperature of the pseudo wall in the Dirichlet
74 * case. */
75
76 cs_real_t hept1d; /* External coefficient of transfer in the pseudo wall
77 * under Dirichlet conditions, in W.m^-2.K. */
78
79 cs_real_t fept1d; /* External heat flux in the pseudo wall under the flux
80 * conditions (in W.m^-2, negative value for energy
81 * entering the wall). */
82
83 cs_real_t xlmbt1; /* Thermal diffusivity. */
84
85 cs_real_t rcpt1d; /* Volumetric heat capacity rho C_p of the wall uniform
86 * in thickness (in J.m^-3.K^-1). */
87
88 cs_real_t dtpt1d; /* Physical time step associated with the solved 1D equation
89 * of the pseudo wall (which can be different from the time
90 * step of the calculation). */
91
92 cs_real_t *z; /* Discretization points coordinates. */
93
94 cs_real_t *t; /* Temperature at each point of discretization. */
95
97
98/*----------------------------------------------------------------------------
99 * 1D Wall Thermal module type
100 *----------------------------------------------------------------------------*/
101
102typedef struct {
103
104 cs_lnum_t nfpt1d; /* Number of boundary faces which are coupled
105 * with a 1D wall thermal module. */
106
107 cs_gnum_t nfpt1t; /* Global number of boundary faces which are coupled with
108 * a 1D wall thermal module, i.e. sum of nfpt1d over all
109 * ranks */
110
111 int nmxt1d; /* Maximum number of discretization cells in 1d wall */
112
113 bool use_restart; /* Use restart file if present ? */
114
115 cs_lnum_t *izft1d; /* Zones of t1d, dimensioned with nfabor */
116
117 cs_lnum_t *ifpt1d; /* Array allowing to mark out the numbers of
118 * the nfpt1d boundary faces which are coupled with
119 * a 1D wall. */
120
121 cs_real_t *tppt1d; /* Initialisation temperature of the wall (uniform in
122 * thickness). During the calculation, the array stores
123 * the temperature of the solid at the fluid/solid
124 * interface. */
125
127
129
130/*============================================================================
131 * Static global variables
132 *============================================================================*/
133
134/* Pointer to the 1D wall thermal structure */
135
137
138/*============================================================================
139 * Public function prototypes
140 *============================================================================*/
141
142 /*----------------------------------------------------------------------------*/
146/*----------------------------------------------------------------------------*/
147
148void
150
151/*----------------------------------------------------------------------------*/
155/*----------------------------------------------------------------------------*/
156
157void
159
160/*----------------------------------------------------------------------------*/
164/*----------------------------------------------------------------------------*/
165
166void
168
169/*----------------------------------------------------------------------------*/
178/*----------------------------------------------------------------------------*/
179
180void
182 cs_real_t tf,
183 cs_real_t hf);
184
185/*----------------------------------------------------------------------------*/
189/*----------------------------------------------------------------------------*/
190
191void
193
194/*----------------------------------------------------------------------------*/
198/*----------------------------------------------------------------------------*/
199
200void
202
203/*----------------------------------------------------------------------------*/
207/*----------------------------------------------------------------------------*/
208
209void
211
212/*----------------------------------------------------------------------------*/
216/*----------------------------------------------------------------------------*/
217
218void
220
221/*----------------------------------------------------------------------------*/
225/*----------------------------------------------------------------------------*/
226
229
230/*----------------------------------------------------------------------------*/
234/*----------------------------------------------------------------------------*/
235
236void
238
239/*----------------------------------------------------------------------------*/
240
242
243#endif /* __CS_1D_WALL_THERMAL_H__ */
void cs_1d_wall_thermal_local_models_create(void)
Allocate the array of structures local_models.
Definition: cs_1d_wall_thermal.cpp:271
cs_1d_wall_thermal_t * cs_get_glob_1d_wall_thermal(void)
Provide access to cs_glob_1d_wall_thermal.
Definition: cs_1d_wall_thermal.cpp:1159
void cs_1d_wall_thermal_log(void)
Print information about the 1d wall thermal computation.
Definition: cs_1d_wall_thermal.cpp:1171
void cs_1d_wall_thermal_mesh_create(void)
Create the 1D mesh for each face and initialize the temperature.
Definition: cs_1d_wall_thermal.cpp:308
void cs_1d_wall_thermal_create(void)
Initialize the cs_glob_1d_wall_thermal structure.
Definition: cs_1d_wall_thermal.cpp:248
void cs_1d_wall_thermal_finalize(void)
Destroy the global 1d wall thermal structure.
Definition: cs_1d_wall_thermal.cpp:1146
const cs_1d_wall_thermal_t * cs_glob_1d_wall_thermal
void cs_1d_wall_thermal_free(void)
Free the array of structures local_models.
Definition: cs_1d_wall_thermal.cpp:1130
void cs_1d_wall_thermal_read(void)
Read the restart file of the 1D-wall thermal module.
Definition: cs_1d_wall_thermal.cpp:532
void cs_1d_wall_thermal_solve(cs_lnum_t ii, cs_real_t tf, cs_real_t hf)
Solve the 1D equation for a given face.
Definition: cs_1d_wall_thermal.cpp:365
void cs_1d_wall_thermal_write(void)
Write the restart file of the 1D-wall thermal module.
Definition: cs_1d_wall_thermal.cpp:920
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
uint64_t cs_gnum_t
global mesh entity number
Definition: cs_defs.h:325
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
Definition: cs_1d_wall_thermal.h:56
cs_real_t xlmbt1
Definition: cs_1d_wall_thermal.h:83
cs_real_t rgpt1d
Definition: cs_1d_wall_thermal.h:70
cs_real_t * z
Definition: cs_1d_wall_thermal.h:92
int iclt1d
Definition: cs_1d_wall_thermal.h:62
cs_real_t fept1d
Definition: cs_1d_wall_thermal.h:79
cs_real_t rcpt1d
Definition: cs_1d_wall_thermal.h:85
cs_real_t eppt1d
Definition: cs_1d_wall_thermal.h:67
cs_real_t * t
Definition: cs_1d_wall_thermal.h:94
cs_real_t dtpt1d
Definition: cs_1d_wall_thermal.h:88
int nppt1d
Definition: cs_1d_wall_thermal.h:58
cs_real_t hept1d
Definition: cs_1d_wall_thermal.h:76
cs_real_t tept1d
Definition: cs_1d_wall_thermal.h:73
1D wall thermal module descriptor.
Definition: cs_1d_wall_thermal.h:102
cs_gnum_t nfpt1t
Definition: cs_1d_wall_thermal.h:107
cs_lnum_t nfpt1d
Definition: cs_1d_wall_thermal.h:104
int nmxt1d
Definition: cs_1d_wall_thermal.h:111
cs_lnum_t * ifpt1d
Definition: cs_1d_wall_thermal.h:117
bool use_restart
Definition: cs_1d_wall_thermal.h:113
cs_lnum_t * izft1d
Definition: cs_1d_wall_thermal.h:115
cs_1d_wall_thermal_local_model_t * local_models
Definition: cs_1d_wall_thermal.h:126
cs_real_t * tppt1d
Definition: cs_1d_wall_thermal.h:121