8.0
general documentation
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-2023 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 
40 /*============================================================================
41  * Macro definitions
42  *============================================================================*/
43 
44 /* Generic name given to fields and equations related to this module */
45 
46 #define CS_MAXWELL_ESTATIC_EQNAME "electrostatic"
47 #define CS_MAXWELL_EFIELD_NAME "electric_field"
48 #define CS_MAXWELL_DFIELD_NAME "electric_induction"
49 
50 #define CS_MAXWELL_MSTATIC_EQNAME "magnetostatic"
51 #define CS_MAXWELL_MFIELD_NAME "magnetic_field"
52 #define CS_MAXWELL_BFIELD_NAME "magnetic_induction"
53 
54 #define CS_MAXWELL_JEFFECT_NAME "joule_effect"
55 
84 #define CS_MAXWELL_MODEL_ELECTROSTATIC (1 << 0) /* 1 */
85 #define CS_MAXWELL_MODEL_MAGNETOSTATIC (1 << 1) /* 2 */
86 
101 #define CS_MAXWELL_A_PHI_FORMULATION (1 << 0) /* 1 */
102 #define CS_MAXWELL_JOULE_EFFECT (1 << 1) /* 2 */
103 
108 /*=============================================================================
109  * Structure and type definitions
110  *============================================================================*/
111 
112 typedef struct _maxwell_t cs_maxwell_t;
113 
114 /*============================================================================
115  * Public function prototypes
116  *============================================================================*/
117 
118 /*----------------------------------------------------------------------------*/
122 /*----------------------------------------------------------------------------*/
123 
124 bool
126 
127 /*----------------------------------------------------------------------------*/
136 /*----------------------------------------------------------------------------*/
137 
138 cs_maxwell_t *
140  cs_flag_t options);
141 
142 /*----------------------------------------------------------------------------*/
148 /*----------------------------------------------------------------------------*/
149 
150 cs_maxwell_t *
152 
153 /*----------------------------------------------------------------------------*/
157 /*----------------------------------------------------------------------------*/
158 
159 void
161 
162 /*----------------------------------------------------------------------------*/
169 /*----------------------------------------------------------------------------*/
170 
171 void
173  const cs_cdo_quantities_t *quant);
174 
175 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 
181 void
183 
184 /*----------------------------------------------------------------------------*/
194 /*----------------------------------------------------------------------------*/
195 
196 void
198  const cs_time_step_t *time_step,
199  const cs_cdo_connect_t *connect,
200  const cs_cdo_quantities_t *quant);
201 
202 /*----------------------------------------------------------------------------*/
211 /*----------------------------------------------------------------------------*/
212 
213 void
215  const cs_time_step_t *time_step,
216  const cs_cdo_connect_t *connect,
217  const cs_cdo_quantities_t *quant);
218 
219 /*----------------------------------------------------------------------------*/
229 /*----------------------------------------------------------------------------*/
230 
231 void
233  const cs_cdo_connect_t *connect,
234  const cs_cdo_quantities_t *quant,
235  const cs_time_step_t *ts,
236  bool cur2prev);
237 
238 /*----------------------------------------------------------------------------*/
245 /*----------------------------------------------------------------------------*/
246 
247 void
249  const cs_cdo_quantities_t *quant);
250 
251 /*----------------------------------------------------------------------------*/
273 /*----------------------------------------------------------------------------*/
274 
275 void
276 cs_maxwell_extra_post(void *input,
277  int mesh_id,
278  int cat_id,
279  int ent_flag[5],
280  cs_lnum_t n_cells,
281  cs_lnum_t n_i_faces,
282  cs_lnum_t n_b_faces,
283  const cs_lnum_t cell_ids[],
284  const cs_lnum_t i_face_ids[],
285  const cs_lnum_t b_face_ids[],
286  const cs_time_step_t *time_step);
287 
288 /*----------------------------------------------------------------------------*/
289 
291 
292 #endif /* __CS_MAXWELL_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:509
#define END_C_DECLS
Definition: cs_defs.h:510
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
unsigned short int cs_flag_t
Definition: cs_defs.h:321
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:849
bool cs_maxwell_is_activated(void)
Test if the computation of Maxwell equations is activated.
Definition: cs_maxwell.c:342
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:748
void cs_maxwell_log_setup(void)
Log a summary of the Maxwell module.
Definition: cs_maxwell.c:637
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:888
void cs_maxwell_init_setup(void)
Setup equations/properties related to the Maxwell module.
Definition: cs_maxwell.c:485
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:580
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:718
cs_maxwell_t * cs_maxwell_destroy_all(void)
Free the main structure related to the Maxwell module.
Definition: cs_maxwell.c:456
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:362
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:671
Definition: mesh.f90:26
Definition: cs_cdo_connect.h:61
Definition: cs_cdo_quantities.h:137
Definition: cs_mesh.h:85
time step descriptor
Definition: cs_time_step.h:64