7.0
general documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cs_maxwell.h
Go to the documentation of this file.
1 #ifndef __CS_MAXWELL_H__
2 #define __CS_MAXWELL_H__
3 
4 /*============================================================================
5  * Header to handle the maxwell module with CDO schemes
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2021 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  * Local headers
30  *----------------------------------------------------------------------------*/
31 
32 #include "cs_base.h"
33 #include "cs_time_step.h"
34 #include "cs_equation.h"
35 
36 /*----------------------------------------------------------------------------*/
37 
39 
48 /*============================================================================
49  * Macro definitions
50  *============================================================================*/
51 
52 /* Generic name given to fields and equations related to this module */
53 
54 #define CS_MAXWELL_ESTATIC_EQNAME "electrostatic"
55 #define CS_MAXWELL_EFIELD_NAME "electric_field"
56 #define CS_MAXWELL_DFIELD_NAME "electric_induction"
57 
58 #define CS_MAXWELL_MSTATIC_EQNAME "magnetostatic"
59 #define CS_MAXWELL_MFIELD_NAME "magnetic_field"
60 #define CS_MAXWELL_BFIELD_NAME "magnetic_induction"
61 
62 #define CS_MAXWELL_JEFFECT_NAME "joule_effect"
63 
92 #define CS_MAXWELL_MODEL_ELECTROSTATIC (1 << 0) /* 1 */
93 #define CS_MAXWELL_MODEL_MAGNETOSTATIC (1 << 1) /* 2 */
94 
109 #define CS_MAXWELL_A_PHI_FORMULATION (1 << 0) /* 1 */
110 #define CS_MAXWELL_JOULE_EFFECT (1 << 1) /* 2 */
111 
116 /*=============================================================================
117  * Structure and type definitions
118  *============================================================================*/
119 
120 typedef struct _maxwell_t cs_maxwell_t;
121 
122 /*============================================================================
123  * Public function prototypes
124  *============================================================================*/
125 
126 /*----------------------------------------------------------------------------*/
130 /*----------------------------------------------------------------------------*/
131 
132 bool
134 
135 /*----------------------------------------------------------------------------*/
144 /*----------------------------------------------------------------------------*/
145 
146 cs_maxwell_t *
148  cs_flag_t options);
149 
150 /*----------------------------------------------------------------------------*/
156 /*----------------------------------------------------------------------------*/
157 
158 cs_maxwell_t *
160 
161 /*----------------------------------------------------------------------------*/
165 /*----------------------------------------------------------------------------*/
166 
167 void
169 
170 /*----------------------------------------------------------------------------*/
177 /*----------------------------------------------------------------------------*/
178 
179 void
181  const cs_cdo_quantities_t *quant);
182 
183 /*----------------------------------------------------------------------------*/
187 /*----------------------------------------------------------------------------*/
188 
189 void
191 
192 /*----------------------------------------------------------------------------*/
202 /*----------------------------------------------------------------------------*/
203 
204 void
206  const cs_time_step_t *time_step,
207  const cs_cdo_connect_t *connect,
208  const cs_cdo_quantities_t *quant);
209 
210 /*----------------------------------------------------------------------------*/
219 /*----------------------------------------------------------------------------*/
220 
221 void
223  const cs_time_step_t *time_step,
224  const cs_cdo_connect_t *connect,
225  const cs_cdo_quantities_t *quant);
226 
227 /*----------------------------------------------------------------------------*/
237 /*----------------------------------------------------------------------------*/
238 
239 void
241  const cs_cdo_connect_t *connect,
242  const cs_cdo_quantities_t *quant,
243  const cs_time_step_t *ts,
244  bool cur2prev);
245 
246 /*----------------------------------------------------------------------------*/
253 /*----------------------------------------------------------------------------*/
254 
255 void
257  const cs_cdo_quantities_t *quant);
258 
259 /*----------------------------------------------------------------------------*/
281 /*----------------------------------------------------------------------------*/
282 
283 void
284 cs_maxwell_extra_post(void *input,
285  int mesh_id,
286  int cat_id,
287  int ent_flag[5],
288  cs_lnum_t n_cells,
289  cs_lnum_t n_i_faces,
290  cs_lnum_t n_b_faces,
291  const cs_lnum_t cell_ids[],
292  const cs_lnum_t i_face_ids[],
293  const cs_lnum_t b_face_ids[],
294  const cs_time_step_t *time_step);
295 
296 /*----------------------------------------------------------------------------*/
297 
299 
300 #endif /* __CS_MAXWELL_H__ */
time step descriptor
Definition: cs_time_step.h:64
void cs_maxwell_finalize_setup(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)
Finalize the setup stage for equations related to the Maxwell module.
Definition: cs_maxwell.c:544
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
void cs_maxwell_update(const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, bool cur2prev)
Update/initialize the Maxwell module according to the settings.
Definition: cs_maxwell.c:715
Definition: cs_cdo_connect.h:76
Definition: cs_cdo_quantities.h:124
Definition: cs_mesh.h:84
void cs_maxwell_extra_post(void *input, int mesh_id, int cat_id, int ent_flag[5], cs_lnum_t n_cells, cs_lnum_t n_i_faces, cs_lnum_t n_b_faces, const cs_lnum_t cell_ids[], const cs_lnum_t i_face_ids[], const cs_lnum_t b_face_ids[], const cs_time_step_t *time_step)
Predefined post-processing output for the Maxwell module. Prototype of this function is fixed since i...
Definition: cs_maxwell.c:851
void cs_maxwell_init_setup(void)
Setup equations/properties related to the Maxwell module.
Definition: cs_maxwell.c:462
cs_maxwell_t * cs_maxwell_activate(cs_flag_t model, cs_flag_t options)
Activate the future computation of the Maxwell equations.
Definition: cs_maxwell.c:345
bool cs_maxwell_is_activated(void)
Test if the computation of Maxwell equations is activated.
Definition: cs_maxwell.c:325
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:301
#define END_C_DECLS
Definition: cs_defs.h:496
unsigned short int cs_flag_t
Definition: cs_defs.h:309
void cs_maxwell_extra_op(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)
Predefined extra-operations for the Maxwell module.
Definition: cs_maxwell.c:812
cs_maxwell_t * cs_maxwell_destroy_all(void)
Free the main structure related to the Maxwell module.
Definition: cs_maxwell.c:433
void cs_maxwell_compute_steady_state(const cs_mesh_t *mesh, const cs_time_step_t *time_step, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)
Solve if needed the steady-state equations related to the Maxwell module.
Definition: cs_maxwell.c:634
void cs_maxwell_log_setup(void)
Log a summary of the Maxwell module.
Definition: cs_maxwell.c:599
void cs_maxwell_compute(const cs_mesh_t *mesh, const cs_time_step_t *time_step, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)
Solve equations related to the Maxwell module.
Definition: cs_maxwell.c:685
Definition: mesh.f90:26