7.1
general documentation
cs_maxwell.h File Reference

Structure and functions handling the Maxwell module dedicated to the resolution of electro-magnetic equations. More...

#include "cs_base.h"
#include "cs_time_step.h"
#include "cs_equation.h"
+ Include dependency graph for cs_maxwell.h:

Go to the source code of this file.

Macros

#define CS_MAXWELL_ESTATIC_EQNAME   "electrostatic"
 
#define CS_MAXWELL_EFIELD_NAME   "electric_field"
 
#define CS_MAXWELL_DFIELD_NAME   "electric_induction"
 
#define CS_MAXWELL_MSTATIC_EQNAME   "magnetostatic"
 
#define CS_MAXWELL_MFIELD_NAME   "magnetic_field"
 
#define CS_MAXWELL_BFIELD_NAME   "magnetic_induction"
 
#define CS_MAXWELL_JEFFECT_NAME   "joule_effect"
 
Flags specifying the modelling for the Maxwell module

These fields are considered: H (A/m) the magnetic field E (V/m) the electric field B (Vs/m^2) the magnetic induction or magnetic flux density D (As/m^2) the electric induction or electric flux density

Moreover, one considers rho_e the electric charge density j the electric source current (or current for short)

One assumes a quasi-static approximation of the Maxwell equations i.e. ones solves the Ampere equation: curl(H) = j and one solves the Faraday equation: curl(E) = -partial_t B

#define CS_MAXWELL_MODEL_ELECTROSTATIC   (1 << 0) /* 1 */
 Solve the equation -div(epsilon grad(phi)) = rho_e + BCs which results from div(D) = rho_e, D = epsilon E and E = -grad(phi) More...
 
#define CS_MAXWELL_MODEL_MAGNETOSTATIC   (1 << 1) /* 2 */
 Solve the system curl(H) = j, div(mu H) = 0 + BCs which yields curl( 1/mu curl(A)) = j and div(A) = 0 (Coulomb gauge) + BCs if one sets: mu.H = curl(A) More...
 
Flags specifying options for the Maxwell module
#define CS_MAXWELL_A_PHI_FORMULATION   (1 << 0) /* 1 */
 Vector-valued potential (A) and scalar-valued potential (phi) are introduced to solve the Maxwell equations. One introduces the following identities: curl(A) = B and E = -partial_t A - grad(phi) More...
 
#define CS_MAXWELL_JOULE_EFFECT   (1 << 1) /* 2 */
 Take into account the Joule effect. More...
 

Functions

bool cs_maxwell_is_activated (void)
 Test if the computation of Maxwell equations is activated. More...
 
cs_maxwell_t * cs_maxwell_activate (cs_flag_t model, cs_flag_t options)
 Activate the future computation of the Maxwell equations. More...
 
cs_maxwell_t * cs_maxwell_destroy_all (void)
 Free the main structure related to the Maxwell module. More...
 
void cs_maxwell_init_setup (void)
 Setup equations/properties related to the Maxwell module. More...
 
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. More...
 
void cs_maxwell_log_setup (void)
 Log a summary of the Maxwell module. More...
 
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. More...
 
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. More...
 
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. More...
 
void cs_maxwell_extra_op (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)
 Predefined extra-operations for the Maxwell module. More...
 
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 it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t) More...
 

Detailed Description

Structure and functions handling the Maxwell module dedicated to the resolution of electro-magnetic equations.

Macro Definition Documentation

◆ CS_MAXWELL_A_PHI_FORMULATION

#define CS_MAXWELL_A_PHI_FORMULATION   (1 << 0) /* 1 */

Vector-valued potential (A) and scalar-valued potential (phi) are introduced to solve the Maxwell equations. One introduces the following identities: curl(A) = B and E = -partial_t A - grad(phi)

◆ CS_MAXWELL_BFIELD_NAME

#define CS_MAXWELL_BFIELD_NAME   "magnetic_induction"

◆ CS_MAXWELL_DFIELD_NAME

#define CS_MAXWELL_DFIELD_NAME   "electric_induction"

