Problem generator for advection of a field loop test. More...
Go to the source code of this file.
Functions | |
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. | |
static Real | current (const GridS *pG, const int i, const int j, const int k) |
computes x3-component of current | |
static Real | Bp2 (const GridS *pG, const int i, const int j, const int k) |
computes magnetic pressure (Bx2 + By2) | |
static Real | divB (const GridS *pG, const int i, const int j, const int k) |
calculates div(B) | |
static Real | Temperature (const GridS *pG, const int i, const int j, const int k) |
returns temperature for conduction tests | |
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. |
Problem generator for advection of a field loop test.
PURPOSE: Problem generator for advection of a field loop test. Can only be run in 2D or 3D. Input parameters are:
Various test cases are possible:
A sphere of passive scalar can be added to test advection of scalars.
The temperature in the loop can be changed using drat to test conduction.
REFERENCE: T. Gardiner & J.M. Stone, "An unsplit Godunov method for ideal MHD via constrined transport", JCP, 205, 509 (2005)
Definition in file field_loop.c.
computes magnetic pressure (Bx2 + By2)
Definition at line 361 of file field_loop.c.
References ConsS::B1c, ConsS::B2c, and GridS::U.
computes x3-component of current
Definition at line 353 of file field_loop.c.
References GridS::B1i, GridS::B2i, GridS::dx1, and GridS::dx2.
calculates div(B)
Definition at line 369 of file field_loop.c.
References GridS::B1i, GridS::B2i, GridS::B3i, GridS::dx1, GridS::dx2, GridS::dx3, and GridS::Nx.
Referenced by problem().
ConsFun_t get_usr_expr | ( | const char * | expr | ) |
Sets pointer to expression for special output data.
Definition at line 411 of file field_loop.c.
VOutFun_t get_usr_out_fun | ( | const char * | name | ) |
Returns a user defined output function pointer.
Definition at line 425 of file field_loop.c.
void problem | ( | DomainS * | pDomain | ) |
Problem initial conditions, edited for each problem.
Definition at line 42 of file field_loop.c.
References amp, ang_2, ath_error(), ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, calloc_3d_array(), cc_pos(), cos_a2, ConsS::d, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, free_3d_array(), Gamma_1, DomainS::Grid, GridS::ie, iprob, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, ku, lambda, ConsS::M1, ConsS::M2, ConsS::M3, n, nx1, nx2, nx3, par_getd(), par_getd_def(), rad, DomainS::RootMaxX, DomainS::RootMinX, ConsS::s, sin_a2, GridS::U, x1c, x2c, and x3c.
void problem_read_restart | ( | MeshS * | pM, | |
FILE * | fp | |||
) |
Problem specific subroutine for use with reading restart files, Edited for each problem.
Definition at line 343 of file field_loop.c.
void problem_write_restart | ( | MeshS * | pM, | |
FILE * | fp | |||
) |
Problem specific subroutine for use with writing restart files, Edited for each problem.
Definition at line 338 of file field_loop.c.
returns temperature for conduction tests
Definition at line 397 of file field_loop.c.
void Userwork_after_loop | ( | MeshS * | pM | ) |
Problem work executed after the main Athena loop, see main.c Edited for each problem.
Definition at line 433 of file field_loop.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 429 of file field_loop.c.