PLUTO  4.2
 All Data Structures Files Functions Variables Enumerations Macros Pages
Macros | Functions | Variables
glm.h File Reference

Header file for GLM Divergence Cleaning. More...

Go to the source code of this file.


#define GLM_ALPHA   0.1


void GLM_Solve (const State_1D *, double **, double **, int, int, Grid *)
void GLM_Init (const Data *, const Time_Step *, Grid *)
void GLM_Source (const Data_Arr, double, Grid *)
void GLM_ExtendedSource (const State_1D *, double, int, int, Grid *)


double glm_ch

Detailed Description

Contains function prototypes and global variable declaration for the GLM formulation to control the divergence-free condition of magnetic field.

A. Mignone (
P. Tzeferacos (
July 24, 2015


Macro Definition Documentation

#define GLM_ALPHA   0.1

Sets the damping rate of monopoles.


The GLM_EXTENDED macro may be turned to YES to enable the extended GLM formalism. Although it breaks conservation of momentum and energy, it has proven to be more robust in treating low-beta plasma.

Function Documentation

void GLM_ExtendedSource ( const State_1D state,
double  dt,
int  beg,
int  end,
Grid grid 

Add source terms to the right hand side of the conservative equations, momentum and energy equations only. This yields the extended GLM equations given by Eq. (24a)–(24c) in

"Hyperbolic Divergence cleaning for the MHD Equations" Dedner et al. (2002), JcP, 175, 645

void GLM_Init ( const Data d,
const Time_Step Dts,
Grid grid 

Initialize the maximum propagation speed glm_ch.

void GLM_Solve ( const State_1D state,
double **  VL,
double **  VR,
int  beg,
int  end,
Grid grid 

Solve the 2x2 linear hyperbolic GLM-MHD system given by the divergence cleaning approach. Build new states VL and VR for Riemann problem. We use Eq. (42) of Dedner et al (2002)

[in,out]statepointer to a State_1D structure
[out]VLleft-interface state to be passed to the Riemann solver
[out]VRright-interface state to be passed to the Riemann solver
[in]begstarting index of computation
[in]endfinal index of computation
[in]gridpointer to array of Grid structures

The purpose of this function is two-fold:

  1. assign a unique value to the normal component of magnetic field and to te scalar psi before the actual Riemann solver is called.
  2. compute GLM fluxes in Bn and psi.

The following MAPLE script has been used

1 restart;
2 with(linalg);
3 A := matrix(2,2,[ 0, 1, c^2, 0]);
5 R := matrix(2,2,[ 1, 1, c, -c]);
6 L := inverse(R);
7 E := matrix(2,2,[c,0,0,-c]);
8 multiply(R,multiply(E,L));
void GLM_Source ( const Data_Arr  Q,
double  dt,
Grid grid 

Include the parabolic source term of the Lagrangian multiplier equation in a split fashion for the mixed GLM formulation. Ref. Mignone & Tzeferacos, JCP (2010) 229, 2117, Equation (27).

Variable Documentation

double glm_ch

The propagation speed of divergence error.