PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
Functions
ct_field_average.c File Reference

Performs various magnetic field averaging operations. More...

#include "pluto.h"

Functions

void CT_AverageMagneticField (double ****bf, double ****UU, Grid *grid)
 
void CT_AverageNormalMagField (const Data *d, int side, Grid *grid)
 Compute the normal component of the volume-average magnetic field from the staggered components in the ghost zones.
 
void CT_AverageTransverseMagField (const Data *d, int side, Grid *grid)
 Compute the transverse component of the volume-average magnetic field from the staggered components in the ghost zones.
 

Detailed Description

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

Function Documentation

void CT_AverageMagneticField ( double ****  bf,
double ****  UU,
Grid grid 
)

Average staggered magnetic field components to form a zone-centered field, e.g., $ <B_i> = (b_{i+1/2} + b_{i-1/2})/2$

The averaging procedure is performed inside the computational domain augmented by an additional row/plane of ghost zones in the boundary regions. Inclusion of boundary regions is useful only during the predictor step of the CT-CTU algorithm, whereas is useless for RK time stepping.

When the CT_EN_CORRECTION flag is enabled, we also redefine the zone total energy using the newly formed cell-centered field, i.e.,

\[ E_i \to E_i - \frac{\mathbf{B}_i^2}{2} + \frac{<\mathbf{B}_i^2>}{2} \]

Parameters
[in]bfarray of staggered fields
[out]UUarray of conservative variables
[in]gridpointer to Grid structure
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_AverageTransverseMagField ( const Data d,
int  side,
Grid grid 
)

For a given "side" of the boundary, average the staggered magnetic field components transverse to that boundary into a cell-centered field. For instance, at X2_BEG we average Bx and Bz. This call is necessary only if one requires consistency between staggered and cell-centered magnetic field components.

Parameters
[in,out]dpointer to PLUTO Data structure
[in]sidethe side
[in]gridpointer to PLUTO Grid structure
Todo:
replace the loops using more compact notations, such as X1_BEG_LOOP()...