PLUTO
|
Compute the curl of magnetic field. More...
#include "pluto.h"
Go to the source code of this file.
Functions | |
void | GetCurrent (const Data *d, int dir, Grid *grid) |
Variables | |
static double *** | eta [3] |
Compute the curl of magnetic field.
Compute the electric current (defined as J = curl(B)) for the induction and the total energy equations.
For constrained transport MHD, J has the same staggered location of the electric field and the three components (Jx, Jy, Jz) are placed at different locations inside the cell:
The same rule apply to the components of resistivity eta
which are computed and stored inside this function.
For cell-centered MHD, the three components of J are computed during each sweep direction at cell interfaces, that is,
Although only the two transverse components of J are actually needed during the update step, we compute also the normal component since the resistivity coefficients eta may depend on the total current.
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 .
Definition in file res_functions.c.
Compute the curl of magnetic field for constrained transport MHD or cell-centered MHD.
[in,out] | d | pointer to the PLUTO data structure |
[in] | dir | sweep direction (useless for constrained transport MHD) |
[in] | grid | pointer to an array of Grid structures |
4b. For cell-centered MHD, we compute the three components of
Definition at line 97 of file res_functions.c.
|
static |
Definition at line 94 of file res_functions.c.