PLUTO
hll_speed.c
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief Compute the outermost wave speeds for HLL-based solvers.
5 
6  HLL_Speed() computes an estimate to the leftmost and rightmost
7  wave signal speeds bounding the Riemann fan based on the input states
8  ::vR and ::vL.
9  Depending on the estimate, several variants are possible.
10 
11  \authors A. Mignone (mignone@ph.unito.it)
12  \date June 6, 2013
13 */
14 /* ///////////////////////////////////////////////////////////////////// */
15 #include"pluto.h"
16 
17 /* ********************************************************************* */
18 void HLL_Speed (double **vL, double **vR, double *a2L, double *a2R,
19  double *SL, double *SR, int beg, int end)
20 /*!
21  * Compute leftmost (SL) and rightmost (SR) speed for the Riemann fan.
22  *
23  * \param [in] vL left state for the Riemann solver
24  * \param [in] vR right state for the Riemann solver
25  * \param [in] a2L 1-D array containing the square of the sound speed
26  * for the left state
27  * \param [in] a2R 1-D array containing the square of the sound speed
28  * for the right state
29  * \param [out] SL the (estimated) leftmost speed of the Riemann fan
30  * \param [out] SR the (estimated) rightmost speed of the Riemann fan
31  * \param [in] beg starting index of computation
32  * \param [in] end final index of computation
33  *
34  *********************************************************************** */
35 {
36  int i;
37  static real *sl_min, *sl_max;
38  static real *sr_min, *sr_max;
39 
40  if (sl_min == NULL){
41  sl_min = ARRAY_1D(NMAX_POINT, double);
42  sl_max = ARRAY_1D(NMAX_POINT, double);
43 
44  sr_min = ARRAY_1D(NMAX_POINT, double);
45  sr_max = ARRAY_1D(NMAX_POINT, double);
46  }
47 
48 /* ----------------------------------------------
49  use Davis estimate for the signal velocities
50  ---------------------------------------------- */
51 
52  MaxSignalSpeed (vL, a2L, sl_min, sl_max, beg, end);
53  MaxSignalSpeed (vR, a2R, sr_min, sr_max, beg, end);
54  for (i = beg; i <= end; i++) {
55  SL[i] = MIN(sl_min[i], sr_min[i]);
56  SR[i] = MAX(sl_max[i], sr_max[i]);
57  }
58 }
#define MAX(a, b)
Definition: macros.h:101
double real
Definition: pluto.h:488
#define MIN(a, b)
Definition: macros.h:104
PLUTO main header file.
#define ARRAY_1D(nx, type)
Definition: prototypes.h:170
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
Definition: globals.h:62
int i
Definition: analysis.c:2
void HLL_Speed(double **vL, double **vR, double *a2L, double *a2R, double *SL, double *SR, int beg, int end)
Definition: hll_speed.c:24
void MaxSignalSpeed(double **v, double *cs2, double *cmin, double *cmax, int beg, int end)
Definition: eigenv.c:34