PLUTO
vec_pot_diff.c File Reference

Compute magnetic field from vector potential. More...

#include "pluto.h"
Include dependency graph for vec_pot_diff.c:

Go to the source code of this file.

Detailed Description

Compute magnetic field from vector potential.

The function VectorPotentialDiff() computes either staggered or cell-center magnetic field components by suitable central differencing of the vector potential, $ \vec{B} = \nabla\times\vec{A} $.

  • In Cartesian geometry:

    \[ B_x = \pd{A_z}{y} - \pd{A_y}{z} \,,\quad B_y = \pd{A_x}{z} - \pd{A_z}{x} \,,\quad B_z = \pd{A_y}{x} - \pd{A_x}{y} \]

  • In cylindrical geometry:

    \[ B_R = \frac{1}{R}\pd{A_z}{\phi} - \pd{A_\phi}{z} \,,\quad B_z = \frac{1}{R}\left(\pd{(RA_\phi)}{R} - \pd{A_R}{\phi}\right) \]

  • In polar geometry:

    \[ B_R = \frac{1}{R}\pd{A_z}{\phi} - \pd{A_\phi}{z} \,,\quad B_\phi = \pd{A_R}{z} - \pd{A_z}{R} \,,\quad B_z = \frac{1}{R}\pd{(RA_\phi)}{R} - \frac{1}{R}\pd{A_R}{\phi} \]

  • In spherical geometry:

    \[ B_r = \frac{1}{r\sin\theta}\pd{(\sin\theta A_\phi)}{\theta} - \frac{1}{r\sin\theta}\pd{A_\theta}{\phi} \,,\quad B_\theta = \frac{1}{r\sin\theta}\pd{A_r}{\phi} - \frac{1}{r}\pd{(rA_\phi)}{r} \,,\quad B_\phi = \frac{1}{r}\pd{(rA_\theta)}{r} - \frac{1}{r}\pd{A_r}{\theta} \]

For cell-centered MHD vector potential is compute at the cell-center. In the case of staggered MHD, the position of A is edge-centered and it is shown below:

          ______________________
         /                     /|  
        /                     / |  
       /       z face        /  |
      /                     Ax  |
     /                     /    |
    /                     /     Az
   ----------Ay-----------      |
   |                     |      |
   |                     |   y  |
   |                     | face |
   |                     |     / 
   Az       x face      Az    /  
   |                     |   Ax  
   |                     |  /     
   |                     | /
   |                     |/
   ----------Ay-----------
Authors
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
P. Tzeferacos (petro.nosp@m.s.tz.nosp@m.efera.nosp@m.cos@.nosp@m.ph.un.nosp@m.ito..nosp@m.it)
Date
Sep 24, 2012

Definition in file vec_pot_diff.c.