PLUTO
4.4-patch2
|
Compute the curl of magnetic field. More...
#include "pluto.h"
Functions | |
void | GetCurrent (const Data *d, Grid *grid) |
Compute the electric current (defined as J = curl(B)) at cell edges for both staggered MHD and cell-centered MHD. That is, the three components of J = (Jx, Jy, Jz) are always placed at different locations inside the cell, no matter what scheme is used to control the divergence condition:
Jx
at (i, j+1/2, k+1/2)
Jy
at (i+1/2, j, k+1/2)
Jz
at (i+1/2, j+1/2, k)
The same rule apply to the components of resistivity eta
which are computed and stored inside this function.
For a compact implementation, we note that the curl of a vector in the three system of coordinates normally adopted may be written as
where the coefficients and
except:
In the actual implementation we use .