Enforce conservation at the X1 boundaries in the shearing-box module. More...
#include "pluto.h"
Functions | |
void | SB_SaveFluxes (State_1D *state, Grid *grid) |
void | SB_CorrectFluxes (Data_Arr U, double t, double dt, Grid *grid) |
Variables | |
static double **** | FluxL |
static double **** | FluxR |
This file provides a set of functions for storing and then modifying 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_SAVE_FLUXES() 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_CORRECT_FLUXES() 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_CORRECT_EMF().
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 to be computed |
[in] | dt | the time step being used in the integrator stage |
[in] | grid | pointer to array of Grid structures |
|
static |
Array of fluxes at the left x-boundary.
|
static |
Array of fluxes at the right x-boundary.