8.0
general documentation
cs_elec_model.h
Go to the documentation of this file.
1 #ifndef __CS_ELEC_MODEL_H__
2 #define __CS_ELEC_MODEL_H__
3 
4 /*============================================================================
5  * General parameters management.
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2023 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 #include "cs_domain.h"
37 #include "cs_mesh.h"
38 #include "cs_mesh_quantities.h"
39 
40 /*----------------------------------------------------------------------------*/
41 
43 
44 /*=============================================================================
45  * Macro definitions
46  *============================================================================*/
47 
48 /*============================================================================
49  * Type definitions
50  *============================================================================*/
51 
52 /*----------------------------------------------------------------------------
53  * Structure to read properties in dp_ELE
54  *----------------------------------------------------------------------------*/
55 
56 typedef struct {
57 
58  int ngaz;
59  int npoint;
68 
70 
71 /*----------------------------------------------------------------------------
72  * Structure to read transformer parameters in dp_ELE
73  *----------------------------------------------------------------------------*/
74 
75 typedef struct {
76 
77  int nbelec;
78  int *ielecc;
79  int *ielect;
80  int *ielecb;
81  int nbtrf;
82  int ntfref;
83  int *ibrpr;
84  int *ibrsec;
91 
93 
94 /*----------------------------------------------------------------------------
95  * Electrical model options descriptor
96  *----------------------------------------------------------------------------*/
97 
98 typedef struct {
99 
100  int ixkabe;
101  int ntdcla;
103  cs_real_t restrike_point[3];
104  cs_real_t crit_reca[5];
105  int ielcor;
106  int modrec;
107  int idreca;
108  int *izreca;
115 
117 
118 /*============================================================================
119  * Static global variables
120  *============================================================================*/
121 
122 /* Pointer to electrical model options structure */
123 
127 
128 /* Constant for electrical models */
129 
130 extern const cs_real_t cs_elec_permvi;
131 extern const cs_real_t cs_elec_epszer;
132 
133 /*=============================================================================
134  * Public function prototypes for Fortran API
135  *============================================================================*/
136 
137 void
138 CS_PROCF (elini1, ELINI1) (cs_real_t *diftl0);
139 
140 void
141 CS_PROCF (elflux, ELFLUX) (int *iappel);
142 
143 void
144 CS_PROCF (elthht, ELTHHT) (int *mode,
145  cs_real_t *ym,
146  cs_real_t *enthal,
147  cs_real_t *temp);
148 
149 void
150 CS_PROCF (ellecd, ELLECD) (void);
151 
152 void
153 CS_PROCF (elphyv, ELPHYV) (void);
154 
155 void
156 CS_PROCF (eltssc, ELTSSC) (const int *isca,
157  cs_real_t *smbrs);
158 
159 void
160 CS_PROCF (eltsvv, ELTSVV) (const int *f_id,
161  cs_real_t *smbrv);
162 
163 void
164 CS_PROCF (eliniv, ELINIV) (int *isuite);
165 
166 void
167 CS_PROCF (elreca, ELRECA) (cs_real_t *dt);
168 
169 /*=============================================================================
170  * Public function prototypes
171  *============================================================================*/
172 
173 /*----------------------------------------------------------------------------
174  * Provide access to cs_elec_option
175  *----------------------------------------------------------------------------*/
176 
179 
180 /*----------------------------------------------------------------------------
181  * Provide access to cs_glob_transformer
182  *----------------------------------------------------------------------------*/
183 
186 
187 /*----------------------------------------------------------------------------
188  * Initialize structures for electrical model
189  *----------------------------------------------------------------------------*/
190 
191 void
193 
194 /*----------------------------------------------------------------------------
195  * Destroy structures for electrical model
196  *----------------------------------------------------------------------------*/
197 
198 void
200 
201 /*----------------------------------------------------------------------------
202  * Specific initialization for electric arc
203  *----------------------------------------------------------------------------*/
204 
205 void
207 
208 /*----------------------------------------------------------------------------
209  * Read properties file
210  *----------------------------------------------------------------------------*/
211 
212 void
214 
215 /*----------------------------------------------------------------------------
216  * compute specific electric arc fields
217  *----------------------------------------------------------------------------*/
218 
219 void
221  int call_id);
222 
223 /*----------------------------------------------------------------------------
224  * compute physical properties
225  *----------------------------------------------------------------------------*/
226 
227 void
229 
230 /*----------------------------------------------------------------------------
231  * compute source terms for energy
232  *----------------------------------------------------------------------------*/
233 
234 void
236  const cs_mesh_quantities_t *mesh_quantities,
237  int f_id,
238  cs_real_t *smbrs);
239 
240 /*----------------------------------------------------------------------------
241  * compute source terms for vector potential
242  *----------------------------------------------------------------------------*/
243 
244 void
246  const cs_mesh_quantities_t *mesh_quantities,
247  int f_id,
248  cs_real_3_t *smbrv);
249 
250 /*----------------------------------------------------------------------------
251  * add variables fields
252  *----------------------------------------------------------------------------*/
253 
254 void
256 
257 /*----------------------------------------------------------------------------
258  * add properties fields
259  *----------------------------------------------------------------------------*/
260 
261 void
263 
264 /*----------------------------------------------------------------------------
265  * initialize electric fields
266  *----------------------------------------------------------------------------*/
267 
268 void
270  int isuite);
271 
272 /*----------------------------------------------------------------------------
273  * scaling electric quantities
274  *----------------------------------------------------------------------------*/
275 
276 void
278  const cs_mesh_quantities_t *mesh_quantities,
279  cs_real_t *dt);
280 
281 /*----------------------------------------------------------------------------*/
291 /*----------------------------------------------------------------------------*/
292 
293 void
295  cs_real_t t[]);
296 
297 /*----------------------------------------------------------------------------*/
307 /*----------------------------------------------------------------------------*/
308 
309 void
311  cs_real_t h[]);
312 
313 /*----------------------------------------------------------------------------*/
325 /*----------------------------------------------------------------------------*/
326 
327 void
329  const cs_lnum_t face_ids[],
330  const cs_real_t t[],
331  cs_real_t h[]);
332 
333 /*----------------------------------------------------------------------------*/
338 /*----------------------------------------------------------------------------*/
339 
340 void
342 
343 /*----------------------------------------------------------------------------*/
344 
346 
347 #endif /* __CS_ELEC_MODEL_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:509
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define CS_PROCF(x, y)
Definition: cs_defs.h:523
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:332
#define END_C_DECLS
Definition: cs_defs.h:510
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
void cs_elec_add_property_fields(void)
Definition: cs_elec_model.c:2070
void cs_elec_source_terms(const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, int f_id, cs_real_t *smbrs)
Definition: cs_elec_model.c:1878
void eliniv(int *isuite)
Definition: cs_elec_model.c:868
cs_elec_option_t * cs_get_glob_elec_option(void)
Definition: cs_elec_model.c:888
void elini1(cs_real_t *diftl0)
Definition: cs_elec_model.c:800
void cs_electrical_properties_read(void)
Definition: cs_elec_model.c:1080
const cs_real_t cs_elec_epszer
Definition: cs_elec_model.c:275
const cs_data_elec_t * cs_glob_elec_properties
void cs_electrical_model_initialize(void)
Definition: cs_elec_model.c:908
void cs_elec_add_variable_fields(void)
Definition: cs_elec_model.c:1975
void cs_elec_convert_t_to_h_cells(const cs_real_t t[], cs_real_t h[])
Convert temperature to enthalpy at all cells.
Definition: cs_elec_model.c:2479
const cs_data_joule_effect_t * cs_glob_transformer
void cs_elec_define_functions(void)
Create or access function objects specific to electric arcs models.
Definition: cs_elec_model.c:2586
void cs_electrical_model_finalize(void)
Definition: cs_elec_model.c:950
void cs_elec_physical_properties(cs_domain_t *domain)
Definition: cs_elec_model.c:1272
void cs_elec_convert_t_to_h_faces(const cs_lnum_t n_faces, const cs_lnum_t face_ids[], const cs_real_t t[], cs_real_t h[])
Convert temperature to enthalpy at selected boundary faces.
Definition: cs_elec_model.c:2533
const cs_elec_option_t * cs_glob_elec_option
void cs_elec_compute_fields(const cs_mesh_t *mesh, int call_id)
Definition: cs_elec_model.c:1598
void elreca(cs_real_t *dt)
Definition: cs_elec_model.c:874
void eltssc(const int *isca, cs_real_t *smbrs)
Definition: cs_elec_model.c:843
cs_data_joule_effect_t * cs_get_glob_transformer(void)
Definition: cs_elec_model.c:898
void cs_electrical_model_specific_initialization(cs_real_t *diftl0)
Definition: cs_elec_model.c:987
void elphyv(void)
Definition: cs_elec_model.c:837
void elflux(int *iappel)
Definition: cs_elec_model.c:806
void ellecd(void)
Definition: cs_elec_model.c:830
void cs_elec_fields_initialize(const cs_mesh_t *mesh, int isuite)
Definition: cs_elec_model.c:2189
void cs_elec_convert_h_to_t_faces(const cs_real_t h[], cs_real_t t[])
Convert enthalpy to temperature at all boundary faces.
Definition: cs_elec_model.c:2423
void eltsvv(const int *f_id, cs_real_t *smbrv)
Definition: cs_elec_model.c:858
const cs_real_t cs_elec_permvi
Definition: cs_elec_model.c:269
void cs_elec_scaling_function(const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, cs_real_t *dt)
Definition: cs_elec_model.c:2236
void elthht(int *mode, cs_real_t *ym, cs_real_t *enthal, cs_real_t *temp)
Definition: cs_elec_model.c:813
void cs_elec_source_terms_v(const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, int f_id, cs_real_3_t *smbrv)
Definition: cs_elec_model.c:1941
@ t
Definition: cs_field_pointer.h:92
@ h
Definition: cs_field_pointer.h:91
@ dt
Definition: cs_field_pointer.h:65
integer, dimension(nscamx), save isca
isca(i) is the index of the scalar i
Definition: numvar.f90:131
integer, save isuite
Indicator of a calculation restart (=1) or not (=0). This value is set automatically by the code; dep...
Definition: optcal.f90:158
double precision, save diftl0
molecular diffusivity for the enthalpy ( ) for gas or coal combustion (the code then automatically se...
Definition: ppthch.f90:162
Definition: mesh.f90:26
physical properties for electric model descriptor.
Definition: cs_elec_model.h:56
cs_real_t * sigel
Definition: cs_elec_model.h:64
int ngaz
Definition: cs_elec_model.h:58
cs_real_t * th
Definition: cs_elec_model.h:60
int npoint
Definition: cs_elec_model.h:59
cs_real_t * cpel
Definition: cs_elec_model.h:63
cs_real_t * xkabel
Definition: cs_elec_model.h:67
cs_real_t * xlabel
Definition: cs_elec_model.h:66
cs_real_t * rhoel
Definition: cs_elec_model.h:62
cs_real_t * ehgaz
Definition: cs_elec_model.h:61
cs_real_t * visel
Definition: cs_elec_model.h:65
Structure to read transformer parameters in dp_ELE.
Definition: cs_elec_model.h:75
int nbtrf
Definition: cs_elec_model.h:81
cs_real_t * uioff
Definition: cs_elec_model.h:90
cs_real_t * zi
Definition: cs_elec_model.h:88
int nbelec
Definition: cs_elec_model.h:77
cs_real_t * rnbs
Definition: cs_elec_model.h:86
int ntfref
Definition: cs_elec_model.h:82
int * ibrpr
Definition: cs_elec_model.h:83
cs_real_t * tenspr
Definition: cs_elec_model.h:85
int * ielect
Definition: cs_elec_model.h:79
cs_real_t * zr
Definition: cs_elec_model.h:87
int * ielecc
Definition: cs_elec_model.h:78
int * ielecb
Definition: cs_elec_model.h:80
cs_real_t * uroff
Definition: cs_elec_model.h:89
int * ibrsec
Definition: cs_elec_model.h:84
Structure storing the main features of the computational domain and pointers to the main geometrical ...
Definition: cs_domain.h:138
option for electric model
Definition: cs_elec_model.h:98
cs_real_t pot_diff
Definition: cs_elec_model.h:110
cs_real_t srrom
Definition: cs_elec_model.h:114
int idreca
Definition: cs_elec_model.h:107
int irestrike
Definition: cs_elec_model.h:102
int * izreca
Definition: cs_elec_model.h:108
int ixkabe
Definition: cs_elec_model.h:100
cs_real_t couimp
Definition: cs_elec_model.h:109
cs_real_t puisim
Definition: cs_elec_model.h:111
cs_real_t coejou
Definition: cs_elec_model.h:112
cs_real_t elcou
Definition: cs_elec_model.h:113
int ielcor
Definition: cs_elec_model.h:105
int modrec
Definition: cs_elec_model.h:106
int ntdcla
Definition: cs_elec_model.h:101
Definition: cs_mesh_quantities.h:92
Definition: cs_mesh.h:85