9.2
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-2026 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 "base/cs_defs.h"
35
36#include "cdo/cs_domain.h"
37#include "mesh/cs_mesh.h"
39
40/*=============================================================================
41 * Macro definitions
42 *============================================================================*/
43
44/*============================================================================
45 * Type definitions
46 *============================================================================*/
47
48/*----------------------------------------------------------------------------
49 * Structure to read properties in dp_ELE
50 *----------------------------------------------------------------------------*/
51
52typedef struct {
53
54 int n_gas;
64
66
67/*----------------------------------------------------------------------------
68 * Structure to read transformer parameters in dp_ELE
69 *----------------------------------------------------------------------------*/
70
71typedef struct {
72
73 int nbelec;
74 int *ielecc;
75 int *ielect;
76 int *ielecb;
77 int nbtrf;
78 int ntfref;
79 int *ibrpr;
80 int *ibrsec;
87
89
90/*----------------------------------------------------------------------------
91 * Electrical model options descriptor
92 *----------------------------------------------------------------------------*/
93
94typedef struct {
95
96 int ixkabe;
97 int ntdcla;
99 cs_real_t restrike_point[3];
100 cs_real_t crit_reca[5];
101
107 int *izreca;
117
119
120/*============================================================================
121 * Static global variables
122 *============================================================================*/
123
124/* Pointer to electrical model options structure */
125
129
130/* Constant for electrical models */
131
132extern const cs_real_t cs_elec_permvi;
133extern const cs_real_t cs_elec_epszer;
134
135/*=============================================================================
136 * Public function prototypes
137 *============================================================================*/
138
139/*----------------------------------------------------------------------------
140 * Provide access to cs_elec_option
141 *----------------------------------------------------------------------------*/
142
145
146/*----------------------------------------------------------------------------
147 * Provide access to cs_glob_transformer
148 *----------------------------------------------------------------------------*/
149
152
153/*----------------------------------------------------------------------------
154 * Initialize structures for electrical model
155 *----------------------------------------------------------------------------*/
156
157void
159
160/*----------------------------------------------------------------------------
161 * Destroy structures for electrical model
162 *----------------------------------------------------------------------------*/
163
164void
166
167/*----------------------------------------------------------------------------
168 * Specific initialization for electric arc
169 *----------------------------------------------------------------------------*/
170
171void
173
174/*----------------------------------------------------------------------------
175 * Read properties file
176 *----------------------------------------------------------------------------*/
177
178void
180
181/*----------------------------------------------------------------------------
182 * compute specific electric arc fields
183 *----------------------------------------------------------------------------*/
184
185void
187 int call_id);
188
189/*----------------------------------------------------------------------------
190 * compute physical properties
191 *----------------------------------------------------------------------------*/
192
193void
195
196/*----------------------------------------------------------------------------
197 * compute source terms for energy
198 *----------------------------------------------------------------------------*/
199
200void
202 const cs_mesh_quantities_t *mesh_quantities,
203 int f_id,
204 cs_real_t *smbrs);
205
206/*----------------------------------------------------------------------------
207 * compute source terms for vector potential
208 *----------------------------------------------------------------------------*/
209
210void
212 const cs_mesh_quantities_t *mesh_quantities,
213 int f_id,
214 cs_real_3_t *smbrv);
215
216/*----------------------------------------------------------------------------
217 * add variables fields
218 *----------------------------------------------------------------------------*/
219
220void
222
223/*----------------------------------------------------------------------------
224 * add properties fields
225 *----------------------------------------------------------------------------*/
226
227void
229
230/*----------------------------------------------------------------------------
231 * initialize electric fields
232 *----------------------------------------------------------------------------*/
233
234void
236
237/*----------------------------------------------------------------------------
238 * scaling electric quantities
239 *----------------------------------------------------------------------------*/
240
241void
243 const cs_mesh_quantities_t *mesh_quantities,
244 cs_real_t *dt);
245
246/*----------------------------------------------------------------------------*/
256/*----------------------------------------------------------------------------*/
257
258void
260 cs_real_t t[]);
261
262/*----------------------------------------------------------------------------*/
271/*----------------------------------------------------------------------------*/
272
275 cs_real_t enthal);
276
277/*----------------------------------------------------------------------------*/
287/*----------------------------------------------------------------------------*/
288
289void
291 cs_real_t h[]);
292
293/*----------------------------------------------------------------------------*/
305/*----------------------------------------------------------------------------*/
306
307void
309 const cs_lnum_t face_ids[],
310 const cs_real_t t[],
311 cs_real_t h[]);
312
313/*----------------------------------------------------------------------------*/
322/*----------------------------------------------------------------------------*/
323
326 cs_real_t temp);
327
328/*----------------------------------------------------------------------------*/
333/*----------------------------------------------------------------------------*/
334
335void
337
338/*----------------------------------------------------------------------------*/
339
340#endif /* CS_ELEC_MODEL_H */
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:349
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
void cs_elec_fields_initialize(const cs_mesh_t *mesh)
Definition: cs_elec_model.cpp:1915
void cs_elec_add_property_fields(void)
Definition: cs_elec_model.cpp:1791
cs_elec_option_t * cs_get_glob_elec_option(void)
Definition: cs_elec_model.cpp:643
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.cpp:1608
void cs_electrical_properties_read(void)
Definition: cs_elec_model.cpp:835
const cs_real_t cs_elec_epszer
Definition: cs_elec_model.cpp:275
cs_real_t cs_elec_convert_t_to_h(const cs_real_t ym[], cs_real_t temp)
Convert single temperature value to enthalpy.
Definition: cs_elec_model.cpp:2364
const cs_data_elec_t * cs_glob_elec_properties
void cs_electrical_model_initialize(void)
Definition: cs_elec_model.cpp:663
void cs_elec_add_variable_fields(void)
Definition: cs_elec_model.cpp:1699
void cs_elec_convert_t_to_h_cells(const cs_real_t t[], cs_real_t h[])
Convert temperature to enthalpy at all cells.
Definition: cs_elec_model.cpp:2259
const cs_data_joule_effect_t * cs_glob_transformer
void cs_elec_define_functions(void)
Create or access function objects specific to electric arcs models.
Definition: cs_elec_model.cpp:2412
void cs_electrical_model_finalize(void)
Definition: cs_elec_model.cpp:707
void cs_elec_physical_properties(cs_domain_t *domain)
Definition: cs_elec_model.cpp:1029
void cs_elec_convert_t_to_h_faces(const cs_lnum_t n_faces, const cs_lnum_t face_ids[], const cs_real_t t[], cs_real_t h[])
Convert temperature to enthalpy at selected boundary faces.
Definition: cs_elec_model.cpp:2310
const cs_elec_option_t * cs_glob_elec_option
void cs_elec_compute_fields(const cs_mesh_t *mesh, int call_id)
Definition: cs_elec_model.cpp:1337
cs_real_t cs_elec_convert_h_to_t(const cs_real_t ym[], cs_real_t enthal)
Convert single enthalpy value to temperature.
Definition: cs_elec_model.cpp:2200
void cs_electrical_model_specific_initialization(void)
Definition: cs_elec_model.cpp:744
void cs_elec_convert_h_to_t_faces(const cs_real_t h[], cs_real_t t[])
Convert enthalpy to temperature at all boundary faces.
Definition: cs_elec_model.cpp:2148
cs_data_joule_effect_t * cs_get_glob_transformer(void)
Definition: cs_elec_model.cpp:653
const cs_real_t cs_elec_permvi
Definition: cs_elec_model.cpp:269
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.cpp:1959
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.cpp:1667
@ t
Definition: cs_field_pointer.h:91
@ h
Definition: cs_field_pointer.h:90
@ dt
Definition: cs_field_pointer.h:61
Definition: mesh.f90:26
physical properties for electric model descriptor.
Definition: cs_elec_model.h:52
cs_real_t * sigel
Definition: cs_elec_model.h:60
int n_gas
Definition: cs_elec_model.h:54
cs_real_t * eh_gas
Definition: cs_elec_model.h:57
cs_real_t * th
Definition: cs_elec_model.h:56
cs_real_t * cpel
Definition: cs_elec_model.h:59
cs_real_t * xkabel
Definition: cs_elec_model.h:63
cs_real_t * xlabel
Definition: cs_elec_model.h:62
cs_real_t * rhoel
Definition: cs_elec_model.h:58
cs_real_t * visel
Definition: cs_elec_model.h:61
int n_point
Definition: cs_elec_model.h:55
Structure to read transformer parameters in dp_ELE.
Definition: cs_elec_model.h:71
int nbtrf
Definition: cs_elec_model.h:77
cs_real_t * uioff
Definition: cs_elec_model.h:86
cs_real_t * zi
Definition: cs_elec_model.h:84
int nbelec
Definition: cs_elec_model.h:73
cs_real_t * rnbs
Definition: cs_elec_model.h:82
int ntfref
Definition: cs_elec_model.h:78
int * ibrpr
Definition: cs_elec_model.h:79
cs_real_t * tenspr
Definition: cs_elec_model.h:81
int * ielect
Definition: cs_elec_model.h:75
cs_real_t * zr
Definition: cs_elec_model.h:83
int * ielecc
Definition: cs_elec_model.h:74
int * ielecb
Definition: cs_elec_model.h:76
cs_real_t * uroff
Definition: cs_elec_model.h:85
int * ibrsec
Definition: cs_elec_model.h:80
Structure storing the main features of the computational domain and pointers to the main geometrical ...
Definition: cs_domain.h:120
option for electric model
Definition: cs_elec_model.h:94
cs_real_t pot_diff
Definition: cs_elec_model.h:110
cs_real_t srrom
Definition: cs_elec_model.h:116
int idreca
Definition: cs_elec_model.h:106
int irestrike
Definition: cs_elec_model.h:98
int * izreca
Definition: cs_elec_model.h:107
int ixkabe
Definition: cs_elec_model.h:96
cs_real_t couimp
Definition: cs_elec_model.h:108
cs_real_t puisim
Definition: cs_elec_model.h:111
cs_real_t coejou
Definition: cs_elec_model.h:113
cs_real_t elcou
Definition: cs_elec_model.h:115
int ielcor
Definition: cs_elec_model.h:104
int modrec
Definition: cs_elec_model.h:105
int ntdcla
Definition: cs_elec_model.h:97
Definition: cs_mesh_quantities.h:88
Definition: cs_mesh.h:85