My Project
programmer's 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-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  * 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 
56 typedef 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 
102 typedef 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  cs_lnum_t *izft1d; /* Zones of t1d, dimensioned with nfabor */
114 
115  cs_lnum_t *ifpt1d; /* Array allowing to mark out the numbers of
116  * the nfpt1d boundary faces which are coupled with
117  * a 1D wall. */
118 
119  cs_real_t *tppt1d; /* Initialisation temperature of the wall (uniform in
120  * thickness). During the calculation, the array stores
121  * the temperature of the solid at the fluid/solid
122  * interface. */
123 
124  cs_1d_wall_thermal_local_model_t *local_models; /* Array of structures */
125 
127 
128 /*============================================================================
129  * Static global variables
130  *============================================================================*/
131 
132 /* Pointer to the 1D wall thermal structure */
133 
135 
136 /*============================================================================
137  * Public function prototypes
138  *============================================================================*/
139 
140  /*----------------------------------------------------------------------------*/
144 /*----------------------------------------------------------------------------*/
145 
146 void
148 
149 /*----------------------------------------------------------------------------*/
153 /*----------------------------------------------------------------------------*/
154 
155 void
157 
158 /*----------------------------------------------------------------------------*/
163 /*----------------------------------------------------------------------------*/
164 
165 void
167 
168 /*----------------------------------------------------------------------------*/
172 /*----------------------------------------------------------------------------*/
173 
174 void
176 
177 /*----------------------------------------------------------------------------*/
186 /*----------------------------------------------------------------------------*/
187 
188 void
190  cs_real_t tf,
191  cs_real_t hf);
192 
193 /*----------------------------------------------------------------------------*/
197 /*----------------------------------------------------------------------------*/
198 
199 void
201 
202 /*----------------------------------------------------------------------------*/
206 /*----------------------------------------------------------------------------*/
207 
208 void
210 
211 /*----------------------------------------------------------------------------*/
215 /*----------------------------------------------------------------------------*/
216 
217 void
219 
220 /*----------------------------------------------------------------------------*/
224 /*----------------------------------------------------------------------------*/
225 
226 void
228 
229 /*----------------------------------------------------------------------------*/
233 /*----------------------------------------------------------------------------*/
234 
237 
238 /*----------------------------------------------------------------------------*/
239 
241 
242 #endif /* __CS_1D_WALL_THERMAL_H__ */
cs_1d_wall_thermal_local_model_t
Definition: cs_1d_wall_thermal.h:56
cs_1d_wall_thermal_t::nmxt1d
int nmxt1d
Definition: cs_1d_wall_thermal.h:111
cs_1d_wall_thermal_local_model_t::hept1d
cs_real_t hept1d
Definition: cs_1d_wall_thermal.h:76
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_1d_wall_thermal_mesh_create
void cs_1d_wall_thermal_mesh_create(void)
Create the 1D mesh for each face and initialize the temperature.
Definition: cs_1d_wall_thermal.c:370
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
cs_1d_wall_thermal_create
void cs_1d_wall_thermal_create(void)
Initialize the cs_glob_1d_wall_thermal structure.
Definition: cs_1d_wall_thermal.c:261
cs_glob_1d_wall_thermal
const cs_1d_wall_thermal_t * cs_glob_1d_wall_thermal
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_1d_wall_thermal_local_model_t::rcpt1d
cs_real_t rcpt1d
Definition: cs_1d_wall_thermal.h:85
cs_1d_wall_thermal_free
void cs_1d_wall_thermal_free(void)
Free the array of structures local_models.
Definition: cs_1d_wall_thermal.c:1190
cs_1d_wall_thermal_local_model_t::eppt1d
cs_real_t eppt1d
Definition: cs_1d_wall_thermal.h:67
cs_1d_wall_thermal_write
void cs_1d_wall_thermal_write(void)
Write the restart file of the 1D-wall thermal module.
Definition: cs_1d_wall_thermal.c:980
cs_1d_wall_thermal_t::tppt1d
cs_real_t * tppt1d
Definition: cs_1d_wall_thermal.h:119
cs_1d_wall_thermal_local_models_create
void cs_1d_wall_thermal_local_models_create(void)
Allocate the array of structures local_models.
Definition: cs_1d_wall_thermal.c:284
cs_1d_wall_thermal_local_model_t::tept1d
cs_real_t tept1d
Definition: cs_1d_wall_thermal.h:73
cs_gnum_t
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:286
cs_1d_wall_thermal_read
void cs_1d_wall_thermal_read(void)
Read the restart file of the 1D-wall thermal module.
Definition: cs_1d_wall_thermal.c:592
cs_1d_wall_thermal_solve
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.c:427
cs_1d_wall_thermal_t
1D wall thermal module descriptor.
Definition: cs_1d_wall_thermal.h:102
cs_get_glob_1d_wall_thermal
cs_1d_wall_thermal_t * cs_get_glob_1d_wall_thermal(void)
Provide acces to cs_glob_1d_wall_thermal.
Definition: cs_1d_wall_thermal.c:1218
cs_1d_wall_thermal_local_model_t::dtpt1d
cs_real_t dtpt1d
Definition: cs_1d_wall_thermal.h:88
cs_1d_wall_thermal_local_models_init
void cs_1d_wall_thermal_local_models_init(void)
Allocate the discretization points coordinates array and the temperature at each point of discretizat...
Definition: cs_1d_wall_thermal.c:324
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_1d_wall_thermal_local_model_t::fept1d
cs_real_t fept1d
Definition: cs_1d_wall_thermal.h:79
cs_1d_wall_thermal_t::local_models
cs_1d_wall_thermal_local_model_t * local_models
Definition: cs_1d_wall_thermal.h:124
cs_1d_wall_thermal_local_model_t::z
cs_real_t * z
Definition: cs_1d_wall_thermal.h:92
cs_1d_wall_thermal_t::izft1d
cs_lnum_t * izft1d
Definition: cs_1d_wall_thermal.h:113
cs_1d_wall_thermal_local_model_t::t
cs_real_t * t
Definition: cs_1d_wall_thermal.h:94
cs_1d_wall_thermal_t::ifpt1d
cs_lnum_t * ifpt1d
Definition: cs_1d_wall_thermal.h:115
cs_1d_wall_thermal_local_model_t::rgpt1d
cs_real_t rgpt1d
Definition: cs_1d_wall_thermal.h:70
cs_base.h
cs_1d_wall_thermal_local_model_t::nppt1d
int nppt1d
Definition: cs_1d_wall_thermal.h:58
cs_1d_wall_thermal_t::nfpt1t
cs_gnum_t nfpt1t
Definition: cs_1d_wall_thermal.h:107
cs_1d_wall_thermal_local_model_t::xlmbt1
cs_real_t xlmbt1
Definition: cs_1d_wall_thermal.h:83
cs_1d_wall_thermal_finalize
void cs_1d_wall_thermal_finalize(void)
Destroy the global 1d wall thermal structure.
Definition: cs_1d_wall_thermal.c:1205
cs_1d_wall_thermal_local_model_t::iclt1d
int iclt1d
Definition: cs_1d_wall_thermal.h:62
cs_1d_wall_thermal_t::nfpt1d
cs_lnum_t nfpt1d
Definition: cs_1d_wall_thermal.h:104