programmer's 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-2018 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 ixkabe;
97  int ntdcla;
98  int irestrike;
99  cs_real_t restrike_point[3];
100  cs_real_t crit_reca[5];
101  int ielcor;
102  int modrec;
103  int idreca;
104  int *izreca;
112 
113 /*============================================================================
114  * Static global variables
115  *============================================================================*/
116 
117 /* Pointer to electrical model options structure */
118 
122 
123 /* Constant for electrical models */
124 
125 extern const cs_real_t cs_elec_permvi;
126 extern const cs_real_t cs_elec_epszer;
127 
128 /*=============================================================================
129  * Public function prototypes for Fortran API
130  *============================================================================*/
131 
132 void
133 CS_PROCF (elini1, ELINI1) (cs_real_t *visls0,
134  cs_real_t *diftl0,
135  cs_int_t *idircl,
136  cs_int_t *isca);
137 
138 void
139 CS_PROCF (elflux, ELFLUX) (cs_int_t *iappel);
140 
141 void
142 CS_PROCF (elthht, ELTHHT) (cs_int_t *mode,
143  cs_real_t *ym,
144  cs_real_t *enthal,
145  cs_real_t *temp);
146 
147 void
148 CS_PROCF (ellecd, ELLECD) (void);
149 
150 void
151 CS_PROCF (elphyv, ELPHYV) (void);
152 
153 void
154 CS_PROCF (eltssc, ELTSSC) (const cs_int_t *isca,
155  cs_real_t *smbrs);
156 
157 void
158 CS_PROCF (eltsvv, ELTSVV) (const int *f_id,
159  cs_real_t *smbrv);
160 
161 void
162 CS_PROCF (eliniv, ELINIV) (cs_int_t *isuite);
163 
164 void
165 CS_PROCF (elreca, ELRECA) (cs_real_t *dt);
166 
167 /*=============================================================================
168  * Public function prototypes
169  *============================================================================*/
170 
171 /*----------------------------------------------------------------------------
172  * Provide acces to cs_elec_option
173  *----------------------------------------------------------------------------*/
174 
177 
178 /*----------------------------------------------------------------------------
179  * Provide acces to cs_glob_transformer
180  *----------------------------------------------------------------------------*/
181 
184 
185 /*----------------------------------------------------------------------------
186  * Initialize structures for electrical model
187  *----------------------------------------------------------------------------*/
188 
189 void
191 
192 /*----------------------------------------------------------------------------
193  * Destroy structures for electrical model
194  *----------------------------------------------------------------------------*/
195 
196 void
198 
199 /*----------------------------------------------------------------------------
200  * Specific initialization for electric arc
201  *----------------------------------------------------------------------------*/
202 
203 void
205  cs_real_t *diftl0,
206  int *idircl,
207  int *isca);
208 
209 /*----------------------------------------------------------------------------
210  * Read properties file
211  *----------------------------------------------------------------------------*/
212 
213 void
215 
216 /*----------------------------------------------------------------------------
217  * compute specific electric arc fields
218  *----------------------------------------------------------------------------*/
219 
220 void
222  int call_id);
223 
224 /*----------------------------------------------------------------------------
225  * convert enthalpy-temperature
226  *----------------------------------------------------------------------------*/
227 
228 void
229 cs_elec_convert_h_t(int mode,
230  cs_real_t *ym,
231  cs_real_t *enthal,
232  cs_real_t *temp);
233 
234 /*----------------------------------------------------------------------------
235  * compute physical properties
236  *----------------------------------------------------------------------------*/
237 
238 void
240  const cs_mesh_quantities_t *mesh_quantities);
241 
242 /*----------------------------------------------------------------------------
243  * compute source terms for energy
244  *----------------------------------------------------------------------------*/
245 
246 void
248  const cs_mesh_quantities_t *mesh_quantities,
249  int f_id,
250  cs_real_t *smbrs);
251 
252 /*----------------------------------------------------------------------------
253  * compute source terms for vector potential
254  *----------------------------------------------------------------------------*/
255 
256 void
258  const cs_mesh_quantities_t *mesh_quantities,
259  int f_id,
260  cs_real_3_t *smbrv);
261 
262 /*----------------------------------------------------------------------------
263  * add variables fields
264  *----------------------------------------------------------------------------*/
265 
266 void
268 
269 /*----------------------------------------------------------------------------
270  * add properties fields
271  *----------------------------------------------------------------------------*/
272 
273 void
275 
276 /*----------------------------------------------------------------------------
277  * initialize electric fields
278  *----------------------------------------------------------------------------*/
279 
280 void
282  int isuite);
283 
284 /*----------------------------------------------------------------------------
285  * scaling electric quantities
286  *----------------------------------------------------------------------------*/
287 
288 void
290  const cs_mesh_quantities_t *mesh_quantities,
291  cs_real_t *dt);
292 
293 /*----------------------------------------------------------------------------*/
294 
296 
297 #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:275
int * ibrsec
Definition: cs_elec_model.h:82
int irestrike
Definition: cs_elec_model.h:98
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:957
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:1986
int modrec
Definition: cs_elec_model.h:102
void elini1(cs_real_t *visls0, cs_real_t *diftl0, cs_int_t *idircl, cs_int_t *isca)
Definition: cs_elec_model.c:471
const cs_data_elec_t * cs_glob_elec_properties
cs_real_t * zi
Definition: cs_elec_model.h:86
integer, dimension(nscamx), save isca
Definition: numvar.f90:131
int ntdcla
Definition: cs_elec_model.h:97
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:2033
void elthht(cs_int_t *mode, cs_real_t *ym, cs_real_t *enthal, cs_real_t *temp)
Definition: cs_elec_model.c:487
int nbelec
Definition: cs_elec_model.h:75
cs_data_joule_effect_t * cs_get_glob_transformer(void)
Definition: cs_elec_model.c:565
#define BEGIN_C_DECLS
Definition: cs_defs.h:462
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:296
integer, dimension(nvarmx), save idircl
Definition: optcal.f90:325
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:654
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:1053
cs_real_t * uroff
Definition: cs_elec_model.h:87
int ngaz
Definition: cs_elec_model.h:56
void ellecd(void)
Definition: cs_elec_model.c:496
cs_real_t elcou
Definition: cs_elec_model.h:109
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
integer, save isuite
Indicator of a calculation restart (=1) or not (=0). This value is set automatically by the code; dep...
Definition: optcal.f90:338
cs_real_t * uioff
Definition: cs_elec_model.h:88
cs_real_t srrom
Definition: cs_elec_model.h:110
const cs_elec_option_t * cs_glob_elec_option
Definition: cs_mesh.h:63
int * izreca
Definition: cs_elec_model.h:104
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:1674
cs_real_t coejou
Definition: cs_elec_model.h:108
cs_real_t puisim
Definition: cs_elec_model.h:107
int nbtrf
Definition: cs_elec_model.h:79
double precision, dimension(nscamx), save visls0
reference molecular diffusivity related to the scalar J ( ).
Definition: optcal.f90:1228
void eliniv(cs_int_t *isuite)
Definition: cs_elec_model.c:535
void cs_elec_add_property_fields(void)
Definition: cs_elec_model.c:1867
void elreca(cs_real_t *dt)
Definition: cs_elec_model.c:541
double precision, save diftl0
Definition: ppthch.f90:161
void eltssc(const cs_int_t *isca, cs_real_t *smbrs)
Definition: cs_elec_model.c:510
void cs_electrical_model_initialize(void)
Definition: cs_elec_model.c:575
Definition: cs_field_pointer.h:65
Definition: cs_mesh_quantities.h:90
const cs_real_t cs_elec_permvi
Definition: cs_elec_model.c:269
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:310
int * ielecb
Definition: cs_elec_model.h:78
cs_real_t * sigel
Definition: cs_elec_model.h:62
void elphyv(void)
Definition: cs_elec_model.c:503
cs_real_t pot_diff
Definition: cs_elec_model.h:106
option for electric model
Definition: cs_elec_model.h:95
cs_real_t * rnbs
Definition: cs_elec_model.h:84
int npoint
Definition: cs_elec_model.h:57
#define END_C_DECLS
Definition: cs_defs.h:463
int ntfref
Definition: cs_elec_model.h:80
int ielcor
Definition: cs_elec_model.h:101
#define CS_PROCF(x, y)
Definition: cs_defs.h:476
void cs_electrical_model_finalize(void)
Definition: cs_elec_model.c:617
void eltsvv(const int *f_id, cs_real_t *smbrv)
Definition: cs_elec_model.c:525
cs_real_t * tenspr
Definition: cs_elec_model.h:83
cs_real_t couimp
Definition: cs_elec_model.h:105
physical properties for electric model descriptor.
Definition: cs_elec_model.h:55
void elflux(cs_int_t *iappel)
Definition: cs_elec_model.c:480
void cs_electrical_properties_read(void)
Definition: cs_elec_model.c:765
cs_elec_option_t * cs_get_glob_elec_option(void)
Definition: cs_elec_model.c:555
void cs_elec_add_variable_fields(void)
Definition: cs_elec_model.c:1771
int idreca
Definition: cs_elec_model.h:103
void cs_elec_compute_fields(const cs_mesh_t *mesh, int call_id)
Definition: cs_elec_model.c:1372
int ixkabe
Definition: cs_elec_model.h:96
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
Definition: mesh.f90:26
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:1737
int * ielect
Definition: cs_elec_model.h:77