PLUTO
shearingbox.h
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief Shearing-Box module header file
5 
6  The Shearing-Box module header file contains basic macro definitions,
7  function prototypes and declaration of global variables used by the
8  sheraring-box module.
9  The variable ::sb_q and ::sb_Omega are the most important ones and
10  \b must be defined and initialized in your init.c in order to
11  configure your shearing-box problem.
12 
13  Optionally, the order of interpolation (default is 2) at physical
14  boundaries may be changed using the ::SB_ORDER macro.
15 
16  The additional macros ::SB_SYMMETRIZE_HYDRO, ::SB_SYMMETRIZE_EY and
17  ::SB_SYMMETRIZE_EZ may be set to YES/NO to enable/disable enforcement
18  of conservation at the radial (x) boundaries.
19 
20  \authors A. Mignone (mignone@ph.unito.it)\n
21  G. Muscianisi (g.muscianisi@cineca.it)
22  \date Aug 26, 2015
23  \todo Check if sb_vy and sb_Ly are really needed as global variables.
24 */
25 /* ///////////////////////////////////////////////////////////////////// */
26 
27 /*! Sets the order of interpolation at physical boundaries (1, 2 or 3).*/
28 #if RECONSTRUCTION == LINEAR || RECONSTRUCTION == WENO3 || RECONSTRUCTION == LimO3
29  #define SB_ORDER 2
30 #else
31  #define SB_ORDER 3
32 #endif
33 
34 #ifndef FARGO
35  #ifndef SB_SYMMETRIZE_HYDRO
36  #define SB_SYMMETRIZE_HYDRO YES /**< Symmetrize the hydrodynamical fluxes
37  at the left and right x-boundaries in order to enforce conservation of
38  hydrodynamic variables like density, momentum and energy
39  (no magnetic field). Default is YES.*/
40  #endif
41 
42  #ifndef SB_SYMMETRIZE_EY
43  #define SB_SYMMETRIZE_EY (YES && (DIMENSIONS == 3)) /**< Symmetrize the
44  y-component of the electric field at the left and right x-boundaries
45  to enforce conservation of magnetic field (only in 3D). */
46  #endif
47 
48  #ifndef SB_SYMMETRIZE_EZ
49  #define SB_SYMMETRIZE_EZ YES /**< Symmetrize the z-component of electric
50  field at the left and right x-boundaries to enforce conservation of
51  magnetic field. */
52  #endif
53 
54  #define SB_FORCE_EMF_PERIODS NO /**< Force periodicity at y- and z-
55  boundaries. */
56 #else
57  #define SB_SYMMETRIZE_HYDRO NO
58  #define SB_SYMMETRIZE_EY (NO && (DIMENSIONS == 3))
59  #define SB_SYMMETRIZE_EZ NO
60  #define SB_FORCE_EMF_PERIODS NO
61 #endif
62 
63 /* ----------------------------
64  Global variables
65  ---------------------------- */
66 
67 #ifndef SB_Q
68  #define SB_Q 1.5 /**< The shear parameter, \f$\DS q = -\HALF\frac{d\log
69  \Omega^2}{d\log R} \f$. */
70 #endif
71 #ifndef SB_OMEGA
72  #define SB_OMEGA 1.0 /**< Disk local orbital frequency \f$ \Omega_0 =
73  \Omega(R_0)\f$. */
74 #endif
75 
76 //extern double sb_q; /**< The shear parameter, \f$\DS q = -\HALF\frac{d\log
77 // \Omega^2}{d\log R} \f$. The explicit numerical value and the
78 // variable definition should be set inside your Init() function. */
79 
80 //extern double sb_Omega; /**< Disk local orbital frequency \f$ \Omega_0 =
81 // \Omega(R_0)\f$. The explicit numerical value and the variable
82  // definition should be set inside your Init() function. */
83 
84 extern double sb_vy; /**< Velocity offset (>0), in SB_Boundary(). */
85 
86 #define SB_A (-0.5*SB_OMEGA*SB_Q) /**< Short-hand definition for the Oort
87  constant \f$ A = -q\Omega_0/2 \f$. */
88 
89 /* ***********************************************************
90  \cond REPEAT_FUNCTION_DOCUMENTATION_IN_HEADER_FILES
91  Function prototyping
92  *********************************************************** */
93 
94 void SB_Boundary (const Data *, int, Grid *) ;
95 void SB_ShearingInterp (double *, double *, double, int, Grid *);
96 void SB_CorrectFluxes (Data_Arr, double, double, Grid *);
97 #ifdef STAGGERED_MHD
98 void SB_CorrectEMF (EMF *, Data_Arr, Grid *);
99 #endif
100 int SB_JSHIFT (int);
101 void SB_SaveFluxes (State_1D *, Grid *);
102 void SB_SetBoundaryVar(double ***, RBox *, int, double, Grid *);
103 void SB_ShiftBoundaryVar(double ***, RBox *, int, double, Grid *);
104 void SB_FillBoundaryGhost(double ***, RBox *, int, int, Grid *);
105 
106 #ifdef PARALLEL
107  void ExchangeX (real *, real *, int, Grid *);
108 #endif
109 
110 /* \endcond */
double **** Data_Arr
Definition: pluto.h:492
double real
Definition: pluto.h:488
void SB_ShearingInterp(double *qL, double *qR, double t, int side, Grid *grid)
Definition: sb_tools.c:444
void SB_Boundary(const Data *d, int side, Grid *grid)
Definition: sb_boundary.c:27
void SB_CorrectFluxes(Data_Arr U, double t, double dt, Grid *grid)
Definition: sb_flux.c:105
void SB_FillBoundaryGhost(double ***U, RBox *box, int nghL, int nghR, Grid *grid)
Definition: sb_tools.c:297
int SB_JSHIFT(int jc)
Definition: sb_tools.c:638
Definition: structs.h:78
void SB_SetBoundaryVar(double ***U, RBox *box, int side, double t, Grid *grid)
Definition: sb_tools.c:36
Definition: structs.h:30
void SB_SaveFluxes(State_1D *state, Grid *grid)
Definition: sb_flux.c:57
double sb_vy
Velocity offset (>0), in SB_Boundary().
Definition: sb_boundary.c:24
Definition: structs.h:346