Shearing-Box module header file. More...
Go to the source code of this file.
Macros | |
#define | SB_ORDER 2 |
#define | SB_SYMMETRIZE_HYDRO YES |
#define | SB_SYMMETRIZE_EY (YES && (DIMENSIONS == 3)) |
#define | SB_SYMMETRIZE_EZ YES |
#define | SB_FORCE_EMF_PERIODS NO |
#define | sb_A (-0.5*sb_Omega*sb_q) |
Functions | |
void | SB_Boundary (const Data *, int, Grid *) |
void | SB_ShearingInterp (double *, double *, double, int, Grid *) |
void | SB_CorrectFluxes (Data_Arr, double, double, Grid *) |
int | SB_JSHIFT (int) |
void | SB_SaveFluxes (State_1D *, Grid *) |
void | SB_SetBoundaryVar (double ***, RBox *, int, double, Grid *) |
void | SB_FillBoundaryGhost (double ***, RBox *, int, int, Grid *) |
Variables | |
double | sb_q |
double | sb_Omega |
double | sb_vy |
The Shearing-Box module header file contains basic macro definitions, function prototypes and declaration of global variables used by the sheraring-box module. The variable sb_q and sb_Omega are the most important ones and must be defined and initialized in your init.c in order to configure your shearing-box problem.
Optionally, the order of interpolation (default is 2) at physical boundaries may be changed using the SB_ORDER macro.
The additional macros SB_SYMMETRIZE_HYDRO, SB_SYMMETRIZE_EY and SB_SYMMETRIZE_EZ may be set to YES/NO to enable/disable enforcement of conservation at the radial (x) boundaries.
#define SB_FORCE_EMF_PERIODS NO |
Force periodicity at y- and z- boundaries.
#define SB_ORDER 2 |
Sets the order of interpolation at physical boundaries (1, 2 or 3).
#define SB_SYMMETRIZE_EY (YES && (DIMENSIONS == 3)) |
Symmetrize the y-component of the electric field at the left and right x-boundaries to enforce conservation of magnetic field (only in 3D).
#define SB_SYMMETRIZE_EZ YES |
Symmetrize the z-component of electric field at the left and right x-boundaries to enforce conservation of magnetic field.
#define SB_SYMMETRIZE_HYDRO YES |
Symmetrize the hydrodynamical fluxes at the left and right x-boundaries in order to enforce conservation of hydrodynamic variables like density, momentum and energy (no magnetic field). Default is YES.
Main wrapper function used to assign shearing-box boundary conditions on flow variables.
d | pointer to the PLUTO Data structure |
side | the side of the computational domain (X1_BEG or X1_END) |
grid | pointer to an 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 to be computed |
[in] | dt | the time step being used in the integrator stage |
[in] | grid | pointer to array of Grid structures |
Fill ghost zones in the Y direction in the X1_BEG and X1_END boundary regions.
[in,out] | U | a 3D data array |
[in,out] | box | the RBox structure containing the grid indices in the x and z directions. Indices in the y-directions are reset here for convenience. |
[in] | nghL | number of ghost zones on the left |
[in] | nghR | number of ghost zones on the right |
[in] | grid | pointer to an |
int SB_JSHIFT | ( | int | jc | ) |
Make sure jc always fall between JBEG and JEND
Fill ghost zones using shearing-box conditions.
[out] | U | pointer to a 3D array (centered or staggered) |
[in] | box | pointer to RBox structure defining the domain sub-portion over which shearing-box conditions have to be applied |
[in] | side | the side of the X1 boundary (X1_BEG or X1_END) |
[in] | t | the simulation time |
[in] | grid | pointer to an array of Grid structures |
void SB_ShearingInterp | ( | double * | qL, |
double * | qR, | ||
double | t, | ||
int | side, | ||
Grid * | grid | ||
) |
Shift the 1D arrays qL or qR by an amount (if there's only one processor in y) or just by (otherwise) by advecting the initial profile of qR (when side == X1_BEG) or qL (when side == X1_END).
[in,out] | qL | 1D array containing the un-shifted values on the left boundary |
[in,out] | qR | 1D array containing the un-shifted values on the right boundary |
[in] | t | simulation time |
[in] | side | boundary side |
[in] | grid | pointer to an array of Grid structures |
double sb_Omega |
Disk local orbital frequency . The explicit numerical value and the variable definition should be set inside your Init() function.
double sb_q |
The shear parameter, . The explicit numerical value and the variable definition should be set inside your Init() function.
double sb_vy |
velocity offset (>0), in USERDEF_BOUNDARY