programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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-2017 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_mesh.h"
37 #include "cs_mesh_quantities.h"
38 
39 /*----------------------------------------------------------------------------*/
40 
42 
43 /*=============================================================================
44  * Macro definitions
45  *============================================================================*/
46 
47 /*============================================================================
48  * Type definitions
49  *============================================================================*/
50 
51 /*----------------------------------------------------------------------------
52  * Structure to read properties in dp_ELE
53  *----------------------------------------------------------------------------*/
54 
55 typedef struct {
56  int ngaz;
57  int npoint;
66  // cs_real_t *qespel; /* Charge massique des especes C/kg */
67  // cs_real_t *suscep; /* Susceptibilite (relation champ - mobilite) m2/s/V */
69 
70 /*----------------------------------------------------------------------------
71  * Structure to read transformer parameters in dp_ELE
72  *----------------------------------------------------------------------------*/
73 
74 typedef struct {
75  int nbelec;
76  int *ielecc;
77  int *ielect;
78  int *ielecb;
79  int nbtrf;
80  int ntfref;
81  int *ibrpr;
82  int *ibrsec;
90 
91 /*----------------------------------------------------------------------------
92  * Electrical model options descriptor
93  *----------------------------------------------------------------------------*/
94 
95 typedef struct {
96  int ieljou;
97  int ielarc;
98  int ixkabe;
99  int ntdcla;
101  cs_real_t restrike_point[3];
102  cs_real_t crit_reca[5];
103  int ielcor;
104  int modrec;
105  int idreca;
106  int *izreca;
114 
115 /*============================================================================
116  * Static global variables
117  *============================================================================*/
118 
119 /* Pointer to electrical model options structure */
120 
124 
125 /* Constant for electrical models */
126 
127 extern const cs_real_t cs_elec_permvi;
128 extern const cs_real_t cs_elec_epszer;
129 
130 /*=============================================================================
131  * Public function prototypes for Fortran API
132  *============================================================================*/
133 
134 void
135 CS_PROCF (elini1, ELINI1) (cs_real_t *visls0,
136  cs_real_t *diftl0,
137  cs_int_t *idircl,
138  cs_int_t *isca);
139 
140 void
141 CS_PROCF (elflux, ELFLUX) (cs_int_t *iappel);
142 
143 void
144 CS_PROCF (elthht, ELTHHT) (cs_int_t *mode,
145  cs_real_t *ym,
146  cs_real_t *enthal,
147  cs_real_t *temp);
148 
149 void
150 CS_PROCF (ellecd, ELLECD) (cs_int_t *ieljou,
151  cs_int_t *ielarc);
152 
153 void
154 CS_PROCF (elphyv, ELPHYV) (void);
155 
156 void
157 CS_PROCF (eltssc, ELTSSC) (const cs_int_t *isca,
158  cs_real_t *smbrs);
159 
160 void
161 CS_PROCF (eltsvv, ELTSVV) (const int *f_id,
162  cs_real_t *smbrv);
163 
164 void
165 CS_PROCF (elvarp, ELVARP) (cs_int_t *ieljou,
166  cs_int_t *ielarc);
167 
168 void
169 CS_PROCF (elprop, ELPROP) (cs_int_t *ieljou,
170  cs_int_t *ielarc);
171 
172 void
173 CS_PROCF (eliniv, ELINIV) (cs_int_t *isuite);
174 
175 void
176 CS_PROCF (elreca, ELRECA) (cs_real_t *dt);
177 
178 /*=============================================================================
179  * Public function prototypes
180  *============================================================================*/
181 
182 /*----------------------------------------------------------------------------
183  * Provide acces to cs_elec_option
184  *----------------------------------------------------------------------------*/
185 
188 
189 /*----------------------------------------------------------------------------
190  * Provide acces to cs_glob_transformer
191  *----------------------------------------------------------------------------*/
192 
195 
196 /*----------------------------------------------------------------------------
197  * Initialize structures for electrical model
198  *----------------------------------------------------------------------------*/
199 
200 void
202  int ieljou);
203 
204 /*----------------------------------------------------------------------------
205  * Destroy structures for electrical model
206  *----------------------------------------------------------------------------*/
207 
208 void
210  int ieljou);
211 
212 /*----------------------------------------------------------------------------
213  * Specific initialization for electric arc
214  *----------------------------------------------------------------------------*/
215 
216 void
218  cs_real_t *diftl0,
219  int *idircl,
220  int *isca);
221 
222 /*----------------------------------------------------------------------------
223  * Read properties file
224  *----------------------------------------------------------------------------*/
225 
226 void
228  int ieljou);
229 
230 /*----------------------------------------------------------------------------
231  * compute specific electric arc fields
232  *----------------------------------------------------------------------------*/
233 
234 void
236  int call_id);
237 
238 /*----------------------------------------------------------------------------
239  * convert enthalpy-temperature
240  *----------------------------------------------------------------------------*/
241 
242 void
243 cs_elec_convert_h_t(int mode,
244  cs_real_t *ym,
245  cs_real_t *enthal,
246  cs_real_t *temp);
247 
248 /*----------------------------------------------------------------------------
249  * compute physical properties
250  *----------------------------------------------------------------------------*/
251 
252 void
254  const cs_mesh_quantities_t *mesh_quantities);
255 
256 /*----------------------------------------------------------------------------
257  * compute source terms for energy
258  *----------------------------------------------------------------------------*/
259 
260 void
262  const cs_mesh_quantities_t *mesh_quantities,
263  int f_id,
264  cs_real_t *smbrs);
265 
266 /*----------------------------------------------------------------------------
267  * compute source terms for vector potential
268  *----------------------------------------------------------------------------*/
269 
270 void
272  const cs_mesh_quantities_t *mesh_quantities,
273  int f_id,
274  cs_real_3_t *smbrv);
275 
276 /*----------------------------------------------------------------------------
277  * add variables fields
278  *----------------------------------------------------------------------------*/
279 
280 void
281 cs_elec_add_variable_fields(const int *ielarc,
282  const int *ieljou);
283 
284 /*----------------------------------------------------------------------------
285  * add properties fields
286  *----------------------------------------------------------------------------*/
287 
288 void
289 cs_elec_add_property_fields(const int *ielarc,
290  const int *ieljou);
291 
292 /*----------------------------------------------------------------------------
293  * initialize electric fields
294  *----------------------------------------------------------------------------*/
295 
296 void
298  int isuite);
299 
300 /*----------------------------------------------------------------------------
301  * scaling electric quantities
302  *----------------------------------------------------------------------------*/
303 
304 void
306  const cs_mesh_quantities_t *mesh_quantities,
307  cs_real_t *dt);
308 
309 /*----------------------------------------------------------------------------*/
310 
312 
313 #endif /* __CS_ELEC_MODEL_H__ */
cs_real_t * xkabel
Definition: cs_elec_model.h:65
const cs_real_t cs_elec_epszer
Definition: cs_elec_model.c:288
int * ibrsec
Definition: cs_elec_model.h:82
int irestrike
Definition: cs_elec_model.h:100
void cs_elec_convert_h_t(int mode, cs_real_t *ym, cs_real_t *enthal, cs_real_t *temp)
Definition: cs_elec_model.c:981
const cs_data_joule_effect_t * cs_glob_transformer
void cs_elec_fields_initialize(const cs_mesh_t *mesh, int isuite)
Definition: cs_elec_model.c:2033
int modrec
Definition: cs_elec_model.h:104
void elini1(cs_real_t *visls0, cs_real_t *diftl0, cs_int_t *idircl, cs_int_t *isca)
Definition: cs_elec_model.c:482
void elvarp(cs_int_t *ieljou, cs_int_t *ielarc)
Definition: cs_elec_model.c:548
const cs_data_elec_t * cs_glob_elec_properties
int ielarc
Definition: cs_elec_model.h:97
cs_real_t * zi
Definition: cs_elec_model.h:86
int ntdcla
Definition: cs_elec_model.h:99
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:2125
void elthht(cs_int_t *mode, cs_real_t *ym, cs_real_t *enthal, cs_real_t *temp)
Definition: cs_elec_model.c:499
int nbelec
Definition: cs_elec_model.h:75
cs_data_joule_effect_t * cs_get_glob_transformer(void)
Definition: cs_elec_model.c:592
#define BEGIN_C_DECLS
Definition: cs_defs.h:453
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:296
int ieljou
Definition: cs_elec_model.h:96
int * ielecc
Definition: cs_elec_model.h:76
void cs_electrical_model_specific_initialization(cs_real_t *visls0, cs_real_t *diftl0, int *idircl, int *isca)
Definition: cs_elec_model.c:681
cs_real_t * visel
Definition: cs_elec_model.h:63
cs_real_t * zr
Definition: cs_elec_model.h:85
void cs_elec_physical_properties(const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities)
Definition: cs_elec_model.c:1077
cs_real_t * uroff
Definition: cs_elec_model.h:87
int ngaz
Definition: cs_elec_model.h:56
cs_real_t elcou
Definition: cs_elec_model.h:111
cs_real_t * rhoel
Definition: cs_elec_model.h:60
cs_real_t * xlabel
Definition: cs_elec_model.h:64
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
int * ibrpr
Definition: cs_elec_model.h:81
cs_real_t * cpel
Definition: cs_elec_model.h:61
cs_real_t * uioff
Definition: cs_elec_model.h:88
cs_real_t srrom
Definition: cs_elec_model.h:112
const cs_elec_option_t * cs_glob_elec_option
Definition: cs_mesh.h:63
int * izreca
Definition: cs_elec_model.h:106
void cs_electrical_model_initialize(int ielarc, int ieljou)
Definition: cs_elec_model.c:602
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:1719
cs_real_t coejou
Definition: cs_elec_model.h:110
cs_real_t puisim
Definition: cs_elec_model.h:109
int nbtrf
Definition: cs_elec_model.h:79
void eliniv(cs_int_t *isuite)
Definition: cs_elec_model.c:562
void elreca(cs_real_t *dt)
Definition: cs_elec_model.c:568
void eltssc(const cs_int_t *isca, cs_real_t *smbrs)
Definition: cs_elec_model.c:523
Definition: cs_field_pointer.h:65
void cs_elec_add_variable_fields(const int *ielarc, const int *ieljou)
Definition: cs_elec_model.c:1813
Definition: cs_mesh_quantities.h:82
const cs_real_t cs_elec_permvi
Definition: cs_elec_model.c:282
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:309
int * ielecb
Definition: cs_elec_model.h:78
cs_real_t * sigel
Definition: cs_elec_model.h:62
void cs_elec_add_property_fields(const int *ielarc, const int *ieljou)
Definition: cs_elec_model.c:1913
void elphyv(void)
Definition: cs_elec_model.c:516
cs_real_t pot_diff
Definition: cs_elec_model.h:108
option for electric model
Definition: cs_elec_model.h:95
cs_real_t * rnbs
Definition: cs_elec_model.h:84
void cs_electrical_model_finalize(int ielarc, int ieljou)
Definition: cs_elec_model.c:646
int npoint
Definition: cs_elec_model.h:57
#define END_C_DECLS
Definition: cs_defs.h:454
void cs_electrical_properties_read(int ielarc, int ieljou)
Definition: cs_elec_model.c:791
int ntfref
Definition: cs_elec_model.h:80
int ielcor
Definition: cs_elec_model.h:103
void elprop(cs_int_t *ieljou, cs_int_t *ielarc)
Definition: cs_elec_model.c:555
#define CS_PROCF(x, y)
Definition: cs_defs.h:467
void eltsvv(const int *f_id, cs_real_t *smbrv)
Definition: cs_elec_model.c:538
cs_real_t * tenspr
Definition: cs_elec_model.h:83
cs_real_t couimp
Definition: cs_elec_model.h:107
physical properties for electric model descriptor.
Definition: cs_elec_model.h:55
void elflux(cs_int_t *iappel)
Definition: cs_elec_model.c:492
cs_elec_option_t * cs_get_glob_elec_option(void)
Definition: cs_elec_model.c:582
int idreca
Definition: cs_elec_model.h:105
void cs_elec_compute_fields(const cs_mesh_t *mesh, int call_id)
Definition: cs_elec_model.c:1394
int ixkabe
Definition: cs_elec_model.h:98
cs_real_t * th
Definition: cs_elec_model.h:58
cs_real_t * ehgaz
Definition: cs_elec_model.h:59
Structure to read transformer parameters in dp_ELE.
Definition: cs_elec_model.h:74
void ellecd(cs_int_t *ieljou, cs_int_t *ielarc)
Definition: cs_elec_model.c:508
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:1780
int * ielect
Definition: cs_elec_model.h:77