PLUTO  4.4-patch2
Functions
ct_update.c File Reference

Update staggered magnetic field. More...

#include "pluto.h"

Functions

void CT_Update (const Data *d, Data_Arr Rs, double dt, Grid *grid)
 
void CT_CheckDivB (double ***bf[], Grid *grid)
 
void CT_InterfaceCurrent (Data *d, Grid *grid)
 
void CT_ResistiveUpdate (const Data *d, double dt, Grid *grid)
 

Detailed Description

Update face-centered magnetic field in the constrained transport formulation using a discrete version of Stoke's theorem. The update consists of a single Euler step:

\[ \mathtt{Bs} \Longleftarrow \mathtt{Bs} + \Delta t R \]

where d->Vs is the main staggered array used by PLUTO, Bs is the magnetic field to be updated and R is the right hand side already computed during the unsplit integrator. d->Vs and Bs may be the same array or may be different.

References

Author
A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it)
Date
Apr 03, 2020

Function Documentation

◆ CT_CheckDivB()

void CT_CheckDivB ( double ***  bf[],
Grid grid 
)

Check the divergence-free condition of magnetic field in the constrained transport formalism. The solenoidal condition is discretized in a finite-volume sense:

\[ \int \nabla\cdot\vec{B}\, d^3x = \int \vec{B}\cdot d\hvec{S} = \sum_d \Big(\bar{B}_{d,+}S_{d,+} - \bar{B}_{d,-}S_{d,-} \Big) \]

where $S_{d,\pm}$ denotes the right (+) or left (-) interface surface areas orthogonal to the d direction. Thus in Cartesian coordinates one has

\[ \int \nabla\cdot\vec{B}\, d^3x = \Delta y\Delta z \left(B_{x,+} - B_{x,-}\right) + \Delta x\Delta z \left(B_{y,+} - B_{y,-}\right) + \Delta x\Delta y \left(B_{z,+} - B_{z,-}\right) \]

while in spherical coordinates ( $ dS_1 = r^2\,\sin\theta\,d\theta\,d\phi, \, dS_2 = r\sin\theta\, dr\,d\phi,\, dS_3 = r\,dr\,d\theta$) we have

\[ \int \nabla\cdot\vec{B}\, d^3x = \Delta \mu\Delta\phi \Big(r^2_+B_{r,+} - r^2_-B_{r,-}\Big) + \Delta\left(\frac{r^2}{2}\right) \Delta\phi \Big( \sin\theta_+B_{\theta,+} - \sin\theta_-B_{\theta,-}\Big) + \Delta\left(\frac{r^2}{2}\right)\Delta\theta \Big(B_{\phi,+} - B_{\phi,-}\Big) \]

where $\mu = 1-\cos\theta$. Notice also that $\Delta (r^2/2) = r\Delta r$ where r is the cell center.

Parameters
[in]bfan array of staggered magnetic field components
[in]grida pointer to Grid structure

◆ CT_InterfaceCurrent()

void CT_InterfaceCurrent ( Data d,
Grid grid 
)

Comute q/D = div(E) / (rho*gamma) and Current at cell faces. [Only used in the explicit scheme]

◆ CT_ResistiveUpdate()

void CT_ResistiveUpdate ( const Data d,
double  dt,
Grid grid 
)

[Only used in the explicit scheme]

◆ CT_Update()

void CT_Update ( const Data d,
Data_Arr  Rs,
double  dt,
Grid grid 
)

Update staggered magnetic field using discrete version of Stoke's theorem. Only d->Vs is updated, while Bs is the original array:
d->Vs = Bs + dt * R, where R = curl(E) is the electric field.

Parameters
[in,out]dpointer to PLUTO Data structure.
[in]Rsarray of staggered variables to be updated.
[in]dtstep size
[in]gridpointer to Grid structure