PLUTO
vel_limiter.c
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief Velocity limiter for relativistic hydro or MHD.
5 
6  Flatten reconstruction when either the left or right
7  reconstructed velocity values exceeds one.
8 
9  \authors A. Mignone (mignone@ph.unito.it)
10  \date June 11, 2015
11 */
12 /* ///////////////////////////////////////////////////////////////////// */
13 #include"pluto.h"
14 
15 /* ********************************************************************* */
16 void VelocityLimiter (double *v, double *vp, double *vm)
17 /*!
18  * Check whether the total reconstructed velocity is > 1
19  * If a superluminal value occurs, flatten distribution.
20  *
21  *********************************************************************** */
22 {
23 #if RECONSTRUCT_4VEL == NO && COMPONENTS > 1
24  int nv;
25  double v2m, v2p;
26 
27  v2m = EXPAND(vm[VX1]*vm[VX1], + vm[VX2]*vm[VX2], + vm[VX3]*vm[VX3]);
28  v2p = EXPAND(vp[VX1]*vp[VX1], + vp[VX2]*vp[VX2], + vp[VX3]*vp[VX3]);
29  if (v2m >= 1.0 || v2p >= 1.0){
30  for (nv = NVAR; nv--; ) vm[nv] = vp[nv] = v[nv];
31  }
32 #endif
33 }
#define VX2
Definition: mod_defs.h:29
#define VX1
Definition: mod_defs.h:28
PLUTO main header file.
void VelocityLimiter(double *v, double *vp, double *vm)
Definition: vel_limiter.c:16
#define VX3
Definition: mod_defs.h:30
#define NVAR
Definition: pluto.h:609