Problem generator for non-linear streaming instability in stratified disks. More...
Go to the source code of this file.
Functions | |
double | ran2 (long int *idum) |
double | Normal (long int *idum) |
Normal distribution random number generator. | |
Real | Erf (Real z) |
Error function. | |
void | MultiNSH (int n, Real *tstop, Real *mratio, Real etavk, Real *uxNSH, Real *uyNSH, Real *wxNSH, Real *wyNSH) |
Multi-species NSH equilibrium. | |
static Real | hst_rho_Vx_dVy (const Grid *pG, const int i, const int j, const int k) |
static void | close_ix2 (Grid *pGrid) |
static void | close_ox2 (Grid *pGrid) |
static Real | ShearingBoxPot (const Real x1, const Real x2, const Real x3) |
static int | property_limit (const Grain *gr, const GrainAux *grsub) |
User defined particle selection function (1: true; 0: false). | |
static int | property_trace (const Grain *gr, const GrainAux *grsub) |
User defined particle selection function (1: true; 0: false). | |
static int | property_type (const Grain *gr, const GrainAux *grsub) |
User defined particle selection function (1: true; 0: false). | |
static int | property_dense (const Grain *gr, const GrainAux *grsub) |
User defined particle selection function (1: true; 0: false). | |
Real | expr_dpar (const Grid *pG, const int i, const int j, const int k) |
Wrapper for particle density. | |
Real | expr_V1par (const Grid *pG, const int i, const int j, const int k) |
Wrapper for particle 1-velocity. | |
Real | expr_V2par (const Grid *pG, const int i, const int j, const int k) |
Wrapper for particle 2-velocity. | |
Real | expr_V3par (const Grid *pG, const int i, const int j, const int k) |
Wrapper for particle 3-velocity. | |
Real | expr_V2 (const Grid *pG, const int i, const int j, const int k) |
void | problem (Grid *pGrid, Domain *pDomain) |
void | problem_write_restart (Grid *pG, Domain *pD, FILE *fp) |
void | problem_read_restart (Grid *pG, Domain *pD, FILE *fp) |
Gasfun_t | get_usr_expr (const char *expr) |
Sets pointer to expression for special output data. | |
VGFunout_t | get_usr_out_fun (const char *name) |
Returns a user defined output function pointer. | |
PropFun_t | get_usr_par_prop (const char *name) |
Returns a user defined particle selection function. | |
void | gasvshift (const Real x1, const Real x2, const Real x3, Real *u1, Real *u2, Real *u3) |
Gas velocity shift. | |
void | Userforce_particle (Vector *ft, const Real x1, const Real x2, const Real x3, const Real v1, const Real v2, const Real v3) |
void | Userwork_in_loop (Grid *pGrid, Domain *pDomain) |
void | Userwork_after_loop (Grid *pGrid, Domain *pDomain) |
Variables | |
Real | vsc1 |
Real | vsc2 |
int | ipert |
Real | x1min |
Real | x1max |
Real | x2min |
Real | x2max |
Real | Lx |
Real | Lz |
Real | Lg |
long | Npar |
long | ntrack |
long | nlis |
int | mytype |
Real | dpar_thresh |
Problem generator for non-linear streaming instability in stratified disks.
PURPOSE: Problem generator for non-linear streaming instability in stratified disks. This code works in 2D ONLY. Isothermal eos is assumed, and the value etavk/iso_sound is fixed. MPI domain decomposition in x is allowed, but not in z.
Perturbation modes:
Must be configured using --enable-shearing-box and --with-eos=isothermal. FARGO is recommended.
Reference: Johansen & Youdin, 2007, ApJ, 662, 627 Bai & Stone, 2009, in preparation
Definition in file par_strat2d.c.
static void close_ix2 | ( | Grid * | pGrid | ) | [static] |
Definition at line 418 of file par_strat2d.c.
Referenced by problem().
static void close_ox2 | ( | Grid * | pGrid | ) | [static] |
Definition at line 437 of file par_strat2d.c.
Referenced by problem().
Real expr_dpar | ( | const Grid * | pG, | |
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
Wrapper for particle density.
Definition at line 291 of file output_particle.c.
Real expr_V1par | ( | const Grid * | pG, | |
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
Wrapper for particle 1-velocity.
Definition at line 312 of file output_particle.c.
Real expr_V2 | ( | const Grid * | pG, | |
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
Real expr_V2par | ( | const Grid * | pG, | |
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
Wrapper for particle 2-velocity.
Definition at line 319 of file output_particle.c.
Real expr_V3par | ( | const Grid * | pG, | |
const int | i, | |||
const int | j, | |||
const int | k | |||
) |
Wrapper for particle 3-velocity.
Definition at line 326 of file output_particle.c.
Gas velocity shift.
Definition at line 475 of file par_strat2d.c.
Gasfun_t get_usr_expr | ( | const char * | expr | ) |
Sets pointer to expression for special output data.
Definition at line 456 of file par_strat2d.c.
VGFunout_t get_usr_out_fun | ( | const char * | name | ) |
Returns a user defined output function pointer.
Definition at line 461 of file par_strat2d.c.
PropFun_t get_usr_par_prop | ( | const char * | name | ) |
Returns a user defined particle selection function.
Definition at line 466 of file par_strat2d.c.
static Real hst_rho_Vx_dVy | ( | const Grid * | pG, | |
const int | i, | |||
const int | j, | |||
const int | k | |||
) | [static] |
Definition at line 405 of file par_strat2d.c.
References cc_pos(), Omega_0, and qshear.
Referenced by problem(), and problem_read_restart().
void MultiNSH | ( | int | n, | |
Real * | tstop, | |||
Real * | mratio, | |||
Real | etavk, | |||
Real * | uxNSH, | |||
Real * | uyNSH, | |||
Real * | wxNSH, | |||
Real * | wyNSH | |||
) |
Multi-species NSH equilibrium.
Input: # of particle types (n), dust stopping time and mass ratio array, and drift speed etavk. Output: gas NSH equlibrium velocity (u), and dust NSH equilibrium velocity array (w).
Definition at line 599 of file par_strat2d.c.
References calloc_1d_array(), calloc_2d_array(), free_2d_array(), InverseMatrix(), and MatrixMult().
Referenced by problem().
double Normal | ( | long int * | idum | ) |
Normal distribution random number generator.
Definition at line 721 of file par_strat2d.c.
References ran2().
Referenced by problem().
void problem | ( | Grid * | pGrid, | |
Domain * | pDomain | |||
) |
Definition at line 99 of file par_strat2d.c.
References alamcoeff, ath_error(), calloc_1d_array(), calloc_2d_array(), cc_pos(), cellj(), close_ix2(), close_ox2(), dpar_thresh, dump_history_enroll(), epsilon, etavk, free_2d_array(), get_ts, grrhoa, hst_rho_Vx_dVy(), ipert, Iso_csound, left_x2, Lg, Lx, Lz, mratio, MultiNSH(), nlis, Normal(), Npar, ntrack, Omega(), Omega_0, par_getd(), par_getd_def(), par_geti(), par_geti_def(), particle_realloc(), q, qshear, ran2(), right_x2, ShearingBoxPot, StaticGravPot, tstop0, uxNSH, uyNSH, vsc1, vsc2, wxNSH, wyNSH, x1max, x1min, x2max, x2min, zmax, and zmin.
void problem_read_restart | ( | Grid * | pG, | |
Domain * | pD, | |||
FILE * | fp | |||
) |
Definition at line 371 of file par_strat2d.c.
References dump_history_enroll(), hst_rho_Vx_dVy(), ipert, Iso_csound, Lg, Lx, Lz, nlis, Npar, ntrack, Omega_0, par_getd(), par_getd_def(), par_geti(), par_geti_def(), qshear, ShearingBoxPot, StaticGravPot, vsc1, vsc2, x1max, x1min, x2max, and x2min.
void problem_write_restart | ( | Grid * | pG, | |
Domain * | pD, | |||
FILE * | fp | |||
) |
Definition at line 366 of file par_strat2d.c.
static int property_dense | ( | const Grain * | gr, | |
const GrainAux * | grsub | |||
) | [static] |
User defined particle selection function (1: true; 0: false).
Definition at line 581 of file par_strat2d.c.
References GrainAux::dpar, and dpar_thresh.
static int property_limit | ( | const Grain * | gr, | |
const GrainAux * | grsub | |||
) | [static] |
User defined particle selection function (1: true; 0: false).
Definition at line 551 of file par_strat2d.c.
References nlis.
static int property_trace | ( | const Grain * | gr, | |
const GrainAux * | grsub | |||
) | [static] |
User defined particle selection function (1: true; 0: false).
Definition at line 561 of file par_strat2d.c.
References ntrack.
static int property_type | ( | const Grain * | gr, | |
const GrainAux * | grsub | |||
) | [static] |
User defined particle selection function (1: true; 0: false).
Definition at line 571 of file par_strat2d.c.
References mytype.
double ran2 | ( | long int * | idum | ) |
Definition at line 683 of file par_strat2d.c.
void Userwork_after_loop | ( | Grid * | pGrid, | |
Domain * | pDomain | |||
) |
Definition at line 514 of file par_strat2d.c.
void Userwork_in_loop | ( | Grid * | pGrid, | |
Domain * | pDomain | |||
) |
Definition at line 503 of file par_strat2d.c.
Definition at line 60 of file par_strat2d.c.
Referenced by problem(), and property_dense().
int ipert |
Definition at line 52 of file par_strat2d.c.
Referenced by problem(), problem_read_restart(), and problem_write_restart().
Definition at line 54 of file par_strat2d.c.
Referenced by problem(), problem_read_restart(), ShearingBoxPot(), and Userforce_particle().
Definition at line 54 of file par_strat2d.c.
Definition at line 54 of file par_strat2d.c.
int mytype |
Definition at line 59 of file par_strat2d.c.
Referenced by property_type().
long nlis |
Definition at line 58 of file par_strat2d.c.
Referenced by problem(), problem_read_restart(), and property_limit().
long Npar |
Definition at line 55 of file par_strat2d.c.
long ntrack |
Definition at line 57 of file par_strat2d.c.
Referenced by problem(), problem_read_restart(), and property_trace().
Definition at line 51 of file par_strat2d.c.
Referenced by problem(), problem_read_restart(), and Userforce_particle().
Definition at line 51 of file par_strat2d.c.
Referenced by problem(), problem_read_restart(), and Userforce_particle().
Definition at line 54 of file par_strat2d.c.
Definition at line 54 of file par_strat2d.c.
Definition at line 54 of file par_strat2d.c.
Definition at line 54 of file par_strat2d.c.