3 from .scenario
import Scenario
8 sys.path.insert(0, os.path.abspath(
"../equations"))
9 from equations
import Euler
14 Scenario reproduced from Ioratti, Dumbser & Loubère, https://doi.org/10.1007/s10915-020-01209-w (p. 44)
29 Q[0] = 0.02*(1.0+std::exp(-0.5*tarch::la::norm2(x)*tarch::la::norm2(x)/0.01));
34 constexpr double gamma = 1.4;
35 constexpr double p = 1.0;
37 //Should lead to a constant p over the domain given the initial conditions
38 Q[3] = p/(gamma-1.0) + 0.5*(Q[1]*Q[1]+Q[2]*Q[2]) / Q[0];
44 The initial condition is transported without deformation in a periodic
45 domain [-.5, +.5], i.e. the value at a given point is the value at the
46 position x - v*t but accounting for periodicity.
47 Therefore we find the point x - v*t, and then shift this by instances
48 of 1.0 until we find the point within the domain.
50 tarch::la::Vector<DIMENSIONS,double> pos = { (x[0] - t) + (int)(t + .5 - x[0]),
51 (x[1] - t) + (int)(t + .5 - x[1]) };
53 solution[0] = 0.02*(1.0+std::exp(-0.5*tarch::la::norm2(pos)*tarch::la::norm2(pos)/0.01));
55 solution[1] = 1.0*solution[0];
56 solution[2] = 1.0*solution[0];
59 constexpr double gamma = 1.4;
60 constexpr double p = 1.0;
62 //Should lead to a constant p over the domain given the initial conditions
63 solution[3] = p/(gamma-1.0) + 0.5*(solution[1]*solution[1]+solution[2]*solution[2]) / solution[0];
Scenario reproduced from Ioratti, Dumbser & Loubère, https://doi.org/10.1007/s10915-020-01209-w (p.
def analytical_solution(self)
def __init__(self, iterations=2)
def initial_conditions(self)