PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
Data Structures | Functions
ct.h File Reference

Header file for Constrained-Transport (CT) module. More...

Go to the source code of this file.

Data Structures

struct  EMF
 

Functions

void CT_EMF_ArithmeticAverage (const EMF *, const double)
 Compute arithmetic average of EMF at cell edges.
 
void CT_EMF_IntegrateToCorner (const Data *, const EMF *, Grid *)
 
void CT_AverageNormalMagField (const Data *, int, Grid *)
 Compute the normal component of the volume-average magnetic field from the staggered components in the ghost zones.
 
void CT_Update (const Data *, Grid *)
 
void CT_CheckDivB (double ***b[], Grid *)
 
void CT_StoreEMF (const State_1D *, int, int, Grid *)
 
void CT_StoreResistiveEMF (double **, int, int, Grid *)
 
EMFCT_GetEMF (const Data *, Grid *)
 
void FillMagneticField (const Data *, int, Grid *)
 Assign the normal component of the staggered magnetic field in the ghost zone-faces.
 
void CT_GetStagSlopes (const Data_Arr, EMF *, Grid *)
 
void CT_EMF_HLL_Solver (const Data *, const EMF *, Grid *)
 Solve 2D Riemann problem for induction equation.
 
void CT_EMF_CMUSCL_Average (const Data *, const EMF *, Grid *)
 
 

Detailed Description

Provides macros, function prototypes and structure definitions for the constrained transport (CT) MHD module to control the divergence-free condition.

Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Oct 3, 2012

Function Documentation

void CT_AverageNormalMagField ( const Data d,
int  side,
Grid grid 
)

For a given "side" of the boundary, average the staggered magnetic field components normal to that boundary into a cell-centered field. For instance, at X3_BEG we only average Bz. Transverse components should be averaged using a slightly different stencil. This function is automatically called from Boundary() for consistency between staggered and zone-centered fields.

Parameters
[in,out]dpointer to PLUTO Data structure
[in]sidethe side
[in]gridpointer to PLUTO Grid structure
Todo:
replace the loops with more compact macro, such as X1_BEG_LOOP()...
void CT_CheckDivB ( double ***  bf[],
Grid grid 
)

Check the divergence-free condition of magnetic field in the constrained transport formalism.

void CT_EMF_ArithmeticAverage ( const EMF Z1,
const double  w 
)

Combine the four electric field values computed at zone faces as upwind Godunov fluxes into an edge-centered value.
The face-centered EMF should have been stored by previous calls to CT_StoreEMF() during the one-dimensional sweeps.
This function employs a simple arithmetic averaging of the face-centered electric field.

References:

  • "A Staggered Mesh Algorithm Using High Order Godunov Fluxes to Ensure Solenoidal Magnetic Fields in Magnetohydrodynamic Simulations"
    Balsara & Spicer, JCP (1999) 149, 270.
Parameters
[in]Z1pointer to EMF structure
[in]wweighting factor
Returns
This function has no return value.
Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 16, 31, 2012
void CT_EMF_CMUSCL_Average ( const Data d,
const EMF emf,
Grid grid 
)

Used in the predictor scheme of CTU scheme in conjunction with UCT_HLL average. No riemann solver actually used, but only a simple pointwise average.

References:

  • "A High order Godunov scheme with constrained transport and adaptie mesh refinement for astrophysical magnetohydrodynamics"
    Fromang, Hennebelle and Teyssier, A&A (2006) 457, 371
Returns
This function has no return value.
Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 16, 2012
void CT_EMF_HLL_Solver ( const Data d,
const EMF emf,
Grid grid 
)

Solve 2-D Riemann problem using the 2D HLL Riemann flux formula of Londrillo & Del Zanna (2004), JCP, eq. 56. Here N, W, E, S refer to the following configuration:

*                    |
*                    N
*                 NW | NE
*                    | 
*               --W--+--E--
*                    | 
*                 SW | SE
*                    S
*                    |
* 
Parameters
[in]dpointer to PLUTO Data structure
[in]gridpointer to Grid structure;
Returns
This function has no return value.
Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 16, 2012
void CT_EMF_IntegrateToCorner ( const Data d,
const EMF emf,
Grid grid 
)

Add derivatives to the 4-point arithmetic average of magnetic fields. Obtain the electric field at corners.

References:

  • "An unsplit Godunov method for ideal MHD via constrained transport"
    Gardiner & Stone, JCP (2005) 205, 509. See Eq. (41), (45) and (50).
Parameters
[in]dpointer to PLUTO Data structure
[in]emfpointer to EMF structure
[in]gridpointer to Grid structure
Returns
This function has no return value.
Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 16, 31, 2012
EMF* CT_GetEMF ( const Data d,
Grid grid 
)

Retrieve EMF by suitable average of 1D face-centered fluxes.

Parameters
[in]d
[in]grid
Returns
a pointer to an edge-centered EMF.
void CT_GetStagSlopes ( const Data_Arr  b,
EMF emf,
Grid grid 
)

Compute slopes of staggered magnetic fields components Exclude normal derivatives (i.e. dbx_dx).

void CT_StoreEMF ( const State_1D state,
int  beg,
int  end,
Grid grid 
)

Store EMF components and related information available during 1D sweeps.

Parameters
[in]statepointer to State_1D structure
[in]beginitial index of computation
[in]endfinal index of computation
[in]gridpointer to Grid structure;
Returns
This function has no return value.
void CT_StoreResistiveEMF ( double **  res_flx,
int  beg,
int  end,
Grid grid 
)

Store resistive part of EMF.

Todo:
some memory could be saved here...
void CT_Update ( const Data d,
Grid grid 
)

Update staggered magnetic field using discrete version of Stoke's theorem.

Parameters
[in,out]dpointer to PLUTO Data structure
[in]gridpointer to an array of Grid structures
Todo:
dt may be set separately in a more concise manner.
Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 16, 2012
void FillMagneticField ( const Data d,
int  side,
Grid grid 
)

Using the div.B = 0 condition in staggered MHD, this function computes the staggered component of magnetic field lying on the zone-face parallel to the boundary specified by "side". This is preformed by solving the div.B = 0 condition for one variable only which in 2-D requires the knowledge of the other 3 components while in 3-D required the knowledge of the other 5 staggered components.

Note that this operation is performed in the outermost ghost zones only since the face value at IBEG-1 or IEND is supposed to be part of the solution and is not changed during this function. Therefore, only nghost-1 faces are assigned:

*  +-----+-----+-----+-----+-----+--
*  |     |     |     |     |     |
*  |     X     X     |     |     |
*  |     |     |     |     |     |
*  +-----+-----+-----+-----+-----+--
*                    |
*  <-----------------> BEG
*   Physical boundary     
*
*   X = components assigned in this function.
* 
Parameters
[in,out]dpointer to PLUTO Data structure
[in]sidethe side
[in]gridpointer to PLUTO Grid structure
Todo:
replace the loops with more compact macro, such as X1_BEG_LOOP()...
Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 16, 2012