3from .scenario
import Scenario
8sys.path.insert(0, os.path.abspath(
"../equations"))
9from equations
import SWE_W_Bathymetry
13 Resting lake scenario for the shallow water equations.
14 The real water height H as defined by the sum of the water column h and
15 the bathymetry b is constant over the entire domain, meaning that there
16 should be no changes on the entire domain, but because we use the sum of
17 the derivatives of h and b (h' + b') instead of the derivative of the sum
18 (h + b)' some rounding errors will creep in, which causes unphysical
20 As such this scenario is nice for testing how large these unphysical waves
21 are for a given algorithm, and how stable the algorithm is, i.e. does it
22 dampen out these waves or do they oscillate out of control.
35 initial_conditions="sinusoidal",
42 "bilinear": jinja2.Template(
"""
43 {{VARIABLE}}[1] = 0.0;
44 {{VARIABLE}}[2] = 0.0;
45 {{VARIABLE}}[3] = 1.0 - std::abs(x[0]) - std::abs(x[1]);
46 {{VARIABLE}}[0] = 2.0 - {{VARIABLE}}[3];
48 "sinusoidal": jinja2.Template(
"""
49 {{VARIABLE}}[1] = 0.0;
50 {{VARIABLE}}[2] = 0.0;
51 {{VARIABLE}}[3] = sin( 2*M_PI * (x[0]+x[1]) );
52 {{VARIABLE}}[0] = 2.0 - {{VARIABLE}}[3];
54 "constant": jinja2.Template(
"""
55 {{VARIABLE}}[1] = 0.0;
56 {{VARIABLE}}[2] = 0.0;
57 {{VARIABLE}}[3] = 1.0;
58 {{VARIABLE}}[0] = 2.0 - {{VARIABLE}}[3];
Resting lake scenario for the shallow water equations.
_initial_conditions(self, Q)
analytical_solution(self)
__init__(self, initial_conditions="sinusoidal")