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-2015 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 /*----------------------------------------------------------------------------*/
37 
39 
40 /*=============================================================================
41  * Macro definitions
42  *============================================================================*/
43 
44 /*============================================================================
45  * Type definitions
46  *============================================================================*/
47 
48 /*----------------------------------------------------------------------------
49  * Structure to read properties in dp_ELE
50  *----------------------------------------------------------------------------*/
51 
52 typedef struct {
53  int ngaz;
54  int npoint;
63  // cs_real_t *qespel; /* Charge massique des especes C/kg */
64  // cs_real_t *suscep; /* Susceptibilite (relation champ - mobilite) m2/s/V */
66 
67 /*----------------------------------------------------------------------------
68  * Structure to read transformer parameters in dp_ELE
69  *----------------------------------------------------------------------------*/
70 
71 typedef struct {
72  int nbelec;
73  int *ielecc;
74  int *ielect;
75  int *ielecb;
76  int nbtrf;
77  int ntfref;
78  int *ibrpr;
79  int *ibrsec;
87 
88 /*----------------------------------------------------------------------------
89  * Electrical model options descriptor
90  *----------------------------------------------------------------------------*/
91 
92 typedef struct {
93  int ieljou;
94  int ielarc;
95  int ixkabe;
96  int ntdcla;
97  int irestrike;
98  cs_real_t restrike_point[3];
99  cs_real_t crit_reca[5];
100  int ielcor;
101  int modrec;
102  int idreca;
103  int *izreca;
110  char *ficfpp;
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 *iconv,
136  cs_int_t *istat,
137  cs_int_t *idiff,
138  cs_int_t *idifft,
139  cs_int_t *idircl,
140  cs_int_t *isca,
141  cs_real_t *blencv,
142  cs_real_t *sigmas,
143  cs_int_t *iwarni);
144 
145 void
146 CS_PROCF (elflux, ELFLUX) (cs_int_t *iappel);
147 
148 void
149 CS_PROCF (elthht, ELTHHT) (cs_int_t *mode,
150  cs_real_t *ym,
151  cs_real_t *enthal,
152  cs_real_t *temp);
153 
154 void
155 CS_PROCF (ellecd, ELLECD) (cs_int_t *ieljou,
156  cs_int_t *ielarc);
157 
158 void
159 CS_PROCF (elphyv, ELPHYV) (void);
160 
161 void
162 CS_PROCF (eltssc, ELTSSC) (const cs_int_t *isca,
163  cs_real_t *smbrs);
164 
165 void
166 CS_PROCF (elvarp, ELVARP) (cs_int_t *ieljou,
167  cs_int_t *ielarc);
168 
169 void
170 CS_PROCF (elprop, ELPROP) (cs_int_t *ieljou,
171  cs_int_t *ielarc);
172 
173 void
174 CS_PROCF (eliniv, ELINIV) (cs_int_t *isuite);
175 
176 void
177 CS_PROCF (elreca, ELRECA) (cs_real_t *dt);
178 
179 /*=============================================================================
180  * Public function prototypes
181  *============================================================================*/
182 
183 /*----------------------------------------------------------------------------
184  * Provide acces to cs_elec_option
185  *----------------------------------------------------------------------------*/
186 
189 
190 /*----------------------------------------------------------------------------
191  * Provide acces to cs_glob_transformer
192  *----------------------------------------------------------------------------*/
193 
196 
197 /*----------------------------------------------------------------------------
198  * Initialize structures for electrical model
199  *----------------------------------------------------------------------------*/
200 
201 void
203  int ieljou);
204 
205 /*----------------------------------------------------------------------------
206  * Destroy structures for electrical model
207  *----------------------------------------------------------------------------*/
208 
209 void
211  int ieljou);
212 
213 /*----------------------------------------------------------------------------
214  * Specific initialization for electric arc
215  *----------------------------------------------------------------------------*/
216 
217 void
219  cs_real_t *diftl0,
220  int *iconv,
221  int *istat,
222  int *idiff,
223  int *idifft,
224  int *idircl,
225  int *isca,
226  cs_real_t *blencv,
227  cs_real_t *sigmas,
228  int *iwarni);
229 
230 /*----------------------------------------------------------------------------
231  * Read properties file
232  *----------------------------------------------------------------------------*/
233 
234 void
236  int ieljou);
237 
238 /*----------------------------------------------------------------------------
239  * compute specific electric arc fields
240  *----------------------------------------------------------------------------*/
241 
242 void
244  int call_id);
245 
246 /*----------------------------------------------------------------------------
247  * convert enthalpy-temperature
248  *----------------------------------------------------------------------------*/
249 
250 void
251 cs_elec_convert_h_t(int mode,
252  cs_real_t *ym,
253  cs_real_t *enthal,
254  cs_real_t *temp);
255 
256 /*----------------------------------------------------------------------------
257  * compute physical properties
258  *----------------------------------------------------------------------------*/
259 
260 void
262  const cs_mesh_quantities_t *mesh_quantities);
263 
264 /*----------------------------------------------------------------------------
265  * compute source terms for energie and vector potential
266  *----------------------------------------------------------------------------*/
267 
268 void
270  const cs_mesh_quantities_t *mesh_quantities,
271  int f_id,
272  cs_real_t *smbrs);
273 
274 /*----------------------------------------------------------------------------
275  * add variables fields
276  *----------------------------------------------------------------------------*/
277 
278 void
280  const int *ieljou);
281 
282 /*----------------------------------------------------------------------------
283  * add properties fields
284  *----------------------------------------------------------------------------*/
285 
286 void
288  const int *ieljou);
289 
290 /*----------------------------------------------------------------------------
291  * initialize electric fields
292  *----------------------------------------------------------------------------*/
293 
294 void
296  int isuite);
297 
298 /*----------------------------------------------------------------------------
299  * scaling electric quantities
300  *----------------------------------------------------------------------------*/
301 
302 void
304  const cs_mesh_quantities_t *mesh_quantities,
305  cs_real_t *dt);
306 
307 /*----------------------------------------------------------------------------*/
308 
310 
311 #endif /* __CS_ELEC_MODEL_H__ */
cs_real_t * xkabel
Definition: cs_elec_model.h:62
const cs_real_t cs_elec_epszer
Definition: cs_elec_model.c:249
int * ibrsec
Definition: cs_elec_model.h:79
int irestrike
Definition: cs_elec_model.h:97
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:1006
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:2122
int modrec
Definition: cs_elec_model.h:101
double precision, dimension(nscamx), save sigmas
sigmas : prandtl of scalars
Definition: optcal.f90:978
void elvarp(cs_int_t *ieljou, cs_int_t *ielarc)
Definition: cs_elec_model.c:506
const cs_data_elec_t * cs_glob_elec_properties
int ielarc
Definition: cs_elec_model.h:94
cs_real_t * zi
Definition: cs_elec_model.h:83
integer, dimension(nscamx), save isca
Definition: numvar.f90:129
int ntdcla
Definition: cs_elec_model.h:96
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:2214
void elthht(cs_int_t *mode, cs_real_t *ym, cs_real_t *enthal, cs_real_t *temp)
Definition: cs_elec_model.c:467
int nbelec
Definition: cs_elec_model.h:72
cs_data_joule_effect_t * cs_get_glob_transformer(void)
Definition: cs_elec_model.c:550
#define BEGIN_C_DECLS
Definition: cs_defs.h:448
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:295
int ieljou
Definition: cs_elec_model.h:93
integer, dimension(nvarmx), save idircl
strengthening of the diagonal part of the matrix if no Dirichlet is set
Definition: optcal.f90:354
int * ielecc
Definition: cs_elec_model.h:73
cs_real_t * visel
Definition: cs_elec_model.h:60
cs_real_t * zr
Definition: cs_elec_model.h:82
void cs_elec_physical_properties(const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities)
Definition: cs_elec_model.c:1102
cs_real_t * uroff
Definition: cs_elec_model.h:84
int ngaz
Definition: cs_elec_model.h:53
cs_real_t elcou
Definition: cs_elec_model.h:108
cs_real_t * rhoel
Definition: cs_elec_model.h:57
cs_real_t * xlabel
Definition: cs_elec_model.h:61
double cs_real_t
Floating-point value.
Definition: cs_defs.h:296
int * ibrpr
Definition: cs_elec_model.h:78
cs_real_t * cpel
Definition: cs_elec_model.h:58
integer, save isuite
Definition: optcal.f90:375
cs_real_t * uioff
Definition: cs_elec_model.h:85
cs_real_t srrom
Definition: cs_elec_model.h:109
const cs_elec_option_t * cs_glob_elec_option
integer, dimension(nvarmx), save iconv
take convection into account:
Definition: optcal.f90:60
Definition: cs_mesh.h:62
int * izreca
Definition: cs_elec_model.h:103
void cs_electrical_model_initialize(int ielarc, int ieljou)
Definition: cs_elec_model.c:560
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:1782
double precision, dimension(nvarmx), save blencv
percentage of upwind:
Definition: optcal.f90:237
cs_real_t coejou
Definition: cs_elec_model.h:107
cs_real_t puisim
Definition: cs_elec_model.h:106
int nbtrf
Definition: cs_elec_model.h:76
double precision, dimension(nscamx), save visls0
visls0 : viscosity of scalars if constant
Definition: optcal.f90:975
void eliniv(cs_int_t *isuite)
Definition: cs_elec_model.c:520
integer, dimension(nvarmx), save idiff
take diffusion into account:
Definition: optcal.f90:65
integer ielarc
pointer to specify Electric arcs module (Joule effect and Laplace forces) with indicator ippmod(ielar...
Definition: ppincl.f90:173
void elreca(cs_real_t *dt)
Definition: cs_elec_model.c:526
double precision, save diftl0
molecular diffusivity for the enthalpy ( ) for gas or coal combustion (the code then automatically se...
Definition: ppthch.f90:158
void eltssc(const cs_int_t *isca, cs_real_t *smbrs)
Definition: cs_elec_model.c:491
Definition: cs_field_pointer.h:64
void cs_elec_add_variable_fields(const int *ielarc, const int *ieljou)
Definition: cs_elec_model.c:1869
Definition: cs_mesh_quantities.h:51
void elini1(cs_real_t *visls0, cs_real_t *diftl0, cs_int_t *iconv, cs_int_t *istat, cs_int_t *idiff, cs_int_t *idifft, cs_int_t *idircl, cs_int_t *isca, cs_real_t *blencv, cs_real_t *sigmas, cs_int_t *iwarni)
Definition: cs_elec_model.c:441
char * ficfpp
Definition: cs_elec_model.h:110
const cs_real_t cs_elec_permvi
Definition: cs_elec_model.c:243
int * ielecb
Definition: cs_elec_model.h:75
cs_real_t * sigel
Definition: cs_elec_model.h:59
void cs_elec_add_property_fields(const int *ielarc, const int *ieljou)
Definition: cs_elec_model.c:1988
void elphyv(void)
Definition: cs_elec_model.c:484
cs_real_t pot_diff
Definition: cs_elec_model.h:105
option for electric model
Definition: cs_elec_model.h:92
cs_real_t * rnbs
Definition: cs_elec_model.h:81
integer, dimension(nvarmx), save idifft
take turbulent diffusion into account:
Definition: optcal.f90:70
void cs_electrical_model_finalize(int ielarc, int ieljou)
Definition: cs_elec_model.c:608
int npoint
Definition: cs_elec_model.h:54
integer, dimension(nvarmx), save iwarni
characterizes the level of detail of the outputs for the variable ivar (from 1 to nvar)...
Definition: entsor.f90:50
#define END_C_DECLS
Definition: cs_defs.h:449
void cs_electrical_properties_read(int ielarc, int ieljou)
Definition: cs_elec_model.c:827
int ntfref
Definition: cs_elec_model.h:77
int ielcor
Definition: cs_elec_model.h:100
void elprop(cs_int_t *ieljou, cs_int_t *ielarc)
Definition: cs_elec_model.c:513
#define CS_PROCF(x, y)
Definition: cs_defs.h:472
void cs_electrical_model_specific_initialization(cs_real_t *visls0, cs_real_t *diftl0, int *iconv, int *istat, int *idiff, int *idifft, int *idircl, int *isca, cs_real_t *blencv, cs_real_t *sigmas, int *iwarni)
Definition: cs_elec_model.c:644
integer, dimension(nvarmx), save istat
take unsteady term into account:
Definition: optcal.f90:55
cs_real_t * tenspr
Definition: cs_elec_model.h:80
cs_real_t couimp
Definition: cs_elec_model.h:104
physical properties for electric model descriptor.
Definition: cs_elec_model.h:52
void elflux(cs_int_t *iappel)
Definition: cs_elec_model.c:460
cs_elec_option_t * cs_get_glob_elec_option(void)
Definition: cs_elec_model.c:540
int idreca
Definition: cs_elec_model.h:102
int ixkabe
Definition: cs_elec_model.h:95
cs_real_t * th
Definition: cs_elec_model.h:55
cs_real_t * ehgaz
Definition: cs_elec_model.h:56
Structure to read transformer parameters in dp_ELE.
Definition: cs_elec_model.h:71
Definition: mesh.f90:26
integer ieljou
pointer to specify Joule effect module (Laplace forces not taken into account) with indicator ippmod(...
Definition: ppincl.f90:165
void ellecd(cs_int_t *ieljou, cs_int_t *ielarc)
Definition: cs_elec_model.c:476
int * ielect
Definition: cs_elec_model.h:74
void cs_compute_electric_field(const cs_mesh_t *mesh, int call_id)
Definition: cs_elec_model.c:1419