6.3
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-2020 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 *diftl0);
135 
136 void
137 CS_PROCF (elflux, ELFLUX) (int *iappel);
138 
139 void
140 CS_PROCF (elthht, ELTHHT) (int *mode,
141  cs_real_t *ym,
142  cs_real_t *enthal,
143  cs_real_t *temp);
144 
145 void
146 CS_PROCF (ellecd, ELLECD) (void);
147 
148 void
149 CS_PROCF (elphyv, ELPHYV) (void);
150 
151 void
152 CS_PROCF (eltssc, ELTSSC) (const int *isca,
153  cs_real_t *smbrs);
154 
155 void
156 CS_PROCF (eltsvv, ELTSVV) (const int *f_id,
157  cs_real_t *smbrv);
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  * convert enthalpy-temperature
221  *----------------------------------------------------------------------------*/
222 
223 void
224 cs_elec_convert_h_t(int mode,
225  cs_real_t *ym,
226  cs_real_t *enthal,
227  cs_real_t *temp);
228 
229 /*----------------------------------------------------------------------------
230  * compute physical properties
231  *----------------------------------------------------------------------------*/
232 
233 void
235 
236 /*----------------------------------------------------------------------------
237  * compute source terms for energy
238  *----------------------------------------------------------------------------*/
239 
240 void
242  const cs_mesh_quantities_t *mesh_quantities,
243  int f_id,
244  cs_real_t *smbrs);
245 
246 /*----------------------------------------------------------------------------
247  * compute source terms for vector potential
248  *----------------------------------------------------------------------------*/
249 
250 void
252  const cs_mesh_quantities_t *mesh_quantities,
253  int f_id,
254  cs_real_3_t *smbrv);
255 
256 /*----------------------------------------------------------------------------
257  * add variables fields
258  *----------------------------------------------------------------------------*/
259 
260 void
262 
263 /*----------------------------------------------------------------------------
264  * add properties fields
265  *----------------------------------------------------------------------------*/
266 
267 void
269 
270 /*----------------------------------------------------------------------------
271  * initialize electric fields
272  *----------------------------------------------------------------------------*/
273 
274 void
276  int isuite);
277 
278 /*----------------------------------------------------------------------------
279  * scaling electric quantities
280  *----------------------------------------------------------------------------*/
281 
282 void
284  const cs_mesh_quantities_t *mesh_quantities,
285  cs_real_t *dt);
286 
287 /*----------------------------------------------------------------------------*/
288 
290 
291 #endif /* __CS_ELEC_MODEL_H__ */
cs_elec_convert_h_t
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:935
cs_elec_option_t::idreca
int idreca
Definition: cs_elec_model.h:104
cs_glob_transformer
const cs_data_joule_effect_t * cs_glob_transformer
cs_defs.h
cs_domain_t
Structure storing the main features of the computational domain and pointers to the main geometrical ...
Definition: cs_domain.h:88
optcal::isuite
integer, save isuite
Indicator of a calculation restart (=1) or not (=0). This value is set automatically by the code; dep...
Definition: optcal.f90:282
cs_domain.h
cs_elec_option_t::elcou
cs_real_t elcou
Definition: cs_elec_model.h:110
cs_elec_option_t::srrom
cs_real_t srrom
Definition: cs_elec_model.h:111
cs_real_3_t
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:317
cs_data_joule_effect_t::zr
cs_real_t * zr
Definition: cs_elec_model.h:86
numvar::isca
integer, dimension(nscamx), save isca
isca(i) is the index of the scalar i
Definition: numvar.f90:131
cs_elec_option_t::irestrike
int irestrike
Definition: cs_elec_model.h:99
cs_elec_option_t::couimp
cs_real_t couimp
Definition: cs_elec_model.h:106
cs_data_elec_t::visel
cs_real_t * visel
Definition: cs_elec_model.h:64
dt
@ dt
Definition: cs_field_pointer.h:65
cs_elec_option_t::ielcor
int ielcor
Definition: cs_elec_model.h:102
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:493
cs_elec_add_property_fields
void cs_elec_add_property_fields(void)
Definition: cs_elec_model.c:1843
elthht
void elthht(int *mode, cs_real_t *ym, cs_real_t *enthal, cs_real_t *temp)
Definition: cs_elec_model.c:484
cs_elec_option_t::coejou
cs_real_t coejou
Definition: cs_elec_model.h:109
cs_elec_add_variable_fields
void cs_elec_add_variable_fields(void)
Definition: cs_elec_model.c:1747
cs_data_elec_t::xkabel
cs_real_t * xkabel
Definition: cs_elec_model.h:66
cs_data_joule_effect_t::tenspr
cs_real_t * tenspr
Definition: cs_elec_model.h:84
cs_data_elec_t::ngaz
int ngaz
Definition: cs_elec_model.h:57
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:304
cs_data_joule_effect_t::ielect
int * ielect
Definition: cs_elec_model.h:78
ellecd
void ellecd(void)
Definition: cs_elec_model.c:493
cs_data_joule_effect_t::rnbs
cs_real_t * rnbs
Definition: cs_elec_model.h:85
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:492
cs_mesh_quantities.h
cs_elec_epszer
const cs_real_t cs_elec_epszer
Definition: cs_elec_model.c:275
cs_electrical_properties_read
void cs_electrical_properties_read(void)
Definition: cs_elec_model.c:743
cs_data_elec_t::sigel
cs_real_t * sigel
Definition: cs_elec_model.h:63
cs_elec_physical_properties
void cs_elec_physical_properties(cs_domain_t *domain)
Definition: cs_elec_model.c:1031
cs_get_glob_elec_option
cs_elec_option_t * cs_get_glob_elec_option(void)
Definition: cs_elec_model.c:551
cs_mesh_quantities_t
Definition: cs_mesh_quantities.h:89
eltsvv
void eltsvv(const int *f_id, cs_real_t *smbrv)
Definition: cs_elec_model.c:521
eltssc
void eltssc(const int *isca, cs_real_t *smbrs)
Definition: cs_elec_model.c:506
elflux
void elflux(int *iappel)
Definition: cs_elec_model.c:477
elphyv
void elphyv(void)
Definition: cs_elec_model.c:500
mesh
Definition: mesh.f90:26
cs_elec_fields_initialize
void cs_elec_fields_initialize(const cs_mesh_t *mesh, int isuite)
Definition: cs_elec_model.c:1962
cs_data_joule_effect_t::ielecc
int * ielecc
Definition: cs_elec_model.h:77
cs_elec_permvi
const cs_real_t cs_elec_permvi
Definition: cs_elec_model.c:269
cs_mesh.h
eliniv
void eliniv(int *isuite)
Definition: cs_elec_model.c:531
cs_data_elec_t
physical properties for electric model descriptor.
Definition: cs_elec_model.h:56
ppthch::diftl0
double precision, save diftl0
molecular diffusivity for the enthalpy ( ) for gas or coal combustion (the code then automatically se...
Definition: ppthch.f90:162
cs_electrical_model_initialize
void cs_electrical_model_initialize(void)
Definition: cs_elec_model.c:571
elreca
void elreca(cs_real_t *dt)
Definition: cs_elec_model.c:537
elini1
void elini1(cs_real_t *diftl0)
Definition: cs_elec_model.c:471
cs_elec_option_t
option for electric model
Definition: cs_elec_model.h:96
cs_data_joule_effect_t::ibrsec
int * ibrsec
Definition: cs_elec_model.h:83
cs_data_elec_t::rhoel
cs_real_t * rhoel
Definition: cs_elec_model.h:61
cs_elec_option_t::modrec
int modrec
Definition: cs_elec_model.h:103
cs_elec_option_t::pot_diff
cs_real_t pot_diff
Definition: cs_elec_model.h:107
cs_elec_option_t::izreca
int * izreca
Definition: cs_elec_model.h:105
cs_elec_scaling_function
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:2009
cs_data_joule_effect_t::ibrpr
int * ibrpr
Definition: cs_elec_model.h:82
cs_data_joule_effect_t::ielecb
int * ielecb
Definition: cs_elec_model.h:79
cs_data_elec_t::ehgaz
cs_real_t * ehgaz
Definition: cs_elec_model.h:60
cs_data_joule_effect_t::nbtrf
int nbtrf
Definition: cs_elec_model.h:80
CS_PROCF
#define CS_PROCF(x, y)
Definition: cs_defs.h:506
cs_data_elec_t::cpel
cs_real_t * cpel
Definition: cs_elec_model.h:62
cs_elec_source_terms_v
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:1713
cs_get_glob_transformer
cs_data_joule_effect_t * cs_get_glob_transformer(void)
Definition: cs_elec_model.c:561
cs_elec_compute_fields
void cs_elec_compute_fields(const cs_mesh_t *mesh, int call_id)
Definition: cs_elec_model.c:1351
cs_data_joule_effect_t::uroff
cs_real_t * uroff
Definition: cs_elec_model.h:88
cs_elec_option_t::ixkabe
int ixkabe
Definition: cs_elec_model.h:97
cs_elec_option_t::ntdcla
int ntdcla
Definition: cs_elec_model.h:98
cs_data_joule_effect_t::uioff
cs_real_t * uioff
Definition: cs_elec_model.h:89
cs_data_elec_t::xlabel
cs_real_t * xlabel
Definition: cs_elec_model.h:65
cs_data_joule_effect_t::zi
cs_real_t * zi
Definition: cs_elec_model.h:87
cs_data_elec_t::th
cs_real_t * th
Definition: cs_elec_model.h:59
cs_electrical_model_specific_initialization
void cs_electrical_model_specific_initialization(cs_real_t *diftl0)
Definition: cs_elec_model.c:650
cs_electrical_model_finalize
void cs_electrical_model_finalize(void)
Definition: cs_elec_model.c:613
cs_glob_elec_option
const cs_elec_option_t * cs_glob_elec_option
cs_data_elec_t::npoint
int npoint
Definition: cs_elec_model.h:58
cs_glob_elec_properties
const cs_data_elec_t * cs_glob_elec_properties
cs_data_joule_effect_t::nbelec
int nbelec
Definition: cs_elec_model.h:76
cs_data_joule_effect_t::ntfref
int ntfref
Definition: cs_elec_model.h:81
cs_elec_source_terms
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:1650
cs_elec_option_t::puisim
cs_real_t puisim
Definition: cs_elec_model.h:108
cs_mesh_t
Definition: cs_mesh.h:84
cs_data_joule_effect_t
Structure to read transformer parameters in dp_ELE.
Definition: cs_elec_model.h:75