8.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-2024 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
56typedef struct {
57
58 int ngaz;
59 int npoint;
68
70
71/*----------------------------------------------------------------------------
72 * Structure to read transformer parameters in dp_ELE
73 *----------------------------------------------------------------------------*/
74
75typedef struct {
76
77 int nbelec;
78 int *ielecc;
79 int *ielect;
80 int *ielecb;
81 int nbtrf;
82 int ntfref;
83 int *ibrpr;
84 int *ibrsec;
91
93
94/*----------------------------------------------------------------------------
95 * Electrical model options descriptor
96 *----------------------------------------------------------------------------*/
97
98typedef struct {
99
103 cs_real_t restrike_point[3];
104 cs_real_t crit_reca[5];
105
111 int *izreca;
121
123
124/*============================================================================
125 * Static global variables
126 *============================================================================*/
127
128/* Pointer to electrical model options structure */
129
133
134/* Constant for electrical models */
135
136extern const cs_real_t cs_elec_permvi;
137extern const cs_real_t cs_elec_epszer;
138
139/*=============================================================================
140 * Public function prototypes
141 *============================================================================*/
142
143/*----------------------------------------------------------------------------
144 * Provide access to cs_elec_option
145 *----------------------------------------------------------------------------*/
146
149
150/*----------------------------------------------------------------------------
151 * Provide access to cs_glob_transformer
152 *----------------------------------------------------------------------------*/
153
156
157/*----------------------------------------------------------------------------
158 * Initialize structures for electrical model
159 *----------------------------------------------------------------------------*/
160
161void
163
164/*----------------------------------------------------------------------------
165 * Destroy structures for electrical model
166 *----------------------------------------------------------------------------*/
167
168void
170
171/*----------------------------------------------------------------------------
172 * Specific initialization for electric arc
173 *----------------------------------------------------------------------------*/
174
175void
177
178/*----------------------------------------------------------------------------
179 * Read properties file
180 *----------------------------------------------------------------------------*/
181
182void
184
185/*----------------------------------------------------------------------------
186 * compute specific electric arc fields
187 *----------------------------------------------------------------------------*/
188
189void
191 int call_id);
192
193/*----------------------------------------------------------------------------
194 * compute physical properties
195 *----------------------------------------------------------------------------*/
196
197void
199
200/*----------------------------------------------------------------------------
201 * compute source terms for energy
202 *----------------------------------------------------------------------------*/
203
204void
206 const cs_mesh_quantities_t *mesh_quantities,
207 int f_id,
208 cs_real_t *smbrs);
209
210/*----------------------------------------------------------------------------
211 * compute source terms for vector potential
212 *----------------------------------------------------------------------------*/
213
214void
216 const cs_mesh_quantities_t *mesh_quantities,
217 int f_id,
218 cs_real_3_t *smbrv);
219
220/*----------------------------------------------------------------------------
221 * add variables fields
222 *----------------------------------------------------------------------------*/
223
224void
226
227/*----------------------------------------------------------------------------
228 * add properties fields
229 *----------------------------------------------------------------------------*/
230
231void
233
234/*----------------------------------------------------------------------------
235 * initialize electric fields
236 *----------------------------------------------------------------------------*/
237
238void
240
241/*----------------------------------------------------------------------------
242 * scaling electric quantities
243 *----------------------------------------------------------------------------*/
244
245void
247 const cs_mesh_quantities_t *mesh_quantities,
248 cs_real_t *dt);
249
250/*----------------------------------------------------------------------------*/
260/*----------------------------------------------------------------------------*/
261
262void
264 cs_real_t t[]);
265
266/*----------------------------------------------------------------------------*/
275/*----------------------------------------------------------------------------*/
276
279 cs_real_t enthal);
280
281/*----------------------------------------------------------------------------*/
291/*----------------------------------------------------------------------------*/
292
293void
295 cs_real_t h[]);
296
297/*----------------------------------------------------------------------------*/
309/*----------------------------------------------------------------------------*/
310
311void
313 const cs_lnum_t face_ids[],
314 const cs_real_t t[],
315 cs_real_t h[]);
316
317/*----------------------------------------------------------------------------*/
326/*----------------------------------------------------------------------------*/
327
330 cs_real_t temp);
331
332/*----------------------------------------------------------------------------*/
337/*----------------------------------------------------------------------------*/
338
339void
341
342/*----------------------------------------------------------------------------*/
343
345
346#endif /* __CS_ELEC_MODEL_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:359
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
void cs_elec_fields_initialize(const cs_mesh_t *mesh)
Definition: cs_elec_model.cpp:1980
void cs_elec_add_property_fields(void)
Definition: cs_elec_model.cpp:1856
cs_elec_option_t * cs_get_glob_elec_option(void)
Definition: cs_elec_model.cpp:685
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:1671
void cs_electrical_properties_read(void)
Definition: cs_elec_model.cpp:871
const cs_real_t cs_elec_epszer
Definition: cs_elec_model.cpp:279
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:2438
const cs_data_elec_t * cs_glob_elec_properties
void cs_electrical_model_initialize(void)
Definition: cs_elec_model.cpp:705
void cs_elec_add_variable_fields(void)
Definition: cs_elec_model.cpp:1764
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:2327
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:2486
void cs_electrical_model_finalize(void)
Definition: cs_elec_model.cpp:749
void cs_elec_physical_properties(cs_domain_t *domain)
Definition: cs_elec_model.cpp:1065
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:2381
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:1391
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:2268
void cs_electrical_model_specific_initialization(void)
Definition: cs_elec_model.cpp:786
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:2213
cs_data_joule_effect_t * cs_get_glob_transformer(void)
Definition: cs_elec_model.cpp:695
const cs_real_t cs_elec_permvi
Definition: cs_elec_model.cpp:273
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:2026
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:1732
@ t
Definition: cs_field_pointer.h:94
@ h
Definition: cs_field_pointer.h:93
@ dt
Definition: cs_field_pointer.h:65
Definition: mesh.f90:26
physical properties for electric model descriptor.
Definition: cs_elec_model.h:56
cs_real_t * sigel
Definition: cs_elec_model.h:64
int ngaz
Definition: cs_elec_model.h:58
cs_real_t * th
Definition: cs_elec_model.h:60
int npoint
Definition: cs_elec_model.h:59
cs_real_t * cpel
Definition: cs_elec_model.h:63
cs_real_t * xkabel
Definition: cs_elec_model.h:67
cs_real_t * xlabel
Definition: cs_elec_model.h:66
cs_real_t * rhoel
Definition: cs_elec_model.h:62
cs_real_t * ehgaz
Definition: cs_elec_model.h:61
cs_real_t * visel
Definition: cs_elec_model.h:65
Structure to read transformer parameters in dp_ELE.
Definition: cs_elec_model.h:75
int nbtrf
Definition: cs_elec_model.h:81
cs_real_t * uioff
Definition: cs_elec_model.h:90
cs_real_t * zi
Definition: cs_elec_model.h:88
int nbelec
Definition: cs_elec_model.h:77
cs_real_t * rnbs
Definition: cs_elec_model.h:86
int ntfref
Definition: cs_elec_model.h:82
int * ibrpr
Definition: cs_elec_model.h:83
cs_real_t * tenspr
Definition: cs_elec_model.h:85
int * ielect
Definition: cs_elec_model.h:79
cs_real_t * zr
Definition: cs_elec_model.h:87
int * ielecc
Definition: cs_elec_model.h:78
int * ielecb
Definition: cs_elec_model.h:80
cs_real_t * uroff
Definition: cs_elec_model.h:89
int * ibrsec
Definition: cs_elec_model.h:84
Structure storing the main features of the computational domain and pointers to the main geometrical ...
Definition: cs_domain.h:129
option for electric model
Definition: cs_elec_model.h:98
cs_real_t pot_diff
Definition: cs_elec_model.h:114
cs_real_t srrom
Definition: cs_elec_model.h:120
int idreca
Definition: cs_elec_model.h:110
int irestrike
Definition: cs_elec_model.h:102
int * izreca
Definition: cs_elec_model.h:111
int ixkabe
Definition: cs_elec_model.h:100
cs_real_t couimp
Definition: cs_elec_model.h:112
cs_real_t puisim
Definition: cs_elec_model.h:115
cs_real_t coejou
Definition: cs_elec_model.h:117
cs_real_t elcou
Definition: cs_elec_model.h:119
int ielcor
Definition: cs_elec_model.h:108
int modrec
Definition: cs_elec_model.h:109
int ntdcla
Definition: cs_elec_model.h:101
Definition: cs_mesh_quantities.h:92
Definition: cs_mesh.h:85