Problem generator for circularly polarized Alfven wave (CPAW) in 3D test. More...
Go to the source code of this file.
Functions | |
static Real | A1 (const Real x1, const Real x2, const Real x3) |
A1: 1-component of vector potential, using a gauge such that Ax = 0, and Ay, Az are functions of x and y alone. | |
static Real | A2 (const Real x1, const Real x2, const Real x3) |
A2: 2-component of vector potential. | |
static Real | A3 (const Real x1, const Real x2, const Real x3) |
A3: 3-component of vector potential. | |
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 | get_eta_user (GridS *pG, int i, int j, int k, Real *eta_O, Real *eta_H, Real *eta_A) |
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 ConsS *** | RootSoln = NULL |
static Real | b_par |
static Real | b_perp |
static Real | ang_2 |
static Real | ang_3 |
static Real | fac |
static Real | sin_a2 |
static Real | cos_a2 |
static Real | sin_a3 |
static Real | cos_a3 |
static Real | lambda |
static Real | k_par |
Problem generator for circularly polarized Alfven wave (CPAW) in 3D test.
PURPOSE: Problem generator for circularly polarized Alfven wave (CPAW) in 3D test. The angles the wave propagates to the grid is automatically computed to be alpha12 = tan^{-1} (Y/X) and alpha23 = tan^{-1} (Z/Y).
The wave is defined with reference to a coordinate system (x,y,z) with transformation rules to the code coordinate system (x1,x2,x3)
First rotate about the y axis:
Next rotate about the z' axis:
Expanding this out we get:
This inverts to:
The magnetic field is given by:
Note these transformations are the same used in linear_wave3d.c
Can be used for either standing (problem/v_par=1.0) or travelling (problem/v_par=0.0) waves.
USERWORK_AFTER_LOOP function computes L1 error norm in solution by comparing to initial conditions. Problem must be evolved for an integer number of wave periods for this to work.
PRIVATE FUNCTION PROTOTYPES:
REFERENCE: G. Toth, "The div(B)=0 constraint in shock capturing MHD codes", JCP, 161, 605 (2000)
Definition in file cpaw3d.c.
A1: 1-component of vector potential, using a gauge such that Ax = 0, and Ay, Az are functions of x and y alone.
Definition at line 535 of file cpaw3d.c.
References b_par, b_perp, cos_a2, cos_a3, fac, k_par, sin_a2, and sin_a3.
Referenced by problem(), vecpot2b2i(), and vecpot2b3i().
ConsFun_t get_usr_expr | ( | const char * | expr | ) |
VOutFun_t get_usr_out_fun | ( | const char * | name | ) |
void problem | ( | DomainS * | pDomain | ) |
Problem initial conditions, edited for each problem.
Definition at line 95 of file cpaw3d.c.
References A1(), A2(), A3(), ang_2, ang_3, ath_error(), ath_pout(), ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, b_par, b_perp, calloc_3d_array(), cc_pos(), cos_a2, cos_a3, ConsS::d, d_ind, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, fac, Gamma_1, DomainS::Grid, GridS::ie, GridS::is, GridS::je, GridS::js, k_par, GridS::ke, GridS::ks, lambda, DomainS::Level, ConsS::M1, ConsS::M2, ConsS::M3, n, GridS::Nx, nx1, nx2, nx3, par_getd(), par_geti_def(), Q_Hall, DomainS::RootMaxX, DomainS::RootMinX, s, sin_a2, sin_a3, Soln, and GridS::U.
void problem_read_restart | ( | MeshS * | pM, | |
FILE * | fp | |||
) |
void problem_write_restart | ( | MeshS * | pM, | |
FILE * | fp | |||
) |
void Userwork_after_loop | ( | MeshS * | pM | ) |
Problem work executed after the main Athena loop, see main.c Edited for each problem.
Definition at line 343 of file cpaw3d.c.
References ath_error(), ath_perr(), ConsS::B1c, ConsS::B2c, ConsS::B3c, DomainS::Comm_Domain, ConsS::d, MeshS::Domain, ConsS::E, error, DomainS::Grid, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, ConsS::M1, ConsS::M2, ConsS::M3, DomainS::Nx, and GridS::U.
void Userwork_in_loop | ( | MeshS * | pM | ) |
Definition at line 78 of file cpaw3d.c.
Referenced by getVChar_pluto(), and problem().