9.2
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-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 * Local headers
30 *----------------------------------------------------------------------------*/
31
32#include "base/cs_base.h"
33#include "base/cs_time_step.h"
34#include "cdo/cs_equation.h"
35
36/*============================================================================
37 * Macro definitions
38 *============================================================================*/
39
40/* Generic name given to fields and equations related to this module */
41
42#define CS_MAXWELL_ESTATIC_EQNAME "electrostatic"
43#define CS_MAXWELL_EFIELD_NAME "electric_field"
44#define CS_MAXWELL_DFIELD_NAME "electric_induction"
45
46#define CS_MAXWELL_MSTATIC_EQNAME "magnetostatic"
47#define CS_MAXWELL_MFIELD_NAME "magnetic_field"
48#define CS_MAXWELL_BFIELD_NAME "magnetic_induction"
49
50#define CS_MAXWELL_JEFFECT_NAME "joule_effect"
51
80#define CS_MAXWELL_MODEL_ELECTROSTATIC (1 << 0) /* 1 */
81#define CS_MAXWELL_MODEL_MAGNETOSTATIC (1 << 1) /* 2 */
82
97#define CS_MAXWELL_A_PHI_FORMULATION (1 << 0) /* 1 */
98#define CS_MAXWELL_JOULE_EFFECT (1 << 1) /* 2 */
99
104/*=============================================================================
105 * Structure and type definitions
106 *============================================================================*/
107
108typedef struct _maxwell_t cs_maxwell_t;
109
110/*============================================================================
111 * Public function prototypes
112 *============================================================================*/
113
114/*----------------------------------------------------------------------------*/
118/*----------------------------------------------------------------------------*/
119
120bool
122
123/*----------------------------------------------------------------------------*/
132/*----------------------------------------------------------------------------*/
133
134cs_maxwell_t *
136 cs_flag_t options);
137
138/*----------------------------------------------------------------------------*/
144/*----------------------------------------------------------------------------*/
145
146cs_maxwell_t *
148
149/*----------------------------------------------------------------------------*/
153/*----------------------------------------------------------------------------*/
154
155void
157
158/*----------------------------------------------------------------------------*/
165/*----------------------------------------------------------------------------*/
166
167void
169 const cs_cdo_quantities_t *quant);
170
171/*----------------------------------------------------------------------------*/
175/*----------------------------------------------------------------------------*/
176
177void
179
180/*----------------------------------------------------------------------------*/
190/*----------------------------------------------------------------------------*/
191
192void
194 const cs_time_step_t *time_step,
195 const cs_cdo_connect_t *connect,
196 const cs_cdo_quantities_t *quant);
197
198/*----------------------------------------------------------------------------*/
207/*----------------------------------------------------------------------------*/
208
209void
211 const cs_time_step_t *time_step,
212 const cs_cdo_connect_t *connect,
213 const cs_cdo_quantities_t *quant);
214
215/*----------------------------------------------------------------------------*/
225/*----------------------------------------------------------------------------*/
226
227void
229 const cs_cdo_connect_t *connect,
230 const cs_cdo_quantities_t *quant,
231 const cs_time_step_t *ts,
232 bool cur2prev);
233
234/*----------------------------------------------------------------------------*/
241/*----------------------------------------------------------------------------*/
242
243void
245 const cs_cdo_quantities_t *quant);
246
247/*----------------------------------------------------------------------------*/
269/*----------------------------------------------------------------------------*/
270
271void
272cs_maxwell_extra_post(void *input,
273 int mesh_id,
274 int cat_id,
275 int ent_flag[5],
276 cs_lnum_t n_cells,
277 cs_lnum_t n_i_faces,
278 cs_lnum_t n_b_faces,
279 const cs_lnum_t cell_ids[],
280 const cs_lnum_t i_face_ids[],
281 const cs_lnum_t b_face_ids[],
282 const cs_time_step_t *time_step);
283
284#endif /* CS_MAXWELL_H */
time step descriptor
Definition: cs_time_step.h:60
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
unsigned short int cs_flag_t
Definition: cs_defs.h:334
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.cpp:852
bool cs_maxwell_is_activated(void)
Test if the computation of Maxwell equations is activated.
Definition: cs_maxwell.cpp:338
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.cpp:358
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.cpp:746
void cs_maxwell_log_setup(void)
Log a summary of the Maxwell module.
Definition: cs_maxwell.cpp:633
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.cpp:891
cs_maxwell_t * cs_maxwell_destroy_all(void)
Free the main structure related to the Maxwell module.
Definition: cs_maxwell.cpp:452
void cs_maxwell_init_setup(void)
Setup equations/properties related to the Maxwell module.
Definition: cs_maxwell.cpp:481
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.cpp:577
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.cpp:715
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.cpp:667
Definition: mesh.f90:26
Definition: cs_cdo_connect.h:57
Definition: cs_cdo_quantities.h:142
Definition: cs_mesh.h:85