PLUTO
|
Enforce conservation at the X1 boundaries in the shearing-box module. More...
#include "pluto.h"
Go to the source code of this file.
Macros | |
#define | NVLAST (NVAR-1) |
#define | swL 0.0 |
#define | swR (1.0 - swL) |
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 |
Array of fluxes at the left x-boundary. More... | |
static double *** | FluxR |
Array of fluxes at the right x-boundary. More... | |
Enforce conservation at the X1 boundaries in the shearing-box module.
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
Definition in file sb_flux.c.
#define swL 0.0 |
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
Definition at line 105 of file sb_flux.c.
Store leftmost and rightmost conservative fluxes in the x direction into FluxL and FluxR.
[in] | state | pointer to a State_1D structure |
[in] | grid | pointer to an array of Grid structures |
Definition at line 57 of file sb_flux.c.
|
static |