Functions | Variables

prob/hb3.c File Reference

Problem generator for 2D MRI simulations using the shearing sheet based on "A powerful local shear instability in weakly magnetized disks. More...

Go to the source code of this file.

Functions

static double ran2 (long int *idum)
 Extracted from the Numerical Recipes in C (version 2) code.
static Real UnstratifiedDisk (const Real x1, const Real x2, const Real x3)
 ShearingBoxPot.
static Real expr_dV3 (const GridS *pG, const int i, const int j, const int k)
 Computes delta(Vy).
static Real hst_rho_Vx_dVy (const GridS *pG, const int i, const int j, const int k)
 Reynolds stress, added as history variable.
static Real hst_dEk (const GridS *pG, const int i, const int j, const int k)
 computes 0.5*(Vx^2 + 4( Vy)^2), which for epicyclic motion is a constant, added as history variable
static Real hst_E_total (const GridS *pG, const int i, const int j, const int k)
 Total energy, including tidal potential.
static Real hst_Bx (const GridS *pG, const int i, const int j, const int k)
 x-component of magnetic field
static Real hst_By (const GridS *pG, const int i, const int j, const int k)
 y-component of the magnetic field
static Real hst_Bz (const GridS *pG, const int i, const int j, const int k)
 z-component of the magnetic field
static Real hst_BxBy (const GridS *pG, const int i, const int j, const int k)
 Maxwell stress.
void problem (DomainS *pDomain)
 Problem initial conditions, edited for each problem.
void problem_write_restart (MeshS *pM, FILE *fp)
 Problem specific subroutine for use with writing restart files, Edited for each problem.
void problem_read_restart (MeshS *pM, FILE *fp)
 Problem specific subroutine for use with reading restart files, Edited for each problem.
ConsFun_t get_usr_expr (const char *expr)
 Sets pointer to expression for special output data.
VOutFun_t get_usr_out_fun (const char *name)
 Returns a user defined output function pointer.
void Userwork_in_loop (MeshS *pM)
 Problem work executed during each step in the main Athena loop, see main.c.
void Userwork_after_loop (MeshS *pM)
 Problem work executed after the main Athena loop, see main.c Edited for each problem.

Variables

static Real Lx
static Real Lz

Detailed Description

Problem generator for 2D MRI simulations using the shearing sheet based on "A powerful local shear instability in weakly magnetized disks.

PURPOSE: Problem generator for 2D MRI simulations using the shearing sheet based on "A powerful local shear instability in weakly magnetized disks. III - Long-term evolution in a shearing sheet" by Hawley & Balbus. This is the third of the HB papers on the MRI, thus hb3.

Several different perturbations and field configurations are possible:

PRIVATE FUNCTION PROTOTYPES:

REFERENCE: Hawley, J. F. & Balbus, S. A., ApJ 400, 595-609 (1992).

Definition in file hb3.c.


Function Documentation

static Real expr_dV3 ( const GridS pG,
const int  i,
const int  j,
const int  k 
) [static]

Computes delta(Vy).

Definition at line 411 of file hb3.c.

References cc_pos(), ConsS::d, ConsS::M3, Omega_0, qshear, and GridS::U.

Here is the call graph for this function:

ConsFun_t get_usr_expr ( const char *  expr  ) 

Sets pointer to expression for special output data.

Definition at line 296 of file hb3.c.

VOutFun_t get_usr_out_fun ( const char *  name  ) 

Returns a user defined output function pointer.

Definition at line 302 of file hb3.c.

static Real hst_Bx ( const GridS pG,
const int  i,
const int  j,
const int  k 
) [static]

x-component of magnetic field

Definition at line 485 of file hb3.c.

References ConsS::B1c, GridS::is, and GridS::U.

Referenced by problem().

Here is the caller graph for this function:

static Real hst_BxBy ( const GridS pG,
const int  i,
const int  j,
const int  k 
) [static]

Maxwell stress.

Definition at line 507 of file hb3.c.

References ConsS::B1c, ConsS::B2c, and GridS::U.

