Functions | Variables

prob/cpaw3d.c File Reference

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

Detailed Description

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.


Function Documentation

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

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

Here is the caller graph for this function:

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

A2: 2-component of vector potential.

Definition at line 554 of file cpaw3d.c.

References b_par, b_perp, cos_a2, cos_a3, fac, k_par, sin_a2, and sin_a3.

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

Here is the caller graph for this function:

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

A3: 3-component of vector potential.

Definition at line 573 of file cpaw3d.c.

References b_par, b_perp, cos_a2, cos_a3, k_par, sin_a2, and sin_a3.

void get_eta_user ( GridS pG,
int  i,
int  j,
int  k,
Real eta_O,
Real eta_H,
Real eta_A 
)

Definition at line 322 of file cpaw3d.c.

ConsFun_t get_usr_expr ( const char *  expr  ) 

Sets pointer to expression for special output data.

Definition at line 313 of file cpaw3d.c.

VOutFun_t get_usr_out_fun ( const char *  name  ) 

Returns a user defined output function pointer.

Definition at line 317 of file cpaw3d.c.

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 307 of file cpaw3d.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 302 of file cpaw3d.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 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.

Here is the call graph for this function:

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 333 of file cpaw3d.c.


Variable Documentation

Real ang_2 [static]

Definition at line 76 of file cpaw3d.c.

Referenced by problem().

Real ang_3 [static]

Definition at line 76 of file cpaw3d.c.

Referenced by problem().

Real b_par [static]

Definition at line 75 of file cpaw3d.c.

Real b_perp [static]

Definition at line 75 of file cpaw3d.c.

Real cos_a2 [static]

Definition at line 77 of file cpaw3d.c.

Referenced by A1(), A2(), A3(), and problem().

Real cos_a3 [static]

Definition at line 77 of file cpaw3d.c.

Referenced by A1(), A2(), A3(), and problem().

Real fac [static]

Definition at line 77 of file cpaw3d.c.

Real k_par [static]

Definition at line 78 of file cpaw3d.c.

Real lambda [static]

Definition at line 78 of file cpaw3d.c.

Referenced by getVChar_pluto(), and problem().

ConsS*** RootSoln = NULL [static]

Definition at line 71 of file cpaw3d.c.

Real sin_a2 [static]

Definition at line 77 of file cpaw3d.c.

Referenced by A1(), A2(), A3(), and problem().

Real sin_a3 [static]

Definition at line 77 of file cpaw3d.c.

Referenced by A1(), A2(), A3(), and problem().