Functions | Variables

prob/shkset3d.c File Reference

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

Detailed Description

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.


Function Documentation

static Real Ax ( const Real  x1,
const Real  x2,
const Real  x3 
) [static]

s-component of vector potential

Definition at line 1019 of file shkset3d.c.

References A2(), A3(), Byl, Byr, Bzl, Bzr, cos_a2, cos_a3, sin_a2, and sin_a3.

Referenced by problem().

Here is the call graph for this function:

Here is the caller graph for this function:

static Real Ay ( const Real  x1,
const Real  x2,
const Real  x3 
) [static]

y-component of vector potential

Definition at line 1030 of file shkset3d.c.

References A2(), A3(), Byl, Byr, Bzl, Bzr, cos_a2, cos_a3, sin_a2, and sin_a3.

Referenced by problem().

Here is the call graph for this function:

Here is the caller graph for this function:

static Real Az ( const Real  x1,
const Real  x2,
const Real  x3 
) [static]

z-component of vector potential

Definition at line 1041 of file shkset3d.c.

References A3(), Byl, Byr, cos_a2, cos_a3, sin_a2, and sin_a3.

Referenced by problem().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

void problem ( DomainS pDomain  ) 
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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.


Variable Documentation

Real ang_2 [static]

Definition at line 96 of file shkset3d.c.

Referenced by problem().

Real ang_3 [static]

Definition at line 96 of file shkset3d.c.

Referenced by problem().

Real Bxl [static]

Definition at line 102 of file shkset3d.c.

Referenced by problem().

Real Bxr [static]

Definition at line 102 of file shkset3d.c.

Referenced by problem().

Real Byl [static]

Definition at line 102 of file shkset3d.c.

Referenced by Ax(), Ay(), Az(), and problem().

Real Byr [static]

Definition at line 102 of file shkset3d.c.

Referenced by Ax(), Ay(), Az(), and problem().

Real Bzl [static]

Definition at line 102 of file shkset3d.c.

Referenced by Ax(), Ay(), and problem().

Real Bzr [static]

Definition at line 102 of file shkset3d.c.

Referenced by Ax(), Ay(), and problem().

Real cos_a2 [static]

Definition at line 97 of file shkset3d.c.

Referenced by Ax(), Ay(), Az(), and problem().

Real cos_a3 [static]

Definition at line 97 of file shkset3d.c.

Referenced by Ax(), Ay(), Az(), and problem().

Real dl [static]

Definition at line 99 of file shkset3d.c.

Referenced by problem().

Real dr [static]

Definition at line 100 of file shkset3d.c.

Referenced by problem().

Real Pl [static]

Definition at line 105 of file shkset3d.c.

Referenced by entropy_flux(), fluxes(), and problem().

Real Pr [static]

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().

Real sin_a2 [static]

Definition at line 97 of file shkset3d.c.

Referenced by Ax(), Ay(), Az(), and problem().

Real sin_a3 [static]

Definition at line 97 of file shkset3d.c.

Referenced by Ax(), Ay(), Az(), and problem().

Real vxl [static]

Definition at line 99 of file shkset3d.c.

Referenced by fluxes(), and problem().

Real vxr [static]

Definition at line 100 of file shkset3d.c.

Referenced by fluxes(), and problem().

Real vyl [static]

Definition at line 99 of file shkset3d.c.

Referenced by problem().

Real vyr [static]

Definition at line 100 of file shkset3d.c.

Referenced by problem().

Real vzl [static]

Definition at line 99 of file shkset3d.c.

Referenced by problem().

Real vzr [static]

Definition at line 100 of file shkset3d.c.

Referenced by problem().