Referenced by problem().

Here is the caller graph for this function:

static Real hst_By ( const GridS pG,
const int  i,
const int  j,
const int  k 
) [static]

y-component of the magnetic field

Definition at line 492 of file hb3.c.

References ConsS::B2c, GridS::js, and GridS::U.

Referenced by problem().

Here is the caller graph for this function:

static Real hst_Bz ( const GridS pG,
const int  i,
const int  j,
const int  k 
) [static]

z-component of the magnetic field

Definition at line 499 of file hb3.c.

References ConsS::B3c, GridS::ks, and GridS::U.

Referenced by problem().

Here is the caller graph for this function:

static Real hst_dEk ( const GridS pG,
const int  i,
const int  j,
const int  k 
) [static]

computes 0.5*(Vx^2 + 4( Vy)^2), which for epicyclic motion is a constant, added as history variable

Definition at line 443 of file hb3.c.

References ConsS::d, ConsS::M1, ConsS::M3, Omega_0, qshear, and GridS::U.

Referenced by problem().

Here is the caller graph for this function:

static Real hst_E_total ( const GridS pG,
const int  i,
const int  j,
const int  k 
) [static]

Total energy, including tidal potential.

Definition at line 465 of file hb3.c.

References cc_pos(), ConsS::d, ConsS::E, GridS::U, and UnstratifiedDisk().

Referenced by problem().

Here is the call graph for this function:

Here is the caller graph for this function:

static Real hst_rho_Vx_dVy ( const GridS pG,
const int  i,
const int  j,
const int  k 
) [static]

Reynolds stress, added as history variable.

Definition at line 427 of file hb3.c.

References cc_pos(), ConsS::d, ConsS::M1, ConsS::M3, Omega_0, qshear, and GridS::U.

Referenced by problem().

Here is the call graph for this function:

Here is the caller graph for this function:

void problem ( DomainS pDomain  ) 
void problem_read_restart ( MeshS pM,
FILE *  fp 
)

Problem specific subroutine for use with reading restart files, Edited for each problem.

Definition at line 272 of file hb3.c.

References eta_Ohm, Lx, Omega_0, par_getd_def(), Q_AD, Q_Hall, qshear, MeshS::RootMaxX, MeshS::RootMinX, ShearingBoxPot, x1max, and x1min.

Here is the call graph for this function:

void problem_write_restart ( MeshS pM,
FILE *  fp 
)

Problem specific subroutine for use with writing restart files, Edited for each problem.

Definition at line 262 of file hb3.c.

double ran2 ( long int *  idum  )  [static]

Extracted from the Numerical Recipes in C (version 2) code.

Modified to use doubles instead of floats. -- T. A. Gardiner -- Aug. 12, 2003

Long period (> 2 x 10^{18}) random number generator of L'Ecuyer with Bays-Durham shuffle and added safeguards. Returns a uniform random deviate between 0.0 and 1.0 (exclusive of the endpoint values). Call with idum = a negative integer to initialize; thereafter, do not alter idum between successive deviates in a sequence. RNMX should appriximate the largest floating point value that is less than 1.

Definition at line 345 of file hb3.c.

static Real UnstratifiedDisk ( const Real  x1,
const Real  x2,
const Real  x3 
) [static]

ShearingBoxPot.

Definition at line 398 of file hb3.c.

References Omega_0, and qshear.

Referenced by hst_E_total().

Here is the caller graph for this function:

void Userwork_after_loop ( MeshS pM  ) 

Problem work executed after the main Athena loop, see main.c Edited for each problem.

Definition at line 310 of file hb3.c.

void Userwork_in_loop ( MeshS pM  ) 

Problem work executed during each step in the main Athena loop, see main.c.

Edited for each problem.

Definition at line 306 of file hb3.c.


Variable Documentation

Real Lx [static]
Real Lz [static]

Definition at line 78 of file hb3.c.

Referenced by hst_dBy(), problem(), problem_read_restart(), ShearingBoxPot(), and Userforce_particle().