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 |
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.
ConsFun_t get_usr_expr | ( | const char * | expr | ) |
VOutFun_t get_usr_out_fun | ( | const char * | name | ) |
Maxwell stress.
Definition at line 507 of file hb3.c.
References ConsS::B1c, ConsS::B2c, and GridS::U.
Referenced by problem().
void problem | ( | DomainS * | pDomain | ) |
Problem initial conditions, edited for each problem.
Definition at line 84 of file hb3.c.
References amp, ath_error(), B0, ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, beta, cc_pos(), ConsS::d, dump_history_enroll(), ConsS::E, eta_Ohm, Gamma, Gamma_1, DomainS::Grid, hst_Bx(), hst_BxBy(), hst_By(), hst_Bz(), hst_dEk(), hst_E_total(), hst_rho_Vx_dVy(), GridS::ie, ipert, GridS::is, GridS::je, GridS::js, GridS::ks, kx, kz, Lx, Lz, ConsS::M1, ConsS::M2, ConsS::M3, GridS::Nx, Omega_0, par_getd(), par_getd_def(), par_geti_def(), Q_AD, Q_Hall, qshear, ran2(), DomainS::RootMaxX, DomainS::RootMinX, ShBoxCoord, ShearingBoxPot, GridS::U, x1max, x1min, x2max, and x2min.
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.
void problem_write_restart | ( | MeshS * | pM, | |
FILE * | fp | |||
) |
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.
ShearingBoxPot.
Definition at line 398 of file hb3.c.
References Omega_0, and qshear.
Referenced by hst_E_total().
void Userwork_after_loop | ( | MeshS * | pM | ) |
void Userwork_in_loop | ( | MeshS * | pM | ) |
Definition at line 78 of file hb3.c.
Referenced by hst_dBy(), ParticlePosition(), pbc_ix1(), pbc_ox1(), problem(), problem_read_restart(), RemapEy_ix1(), RemapEy_ox1(), ShearingSheet_ix1(), and ShearingSheet_ox1().
Definition at line 78 of file hb3.c.
Referenced by hst_dBy(), problem(), problem_read_restart(), ShearingBoxPot(), and Userforce_particle().