◆ CS_MAXWELL_EFIELD_NAME

#define CS_MAXWELL_EFIELD_NAME   "electric_field"

◆ CS_MAXWELL_ESTATIC_EQNAME

#define CS_MAXWELL_ESTATIC_EQNAME   "electrostatic"

◆ CS_MAXWELL_JEFFECT_NAME

#define CS_MAXWELL_JEFFECT_NAME   "joule_effect"

◆ CS_MAXWELL_JOULE_EFFECT

#define CS_MAXWELL_JOULE_EFFECT   (1 << 1) /* 2 */

Take into account the Joule effect.

◆ CS_MAXWELL_MFIELD_NAME

#define CS_MAXWELL_MFIELD_NAME   "magnetic_field"

◆ CS_MAXWELL_MODEL_ELECTROSTATIC

#define CS_MAXWELL_MODEL_ELECTROSTATIC   (1 << 0) /* 1 */

Solve the equation -div(epsilon grad(phi)) = rho_e + BCs which results from div(D) = rho_e, D = epsilon E and E = -grad(phi)

◆ CS_MAXWELL_MODEL_MAGNETOSTATIC

#define CS_MAXWELL_MODEL_MAGNETOSTATIC   (1 << 1) /* 2 */

Solve the system curl(H) = j, div(mu H) = 0 + BCs which yields curl( 1/mu curl(A)) = j and div(A) = 0 (Coulomb gauge) + BCs if one sets: mu.H = curl(A)

◆ CS_MAXWELL_MSTATIC_EQNAME

#define CS_MAXWELL_MSTATIC_EQNAME   "magnetostatic"

Function Documentation

◆ cs_maxwell_activate()

cs_maxwell_t* cs_maxwell_activate ( cs_flag_t  model,
cs_flag_t  options 
)

Activate the future computation of the Maxwell equations.

Parameters
[in]modeltype of modelling
[in]optionsflag to handle optional parameters
Returns
a pointer to a new allocated Maxwell structure

◆ cs_maxwell_compute()

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.

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]time_steppointer to a cs_time_step_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure

◆ cs_maxwell_compute_steady_state()

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.

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]time_steppointer to a cs_time_step_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure

◆ cs_maxwell_destroy_all()

cs_maxwell_t* cs_maxwell_destroy_all ( void  )

Free the main structure related to the Maxwell module.

Returns
a NULL pointer

◆ cs_maxwell_extra_op()

void cs_maxwell_extra_op ( const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant 
)

Predefined extra-operations for the Maxwell module.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure

◆ cs_maxwell_extra_post()

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 it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t)

Parameters
[in,out]inputpointer to an optional structure (here a cs_gwf_t structure)
[in]mesh_idid of the output mesh for the current call
[in]cat_idcategory id of the output mesh for this call
[in]ent_flagindicate global presence of cells (ent_flag[0]), interior faces (ent_flag[1]), boundary faces (ent_flag[2]), particles (ent_flag[3]) or probes (ent_flag[4])
[in]n_cellslocal number of cells of post_mesh
[in]n_i_faceslocal number of interior faces of post_mesh
[in]n_b_faceslocal number of boundary faces of post_mesh
[in]cell_idslist of cells (0 to n-1)
[in]i_face_idslist of interior faces (0 to n-1)
[in]b_face_idslist of boundary faces (0 to n-1)
[in]time_steppointer to a cs_time_step_t struct.

◆ cs_maxwell_finalize_setup()

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.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure

◆ cs_maxwell_init_setup()

void cs_maxwell_init_setup ( void  )

Setup equations/properties related to the Maxwell module.

◆ cs_maxwell_is_activated()

bool cs_maxwell_is_activated ( void  )

Test if the computation of Maxwell equations is activated.

◆ cs_maxwell_log_setup()

void cs_maxwell_log_setup ( void  )

Log a summary of the Maxwell module.

◆ cs_maxwell_update()

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.

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]tspointer to a cs_time_step_t structure
[in]cur2prevtrue or false