Sets up shock at angle to grid to test 3D algorithms. More...
Go to the source code of this file.
Functions | |
static void | lx_bc (GridS *pG) |
Apply boundary condition in left-x direction. | |
static void | rx_bc (GridS *pG) |
Apply boundary condition in right-x direction. | |
static void | ly_bc (GridS *pG) |
Apply boundary condition in left-y direction. | |
static void | ry_bc (GridS *pG) |
Apply boundary condition in right-y direction. | |
static void | lz_bc (GridS *pG) |
Apply boundary condition in left-z direction. | |
static void | rz_bc (GridS *pG) |
Apply boundary condition in right-z direction. | |
static Real | Ax (const Real x1, const Real x2, const Real x3) |
s-component of vector potential | |
static Real | Ay (const Real x1, const Real x2, const Real x3) |
y-component of vector potential | |
static Real | Az (const Real x1, const Real x2, const Real x3) |
z-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 | 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 int | rx |
static int | ry |
static int | rz |
static Real | ang_2 |
static Real | ang_3 |
static Real | sin_a2 |
static Real | cos_a2 |
static Real | sin_a3 |
static Real | cos_a3 |
static Real | dl |
static Real | vxl |
static Real | vyl |
static Real | vzl |
static Real | dr |
static Real | vxr |
static Real | vyr |
static Real | vzr |
static Real | Bxl |
static Real | Byl |
static Real | Bzl |
static Real | Bxr |
static Real | Byr |
static Real | Bzr |
static Real | Pl |
static Real | Pr |
Sets up shock at angle to grid to test 3D algorithms.
PURPOSE: Sets up shock at angle to grid to test 3D algorithms. Setting up the initial conditions to minimize grid noise is very complex, so this special function has been written to handle only 3D problems.
This problem cannot be run with Static Mesh Refinement.
This code is most easily understood in terms of a one dimensional problem in the coordinate system (x1,x2,x3). Two coordinate rotations are applied to obtain a new wave vector in a 3D space in the (x,y,z) coordinate system.
First rotate about the x2 axis:
Next rotate about the x3' axis:
Expanding this out we get:
This inverts to:
The initial conditions must be translation invariant, i.e. q(x,y,z) = q(x+tx, y+ty, z+tz) for (tx,ty,tz) such that x1(x,y,z) = x1(x+tx, y+ty, z+ty). Inserting this last expression for x1(x,y,z) into the transformation above leads to
Now, restrict the translation symmetry to be discrete by inserting (tx, ty, tz) = (nx*dx, ny*dy, nz*dz) where (nx, ny, nz) are integers (not the number of grid cells in each direction) and (dx, dy, dz) are the grid cell sizes. With some simplification the translation symmetry becomes
Now, choose an integer unit cell size (rx, ry, rz) where
and
With this choice, or equation for discrete translation symmetry becomes
PRIVATE FUNCTION PROTOTYPES:
This is the equation for a set of discrete points which lie in a plane and is a key relation for setting ghost cells in the boundary condition routines below. -- T. A. Gardiner -- 7/21/2006
Definition in file shkset3d.c.
ConsFun_t get_usr_expr | ( | const char * | expr | ) |
Sets pointer to expression for special output data.
Definition at line 745 of file shkset3d.c.
VOutFun_t get_usr_out_fun | ( | const char * | name | ) |
Returns a user defined output function pointer.
Definition at line 750 of file shkset3d.c.
static void lx_bc | ( | GridS * | pG | ) | [static] |
Apply boundary condition in left-x direction.
Definition at line 771 of file shkset3d.c.
References GridS::B1i, GridS::B2i, GridS::B3i, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, rx, ry, rz, and GridS::U.
Referenced by problem().
static void ly_bc | ( | GridS * | pG | ) | [static] |
Apply boundary condition in left-y direction.
Definition at line 853 of file shkset3d.c.
References GridS::B1i, GridS::B2i, GridS::B3i, GridS::ie, GridS::is, GridS::js, GridS::ke, GridS::ks, rx, ry, rz, and GridS::U.
Referenced by problem().
static void lz_bc | ( | GridS * | pG | ) | [static] |
Apply boundary condition in left-z direction.
Definition at line 935 of file shkset3d.c.
References GridS::B1i, GridS::B2i, GridS::B3i, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ks, rx, ry, rz, and GridS::U.
Referenced by problem().
void problem | ( | DomainS * | pDomain | ) |
Problem initial conditions, edited for each problem.
Definition at line 135 of file shkset3d.c.
References ang_2, ang_3, ath_error(), ath_perr(), Ax(), Ay(), Az(), ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, bvals_mhd_fun(), Bxl, Bxr, Byl, Byr, Bzl, Bzr, calloc_3d_array(), cos_a2, cos_a3, ConsS::d, GridS::Disp, dl, dr, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, free_3d_array(), Gamma_1, DomainS::Grid, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, GridS::ks, kx, left_x1, left_x2, left_x3, lx_bc(), ly_bc(), lz_bc(), ConsS::M1, ConsS::M2, ConsS::M3, GridS::MinX, n, DomainS::Nx, par_getd(), par_geti(), Pl, Pr, right_x1, right_x2, right_x3, rx, rx_bc(), ry, ry_bc(), rz, rz_bc(), sin_a2, sin_a3, GridS::U, vxl, vxr, vyl, vyr, vzl, and vzr.
void problem_read_restart | ( | MeshS * | pM, | |
FILE * | fp | |||
) |
Problem specific subroutine for use with reading restart files, Edited for each problem.
Definition at line 740 of file shkset3d.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 735 of file shkset3d.c.
static void rx_bc | ( | GridS * | pG | ) | [static] |
Apply boundary condition in right-x direction.
Definition at line 812 of file shkset3d.c.
References GridS::B1i, GridS::B2i, GridS::B3i, GridS::ie, GridS::je, GridS::js, GridS::ke, GridS::ks, rx, ry, rz, and GridS::U.
Referenced by problem().
static void ry_bc | ( | GridS * | pG | ) | [static] |
Apply boundary condition in right-y direction.
Definition at line 894 of file shkset3d.c.
References GridS::B1i, GridS::B2i, GridS::B3i, GridS::ie, GridS::is, GridS::je, GridS::ke, GridS::ks, rx, ry, rz, and GridS::U.
Referenced by problem().
static void rz_bc | ( | GridS * | pG | ) | [static] |
Apply boundary condition in right-z direction.
Definition at line 976 of file shkset3d.c.
References GridS::B1i, GridS::B2i, GridS::B3i, GridS::ie, GridS::is, GridS::je, GridS::js, GridS::ke, rx, ry, rz, and GridS::U.
Referenced by problem().
void Userwork_after_loop | ( | MeshS * | pM | ) |
Problem work executed after the main Athena loop, see main.c Edited for each problem.
Definition at line 759 of file shkset3d.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 754 of file shkset3d.c.
Definition at line 96 of file shkset3d.c.
Referenced by problem().
Definition at line 96 of file shkset3d.c.
Referenced by problem().
Definition at line 102 of file shkset3d.c.
Referenced by problem().
Definition at line 102 of file shkset3d.c.
Referenced by problem().
Definition at line 102 of file shkset3d.c.
Definition at line 102 of file shkset3d.c.
Definition at line 99 of file shkset3d.c.
Referenced by problem().
Definition at line 100 of file shkset3d.c.
Referenced by problem().
Definition at line 105 of file shkset3d.c.
Referenced by entropy_flux(), fluxes(), and problem().
Definition at line 105 of file shkset3d.c.
Referenced by entropy_flux(), fluxes(), and problem().
int rx [static] |
Definition at line 95 of file shkset3d.c.
Referenced by dom_decomp_2d(), dom_decomp_3d(), lx_bc(), ly_bc(), lz_bc(), problem(), rx_bc(), ry_bc(), and rz_bc().
int ry [static] |
Definition at line 95 of file shkset3d.c.
Referenced by dom_decomp_2d(), dom_decomp_3d(), lx_bc(), ly_bc(), lz_bc(), problem(), rx_bc(), ry_bc(), and rz_bc().
int rz [static] |
Definition at line 95 of file shkset3d.c.
Referenced by dom_decomp_3d(), lx_bc(), ly_bc(), lz_bc(), problem(), rx_bc(), ry_bc(), and rz_bc().
Definition at line 99 of file shkset3d.c.
Referenced by problem().
Definition at line 100 of file shkset3d.c.
Referenced by problem().
Definition at line 99 of file shkset3d.c.
Referenced by problem().
Definition at line 100 of file shkset3d.c.
Referenced by problem().