PLUTO
flag_shock.c File Reference

Shock finding algorithm. More...

#include "pluto.h"
Include dependency graph for flag_shock.c:

Go to the source code of this file.

Macros

#define EPS_PSHOCK_FLATTEN   5.0
 
#define EPS_PSHOCK_ENTROPY   0.05
 

Detailed Description

Shock finding algorithm.

Search and flag computational zones lying in a shock wave. The flagging strategy is based on two switches designed to detect the presence of compressive motion or shock waves in the fluid:

\[ \nabla\cdot\vec{v} < 0 \qquad{\rm and}\qquad \Delta x\frac{|\nabla p|}{p} > \epsilon_p \]

where $\epsilon_p$ sets the shock strength. At the discrete level we replace the two conditions by

\[ \sum_d \frac{ A_{\vec{i}+\HALF\hvec{e}_d}v_{d,\vec{i}+\HALF\hvec{e}_d} -A_{\vec{i}-\HALF\hvec{e}_d}v_{d,\vec{i}-\HALF\hvec{e}_d} } {\Delta{\cal V}_{d,\vec{i}}} < 0 \qquad{\rm and}\qquad \sum_{d} \left|p_{\vec{i}+\hvec{e}_d} - p_{\vec{i}-\hvec{e}_d}\right| < \epsilon_p \min_d\left(p_{\vec{i}+\hvec{e}_d}, p_{\vec{i}-\hvec{e}_d},p_{\vec{i}}\right) \]

where $\hvec{i} = (i,j,k)$ is a vector of integer numbers giving the position of a computational zone, while $\hvec{e}_d = (\delta_{1d},\delta_{2d},\delta_{3d})$ is a unit vector in the direction given by d. Once a zone has been tagged as lying in a shock, different flags may be switched on or off to control the update strategy in these critical regions.

This function can be called called when:

  • SHOCK_FLATTENING has been set to MULTID: in this case shocked zones are tagged with FLAG_MINMOD and FLAG_HLL that will later be used to force the reconstruction with the minmod limiter and the Riemann solver to HLL.
  • ENTROPY_SWITCH has been turned on: this flag will be checked later in the ConsToPrim() functions in order to recover pressure from the entropy density rather than from the total energy density. The update process is:
    • start with a vector of primitive variables {V,s} where s is the entropy;
    • set boundary condition on {V};
    • compute {s} from {V};
    • flag zones where entropy may be used (flag = 1);
    • evolve equations for one time step;
    • convert {U,S} to primitive:
      if (flag == 0) { // Use energy
      p = p(E)
      s = s(p)
      }else{ // use entropy
      p = p(S)
      E = E(p)
      }

Reference

  • "Maintaining Pressure Positivity in Magnetohydrodynamics Simulations" Balsara & Spicer, JCP (1999) 148, 133
Authors
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
July 28, 2015

Definition in file flag_shock.c.

Macro Definition Documentation

#define EPS_PSHOCK_ENTROPY   0.05

Definition at line 74 of file flag_shock.c.

#define EPS_PSHOCK_FLATTEN   5.0

Definition at line 70 of file flag_shock.c.