8.1
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) (void);
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 (eliniv, ELINIV) (int *isuite);
161 
162 void
163 CS_PROCF (elreca, ELRECA) (cs_real_t *dt);
164 
165 /*=============================================================================
166  * Public function prototypes
167  *============================================================================*/
168 
169 /*----------------------------------------------------------------------------
170  * Provide access to cs_elec_option
171  *----------------------------------------------------------------------------*/
172 
175 
176 /*----------------------------------------------------------------------------
177  * Provide access to cs_glob_transformer
178  *----------------------------------------------------------------------------*/
179 
182 
183 /*----------------------------------------------------------------------------
184  * Initialize structures for electrical model
185  *----------------------------------------------------------------------------*/
186 
187 void
189 
190 /*----------------------------------------------------------------------------
191  * Destroy structures for electrical model
192  *----------------------------------------------------------------------------*/
193 
194 void
196 
197 /*----------------------------------------------------------------------------
198  * Specific initialization for electric arc
199  *----------------------------------------------------------------------------*/
200 
201 void
203 
204 /*----------------------------------------------------------------------------
205  * Read properties file
206  *----------------------------------------------------------------------------*/
207 
208 void
210 
211 /*----------------------------------------------------------------------------
212  * compute specific electric arc fields
213  *----------------------------------------------------------------------------*/
214 
215 void
217  int call_id);
218 
219 /*----------------------------------------------------------------------------
220  * compute physical properties
221  *----------------------------------------------------------------------------*/
222 
223 void
225 
226 /*----------------------------------------------------------------------------
227  * compute source terms for energy
228  *----------------------------------------------------------------------------*/
229 
230 void
232  const cs_mesh_quantities_t *mesh_quantities,
233  int f_id,
234  cs_real_t *smbrs);
235 
236 /*----------------------------------------------------------------------------
237  * compute source terms for vector potential
238  *----------------------------------------------------------------------------*/
239 
240 void
242  const cs_mesh_quantities_t *mesh_quantities,
243  int f_id,
244  cs_real_3_t *smbrv);
245 
246 /*----------------------------------------------------------------------------
247  * add variables fields
248  *----------------------------------------------------------------------------*/
249 
250 void
252 
253 /*----------------------------------------------------------------------------
254  * add properties fields
255  *----------------------------------------------------------------------------*/
256 
257 void
259 
260 /*----------------------------------------------------------------------------
261  * initialize electric fields
262  *----------------------------------------------------------------------------*/
263 
264 void
266  int isuite);
267 
268 /*----------------------------------------------------------------------------
269  * scaling electric quantities
270  *----------------------------------------------------------------------------*/
271 
272 void
274  const cs_mesh_quantities_t *mesh_quantities,
275  cs_real_t *dt);
276 
277 /*----------------------------------------------------------------------------*/
287 /*----------------------------------------------------------------------------*/
288 
289 void
291  cs_real_t t[]);
292 
293 /*----------------------------------------------------------------------------*/
302 /*----------------------------------------------------------------------------*/
303 
304 cs_real_t
306  cs_real_t enthal);
307 
308 /*----------------------------------------------------------------------------*/
318 /*----------------------------------------------------------------------------*/
319 
320 void
322  cs_real_t h[]);
323 
324 /*----------------------------------------------------------------------------*/
336 /*----------------------------------------------------------------------------*/
337 
338 void
340  const cs_lnum_t face_ids[],
341  const cs_real_t t[],
342  cs_real_t h[]);
343 
344 /*----------------------------------------------------------------------------*/
353 /*----------------------------------------------------------------------------*/
354 
355 cs_real_t
357  cs_real_t temp);
358 
359 /*----------------------------------------------------------------------------*/
364 /*----------------------------------------------------------------------------*/
365 
366 void
368 
369 /*----------------------------------------------------------------------------*/
370 
372 
373 #endif /* __CS_ELEC_MODEL_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define CS_PROCF(x, y)
Definition: cs_defs.h:528
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:334
#define END_C_DECLS
Definition: cs_defs.h:515
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:1928
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:1737
void eliniv(int *isuite)
Definition: cs_elec_model.c:726
void elini1(void)
Definition: cs_elec_model.c:683
cs_elec_option_t * cs_get_glob_elec_option(void)
Definition: cs_elec_model.c:746
void cs_electrical_properties_read(void)
Definition: cs_elec_model.c:939
const cs_real_t cs_elec_epszer
Definition: cs_elec_model.c:279
cs_real_t cs_elec_convert_t_to_h(const cs_real_t ym[], cs_real_t temp)
Convert single temperature value to enthalpy.
Definition: cs_elec_model.c:2506
const cs_data_elec_t * cs_glob_elec_properties
void cs_electrical_model_initialize(void)
Definition: cs_elec_model.c:766
void cs_elec_add_variable_fields(void)
Definition: cs_elec_model.c:1834
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:2395
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:2554
void cs_electrical_model_finalize(void)
Definition: cs_elec_model.c:810
void cs_elec_physical_properties(cs_domain_t *domain)
Definition: cs_elec_model.c:1131
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:2449
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:1457
void elreca(cs_real_t *dt)
Definition: cs_elec_model.c:732
cs_real_t cs_elec_convert_h_to_t(const cs_real_t ym[], cs_real_t enthal)
Convert single enthalpy value to temperature.
Definition: cs_elec_model.c:2336
void eltssc(const int *isca, cs_real_t *smbrs)
void cs_electrical_model_specific_initialization(void)
Definition: cs_elec_model.c:847
cs_data_joule_effect_t * cs_get_glob_transformer(void)
Definition: cs_elec_model.c:756
void elphyv(void)
Definition: cs_elec_model.c:720
void elflux(int *iappel)
Definition: cs_elec_model.c:689
void ellecd(void)
Definition: cs_elec_model.c:713
void cs_elec_fields_initialize(const cs_mesh_t *mesh, int isuite)
Definition: cs_elec_model.c:2047
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:2281
const cs_real_t cs_elec_permvi
Definition: cs_elec_model.c:273
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:2094
void elthht(int *mode, cs_real_t *ym, cs_real_t *enthal, cs_real_t *temp)
Definition: cs_elec_model.c:696
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:1800
@ 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
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