PLUTO Test Problems  4.4-patch2
Functions
init.c File Reference

Shearing Box setup. More...

Functions

void InitDomain (Data *d, Grid *grid)
 
void Analysis (const Data *d, Grid *grid)
 
void UserDefBoundary (const Data *d, RBox *box, int side, Grid *grid)
 
void BodyForceVector (double *v, double *g, double x, double y, double z)
 
double FARGO_SetVelocity (double x1, double x2)
 

Detailed Description

Set initial conditions for a shearing box model in two or three dimensions:

\[ \rho = \left\{\begin{array}{ll} 1 & \quad{\rm(unstratified)} \\ \noalign{\medskip} \exp(-z^2/H^2) & \quad{\rm(stratified)} \end{array}\right. ;\quad v_y = -q\Omega x\,; \quad p = \rho c_s^2\,; \quad \vec{B} = \left\{\begin{array}{ll} (0,0,B_z) & \quad{\rm(net\,flux)} \\ \noalign{\medskip} (0,0,B_z\sin 2\pi x/L_x) & \quad{\rm(no\,net\,flux)} \end{array}\right. \]

where, by default, the angular rotation frequency is $\Omega = 1$ while the shear parameter is $ q = 3/2 $ (Keplerian rotation). In the stratified case the scale height is given by $ H = \sqrt{2}c_s/\Omega $. The parameters controlling the model are the elements of the array g_inputParam:

The additional constants NET_FLUX and STRATIFICATION are defined inside definitions.h and are used to:

The Shearing_Box/ directory contains several configurations for different purposes:

Conf.DIMNET_FLUXSTRAT.T. STEPPINGRECONSTR. EOS Ref
#01 2 YES NO HANCOCK LINEAR ISOTHERMAL-
#02 2 YES NO ChTr PARABOLIC ISOTHERMAL-
#03 3 YES NO RK2 LINEAR ISOTHERMAL[Bod08]
#04 3 YES NO RK2 LINEAR ISOTHERMAL[Bod08]
#05 3 YES NO ChTr PARABOLIC ISOTHERMAL[Bod08]
#06 3 YES NO ChTr PARABOLIC ISOTHERMAL[Bod08]
#07 3 NO NO RK2 LINEAR ISOTHERMAL[Mig12]
#08 3 NO NO RK2 LINEAR ISOTHERMAL[Mig12] (*)
#09 3 NO NO ChTr PARABOLIC ISOTHERMAL[Mig12]
#10 3 NO NO ChTr PARABOLIC ISOTHERMAL[Mig12] (*)
#11 3 NO YES HANCOCK LINEAR ISOTHERMAL[Bod14]
#12 3 NO YES HANCOCK LINEAR IDEAL [Bod12] (^)
#13 3 NO NO HANCOCK LINEAR IDEAL (**)
#14 3 YES NO RK3 WENO3 IDEAL (**)

(*) used with FARGO to be compared to the previous configurations.

(**) as conf. #9 but with IDEAL eos and FARGO.

(^) This a simplified version of the [Bod12] setup. The actual configuration was also modifying the Riemann solver flux to guarantee zero mass flux across top and bottom boundary.

sb.06.png
Density and magnetic field lines for configuration #06 at t = 50 using a grid resolution of 64 x 256 x 64.
Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
March 2, 2017

References:

Function Documentation

◆ Analysis()

void Analysis ( const Data *  d,
Grid *  grid 
)

Compute volume-integrated magnetic pressure, Maxwell and Reynolds stresses. Also kinetic energy (LMP). Save them to "averages.dat"

◆ BodyForceVector()

void BodyForceVector ( double *  v,
double *  g,
double  x,
double  y,
double  z 
)

Include gravitational force in the shearing box module. Coriolis terms are included elsewhere.

Note: with FARGO, gravity in the x-direction must not be included.

◆ FARGO_SetVelocity()

double FARGO_SetVelocity ( double  x1,
double  x2 
)

Compute the shear angular velocity to be subtracted from the HD or MHD equations.

◆ InitDomain()

void InitDomain ( Data *  d,
Grid *  grid 
)

Assign initial condition by looping over the computational domain. Called after the usual Init() function to assign initial conditions on primitive variables. Value assigned here will overwrite those prescribed during Init().

◆ UserDefBoundary()

void UserDefBoundary ( const Data *  d,
RBox *  box,
int  side,
Grid *  grid 
)

The user-defined boundary is used to impose stress-free boundary and purely vertical magnetic field at the top and bottom boundaries, as done in Bodo et al. (2012). In addition, constant temperature and hydrostatic balance are imposed. For instance, at the bottom boundary, one has:

\[ \left\{\begin{array}{lcl} \DS \frac{dp}{dz} &=& \rho g_z \\ \noalign{\medskip} p &=& \rho c_s^2 \end{array}\right. \qquad\Longrightarrow\qquad \frac{p_{k+1}-p_k}{\Delta z} = \frac{p_{k} + p_{k+1}}{2c_s^2}g_z \]

where $g_z$ is the value of gravity at the lower boundary. Solving for $p_k$ at the bottom boundary where $k=k_b-1$ gives:

\[ \left\{\begin{array}{lcl} p_k &=& \DS p_{k+1} \frac{1-a}{1+a} \\ \noalign{\medskip} \rho_k &=& \DS \frac{p_k}{c_s^2} \end{array}\right. \qquad\mathrm{where}\qquad a = \frac{\Delta z g_z}{2c_s^2} > 0 \]

where, for simplicity, we keep constant temperature in the ghost zones rather than at the boundary interface (this seems to give a more stable behavior and avoids negative densities). A similar treatment holds at the top boundary.