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-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  * 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  int ngaz;
58  int npoint;
67  // cs_real_t *qespel; /* Charge massique des especes C/kg */
68  // cs_real_t *suscep; /* Susceptibilite (relation champ - mobilite) m2/s/V */
70 
71 /*----------------------------------------------------------------------------
72  * Structure to read transformer parameters in dp_ELE
73  *----------------------------------------------------------------------------*/
74 
75 typedef struct {
76  int nbelec;
77  int *ielecc;
78  int *ielect;
79  int *ielecb;
80  int nbtrf;
81  int ntfref;
82  int *ibrpr;
83  int *ibrsec;
91 
92 /*----------------------------------------------------------------------------
93  * Electrical model options descriptor
94  *----------------------------------------------------------------------------*/
95 
96 typedef struct {
97  int ixkabe;
98  int ntdcla;
99  int irestrike;
100  cs_real_t restrike_point[3];
101  cs_real_t crit_reca[5];
102  int ielcor;
103  int modrec;
104  int idreca;
105  int *izreca;
113 
114 /*============================================================================
115  * Static global variables
116  *============================================================================*/
117 
118 /* Pointer to electrical model options structure */
119 
123 
124 /* Constant for electrical models */
125 
126 extern const cs_real_t cs_elec_permvi;
127 extern const cs_real_t cs_elec_epszer;
128 
129 /*=============================================================================
130  * Public function prototypes for Fortran API
131  *============================================================================*/
132 
133 void
134 CS_PROCF (elini1, ELINI1) (cs_real_t *visls0,
135  cs_real_t *diftl0);
136 
137 void
138 CS_PROCF (elflux, ELFLUX) (cs_int_t *iappel);
139 
140 void
141 CS_PROCF (elthht, ELTHHT) (cs_int_t *mode,
142  cs_real_t *ym,
143  cs_real_t *enthal,
144  cs_real_t *temp);
145 
146 void
147 CS_PROCF (ellecd, ELLECD) (void);
148 
149 void
150 CS_PROCF (elphyv, ELPHYV) (void);
151 
152 void
153 CS_PROCF (eltssc, ELTSSC) (const cs_int_t *isca,
154  cs_real_t *smbrs);
155 
156 void
157 CS_PROCF (eltsvv, ELTSVV) (const int *f_id,
158  cs_real_t *smbrv);
159 
160 void
161 CS_PROCF (eliniv, ELINIV) (cs_int_t *isuite);
162 
163 void
164 CS_PROCF (elreca, ELRECA) (cs_real_t *dt);
165 
166 /*=============================================================================
167  * Public function prototypes
168  *============================================================================*/
169 
170 /*----------------------------------------------------------------------------
171  * Provide acces to cs_elec_option
172  *----------------------------------------------------------------------------*/
173 
176 
177 /*----------------------------------------------------------------------------
178  * Provide acces to cs_glob_transformer
179  *----------------------------------------------------------------------------*/
180 
183 
184 /*----------------------------------------------------------------------------
185  * Initialize structures for electrical model
186  *----------------------------------------------------------------------------*/
187 
188 void
190 
191 /*----------------------------------------------------------------------------
192  * Destroy structures for electrical model
193  *----------------------------------------------------------------------------*/
194 
195 void
197 
198 /*----------------------------------------------------------------------------
199  * Specific initialization for electric arc
200  *----------------------------------------------------------------------------*/
201 
202 void
204  cs_real_t *diftl0);
205 
206 /*----------------------------------------------------------------------------
207  * Read properties file
208  *----------------------------------------------------------------------------*/
209 
210 void
212 
213 /*----------------------------------------------------------------------------
214  * compute specific electric arc fields
215  *----------------------------------------------------------------------------*/
216 
217 void
219  int call_id);
220 
221 /*----------------------------------------------------------------------------
222  * convert enthalpy-temperature
223  *----------------------------------------------------------------------------*/
224 
225 void
226 cs_elec_convert_h_t(int mode,
227  cs_real_t *ym,
228  cs_real_t *enthal,
229  cs_real_t *temp);
230 
231 /*----------------------------------------------------------------------------
232  * compute physical properties
233  *----------------------------------------------------------------------------*/
234 
235 void
237 
238 /*----------------------------------------------------------------------------
239  * compute source terms for energy
240  *----------------------------------------------------------------------------*/
241 
242 void
244  const cs_mesh_quantities_t *mesh_quantities,
245  int f_id,
246  cs_real_t *smbrs);
247 
248 /*----------------------------------------------------------------------------
249  * compute source terms for vector potential
250  *----------------------------------------------------------------------------*/
251 
252 void
254  const cs_mesh_quantities_t *mesh_quantities,
255  int f_id,
256  cs_real_3_t *smbrv);
257 
258 /*----------------------------------------------------------------------------
259  * add variables fields
260  *----------------------------------------------------------------------------*/
261 
262 void
264 
265 /*----------------------------------------------------------------------------
266  * add properties fields
267  *----------------------------------------------------------------------------*/
268 
269 void
271 
272 /*----------------------------------------------------------------------------
273  * initialize electric fields
274  *----------------------------------------------------------------------------*/
275 
276 void
278  int isuite);
279 
280 /*----------------------------------------------------------------------------
281  * scaling electric quantities
282  *----------------------------------------------------------------------------*/
283 
284 void
286  const cs_mesh_quantities_t *mesh_quantities,
287  cs_real_t *dt);
288 
289 /*----------------------------------------------------------------------------*/
290 
292 
293 #endif /* __CS_ELEC_MODEL_H__ */
cs_real_t * xkabel
Definition: cs_elec_model.h:66
const cs_real_t cs_elec_epszer
Definition: cs_elec_model.c:275
int * ibrsec
Definition: cs_elec_model.h:83
int irestrike
Definition: cs_elec_model.h:99
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:949
const cs_data_joule_effect_t * cs_glob_transformer
void cs_electrical_model_specific_initialization(cs_real_t *visls0, cs_real_t *diftl0)
Definition: cs_elec_model.c:651
void cs_elec_fields_initialize(const cs_mesh_t *mesh, int isuite)
Definition: cs_elec_model.c:1974
int modrec
Definition: cs_elec_model.h:103
const cs_data_elec_t * cs_glob_elec_properties
cs_real_t * zi
Definition: cs_elec_model.h:87
integer, dimension(nscamx), save isca
Definition: numvar.f90:131
int ntdcla
Definition: cs_elec_model.h:98
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:2021
void elthht(cs_int_t *mode, cs_real_t *ym, cs_real_t *enthal, cs_real_t *temp)
Definition: cs_elec_model.c:485
int nbelec
Definition: cs_elec_model.h:76
cs_data_joule_effect_t * cs_get_glob_transformer(void)
Definition: cs_elec_model.c:562
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:301
void cs_elec_physical_properties(const cs_domain_t *domain)
Definition: cs_elec_model.c:1045
int * ielecc
Definition: cs_elec_model.h:77
cs_real_t * visel
Definition: cs_elec_model.h:64
cs_real_t * zr
Definition: cs_elec_model.h:86
cs_real_t * uroff
Definition: cs_elec_model.h:88
int ngaz
Definition: cs_elec_model.h:57
void ellecd(void)
Definition: cs_elec_model.c:494
cs_real_t elcou
Definition: cs_elec_model.h:110
cs_real_t * rhoel
Definition: cs_elec_model.h:61
cs_real_t * xlabel
Definition: cs_elec_model.h:65
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
int * ibrpr
Definition: cs_elec_model.h:82
cs_real_t * cpel
Definition: cs_elec_model.h:62
integer, save isuite
Indicator of a calculation restart (=1) or not (=0). This value is set automatically by the code; dep...
Definition: optcal.f90:312
cs_real_t * uioff
Definition: cs_elec_model.h:89
cs_real_t srrom
Definition: cs_elec_model.h:111
const cs_elec_option_t * cs_glob_elec_option
Definition: cs_mesh.h:63
int * izreca
Definition: cs_elec_model.h:105
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:1662
cs_real_t coejou
Definition: cs_elec_model.h:109
void elini1(cs_real_t *visls0, cs_real_t *diftl0)
Definition: cs_elec_model.c:471
cs_real_t puisim
Definition: cs_elec_model.h:108
int nbtrf
Definition: cs_elec_model.h:80
double precision, dimension(nscamx), save visls0
reference molecular diffusivity related to the scalar J ( ).
Definition: optcal.f90:1185
void eliniv(cs_int_t *isuite)
Definition: cs_elec_model.c:532
void cs_elec_add_property_fields(void)
Definition: cs_elec_model.c:1855
void elreca(cs_real_t *dt)
Definition: cs_elec_model.c:538
double precision, save diftl0
Definition: ppthch.f90:161
void eltssc(const cs_int_t *isca, cs_real_t *smbrs)
Definition: cs_elec_model.c:507
void cs_electrical_model_initialize(void)
Definition: cs_elec_model.c:572
Definition: cs_field_pointer.h:65
Definition: cs_mesh_quantities.h:90
Structure storing the main features of the computational domain and pointers to the main geometrical ...
Definition: cs_domain.h:87
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:315
int * ielecb
Definition: cs_elec_model.h:79
cs_real_t * sigel
Definition: cs_elec_model.h:63
void elphyv(void)
Definition: cs_elec_model.c:501
cs_real_t pot_diff
Definition: cs_elec_model.h:107
option for electric model
Definition: cs_elec_model.h:96
cs_real_t * rnbs
Definition: cs_elec_model.h:85
int npoint
Definition: cs_elec_model.h:58
#define END_C_DECLS
Definition: cs_defs.h:468
int ntfref
Definition: cs_elec_model.h:81
int ielcor
Definition: cs_elec_model.h:102
#define CS_PROCF(x, y)
Definition: cs_defs.h:481
void cs_electrical_model_finalize(void)
Definition: cs_elec_model.c:614
void eltsvv(const int *f_id, cs_real_t *smbrv)
Definition: cs_elec_model.c:522
cs_real_t * tenspr
Definition: cs_elec_model.h:84
cs_real_t couimp
Definition: cs_elec_model.h:106
physical properties for electric model descriptor.
Definition: cs_elec_model.h:56
void elflux(cs_int_t *iappel)
Definition: cs_elec_model.c:478
void cs_electrical_properties_read(void)
Definition: cs_elec_model.c:757
cs_elec_option_t * cs_get_glob_elec_option(void)
Definition: cs_elec_model.c:552
void cs_elec_add_variable_fields(void)
Definition: cs_elec_model.c:1759
int idreca
Definition: cs_elec_model.h:104
void cs_elec_compute_fields(const cs_mesh_t *mesh, int call_id)
Definition: cs_elec_model.c:1363
int ixkabe
Definition: cs_elec_model.h:97
cs_real_t * th
Definition: cs_elec_model.h:59
cs_real_t * ehgaz
Definition: cs_elec_model.h:60
Structure to read transformer parameters in dp_ELE.
Definition: cs_elec_model.h:75
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:1725
int * ielect
Definition: cs_elec_model.h:78