PLUTO
4.4-patch2
|
Enforce conservation at the X1 boundaries in the shearing-box module. More...
#include "pluto.h"
Macros | |
#define | swL 0.0 |
Functions | |
void | SB_SaveFluxes (Sweep *sweep, Grid *grid) |
void | SB_CorrectFluxes (Data_Arr U, double t, double dt, Grid *grid) |
void | SB_CorrectEMF (EMF *emf, Data_Arr V0, Grid *grid) |
void | ExchangeX (double *bufL, double *bufR, int nel, Grid *grid) |
Variables | |
static double *** | FluxL |
static double *** | FluxR |
This file provides functions to store and then modify the upwind fluxes computed during the Riemann solver at the leftmost and righmost physical boundaries. These tasks are performed only when either SB_SYMMETRIZE_HYDRO, SB_SYMMETRIZE_EY, SB_SYMMETRIZE_EZ flags are set to YES in Src/MHD/shearingbox.h and are useful to avoid loss of conservation in the hydrodynamical variables (density, momentum, energy) and/or magnetic fields.
This is first achieved by calling the SB_SaveFluxes() function during the time stepping scheme, with the purpose of storing the leftmost and rightmost conservative fluxes in the x-direction into the static arrays FluxL[] and FluxR[].
These fluxes are then subsequently used by SB_CorrectFluxes() which interpolates the fluxes and properly correct leftmost and rightmost cell-centered flow quantities to ensure conservation.
The treatment of staggered magnetic field is done similarly by SB_CorrectEMF().
References
#define swL 0.0 |
Sets the weight coefficient in the range [0,1] used during flux symmetrization at the left and right boundaries,
FL -> swL*FL + swR*I(FR) FR -> swL*I(FL) + swR*FR
where swR=1-swL and I() stands for conservative interpolation.
void ExchangeX | ( | double * | bufL, |
double * | bufR, | ||
int | nel, | ||
Grid * | grid | ||
) |
Send bufL owned by processor at X1_BEG to the processor at X1_END; Send bufR owned by processor at X1_END to the processor at X1_BEG;
Correct the electromotive force by enforcing symmetrization in order to guarantee that Bx on the left is mapped from Bx on the right. This is done by re-defining the y- and z-components of the electric field as follows:
where is time level of the electric field, $$ are the forward (>) or backward (<) shift operators. The corrective terms
are the upwind numerical flux computed in the advection of the x-component of magnetic field:
where is the time increment of the shift operator applied to the magnetic field,
and
are the x component of magnetic field computed at some intermediate time
tB
while
are the arithmetic average of the limited slopes of Bx
computed at the left and right boundaries.
[in,out] | emf | pointer to EMF structure |
[in] | V0 | 4D array of staggered fields |
[in] | grid | pointer to array of Grid structures |
void SB_CorrectFluxes | ( | Data_Arr | U, |
double | t, | ||
double | dt, | ||
Grid * | grid | ||
) |
Interpolate x-fluxes FLuxL and FluxR and properly correct leftmost and rightmost cells to ensure conservation.
[in,out] | U | data array containing cell-centered quantities |
[in] | t | the time step at which fluxes have been computed |
[in] | dt | the time step being used in the integrator stage |
[in] | grid | pointer to array of Grid structures |
On the left boundary:
FluxR -> FluxLR -> I(FluxLR) -> fL = wL*FluxL + wR*FluxLR
On the right boundary:
FluxL -> FluxLR -> I(FluxLR) -> fR = wL*FluxLR + wR*FluxR
|
static |
Array of fluxes at the left x-boundary.
|
static |
Array of fluxes at the right x-boundary.