Functions

rsolvers/exact.c File Reference

Computes 1D fluxes using exact nonlinear Riemann solver. More...

Go to the source code of this file.

Functions

static void srder (double dm, double vl, double vr, double dmin, double dmax, double *y, double *dydx)
 Equation to solve iteratively for shock and rarefaction as well as its derivative.
static double rtsafe (void(*funcd)(double, double, double, double, double, double *, double *), double x1, double x2, double xacc, double vl, double vr, double dmin, double dmax)
 Numerical Recipes function rtsafe modified to use doubles and take extra parameters to pass to the derivative function above.
void fluxes (const Cons1DS Ul, const Cons1DS Ur, const Prim1DS Wl, const Prim1DS Wr, const Real Bxi, Cons1DS *pF)
 Calculates fluxes of CONSERVED variables.
static Real guessP (const Prim1DS Wl, const Prim1DS Wr)
 Provides a guess value for the pressure in the center region.
static Real PFunc (const Prim1DS W, Real POld)
 Evaluates the pressure function (see Toro) for the exact riemann solver, given the pressure POld.
static Real PFuncDeriv (const Prim1DS W, Real POld)
 evaluate the derivative of the pressure function (see Toro) at the pressure value POld
static Real getPC (const Prim1DS Wl, const Prim1DS Wr)
 Uses Newton-Raphson iteration to find the alebraic root of the pressure function and determine the pressure solution in the center region, Pc.

Detailed Description

Computes 1D fluxes using exact nonlinear Riemann solver.

PURPOSE: Computes 1D fluxes using exact nonlinear Riemann solver. Currently only isothermal hydrodynamics has been implemented.

REFERENCES:

HISTORY:

CONTAINS PUBLIC FUNCTIONS:

Definition in file exact.c.


Function Documentation

void fluxes ( const Cons1DS  Ul,
const Cons1DS  Ur,
const Prim1DS  Wl,
const Prim1DS  Wr,
const Real  Bx,
Cons1DS pFlux 
)

Calculates fluxes of CONSERVED variables.

Computes 1D fluxes Input Arguments:

  • Bxi = B in direction of slice at cell interface
  • Ul,Ur = L/R-states of CONSERVED variables at cell interface Output Arguments:
  • pFlux = pointer to fluxes of CONSERVED variables at cell interface.

Computes 1D fluxes.

Compute 1D fluxes Input Arguments:

  • Bxi = B in direction of slice at cell interface
  • Ul,Ur = L/R-states of CONSERVED variables at cell interface.

Computes 1D fluxes Input Arguments:

  • Ul,Ur = L/R-states of CONSERVED variables at cell interface
  • Wl,Wr = L/R-states of PRIMITIVE variables at cell interface Output Arguments:
  • pFlux = pointer to fluxes of CONSERVED variables at cell interface.

Computes 1D fluxes Input Arguments:

  • Ul,Ur = L/R-states of CONSERVED variables at cell interface Output Arguments:
  • pFlux = pointer to fluxes of CONSERVED variables at cell interface.

Computes 1D fluxes Input Arguments:

  • Bxi = B in direction of 1D slice at cell interface
  • Ul,Ur = L/R-states of CONSERVED variables at cell interface Output Arguments:
  • pFlux = pointer to fluxes of CONSERVED variables at cell interface.

Computes 1D fluxes using exact special relativistic Riemann solver.

Computes fluxes of CONSERVES variables.

Input Arguments:

  • Bxi = B in direction of slice at cell interface
  • Ul,Ur = L/R-states of CONSERVED variables at cell interface Output Arguments:
  • pFlux = pointer to fluxes of CONSERVED variables at cell interface

Input Arguments:

  • Bxi = B in direction of slice at cell interface
  • Ul,Ur = L/R-states of CONSERVED variables at cell interface Output Arguments:
  • pF = pointer to fluxes of CONSERVED variables at cell interface

Input Arguments:

  • Ul,Ur = L/R-states of CONSERVED variables at cell interface
  • Bx = B in direction of slice at cell interface Output Arguments:
  • pF = pointer to fluxes of CONSERVED variables at cell interface

--------------------------------------------------------------------------

Output Arguments:

  • Flux = fluxes of CONSERVED variables at cell interface

Input Arguments:

  • Ul,Ur = L/R-states of CONSERVED variables at cell interface
  • Bx = B in direction of slice at cell interface Output Arguments:
  • pFlux = pointer to fluxes of CONSERVED variables at cell interface

Definition at line 482 of file exact.c.

Referenced by integrate_1d_ctu(), integrate_1d_vl(), integrate_2d_ctu(), integrate_2d_vl(), integrate_3d_ctu(), and integrate_3d_vl().

Here is the caller graph for this function:

static Real getPC ( const Prim1DS  Wl,
const Prim1DS  Wr 
) [static]

Uses Newton-Raphson iteration to find the alebraic root of the pressure function and determine the pressure solution in the center region, Pc.

Fails if iteration diverges

Definition at line 433 of file exact.c.

References ath_error(), guessP(), PFunc(), PFuncDeriv(), and Prim1DS::Vx.

Referenced by fluxes().

Here is the call graph for this function:

Here is the caller graph for this function:

static Real guessP ( const Prim1DS  Wl,
const Prim1DS  Wr 
) [static]

Provides a guess value for the pressure in the center region.

The choice is made according to the Two-Shock approximate Riemman solver algorithm. Returns pressure guess value p_0, or TOL if p_0 is less than zero

Definition at line 347 of file exact.c.

References Prim1DS::d, Gamma, Prim1DS::P, and Prim1DS::Vx.

Referenced by getPC().

Here is the caller graph for this function:

static Real PFunc ( const Prim1DS  W,
Real  POld 
) [static]

Evaluates the pressure function (see Toro) for the exact riemann solver, given the pressure POld.

Definition at line 377 of file exact.c.

References a, Prim1DS::d, f, Gamma, and Prim1DS::P.

Referenced by fluxes(), and getPC().

Here is the caller graph for this function:

static Real PFuncDeriv ( const Prim1DS  W,
Real  POld 
) [static]

evaluate the derivative of the pressure function (see Toro) at the pressure value POld

Definition at line 404 of file exact.c.

References a, Prim1DS::d, Gamma, and Prim1DS::P.

Referenced by getPC().

Here is the caller graph for this function:

static double rtsafe ( void(*)(double, double, double, double, double, double *, double *)  funcd,
double  x1,
double  x2,
double  xacc,
double  vl,
double  vr,
double  dmin,
double  dmax 
) [static]

Numerical Recipes function rtsafe modified to use doubles and take extra parameters to pass to the derivative function above.

Definition at line 284 of file exact.c.

References f.

static void srder ( double  dm,
double  vl,
double  vr,
double  dmin,
double  dmax,
double *  y,
double *  dydx 
) [static]

Equation to solve iteratively for shock and rarefaction as well as its derivative.

Used by rtsafe()

Definition at line 266 of file exact.c.