Peano
swe_radial_dam_break.py
Go to the documentation of this file.
1
# This file is part of the ExaHyPE2 project. For conditions of distribution and
2
# use, please see the copyright notice at www.peano-framework.org
3
from
.scenario
import
Scenario
4
5
import
os
6
import
sys
7
8
sys.path.insert(0, os.path.abspath(
"../equations"
))
9
from
equations
import
SWE_W_Bathymetry
10
11
12
class
SWERadialDamBreak
(
Scenario
):
13
"""
14
Classic radial dam break SWE equations, with constant initial water height but
15
a bump in the bathymetry in the centre.
16
"""
17
18
_plot_dt = 0.05
19
_offset = -0.5
20
_domain_size = 1.0
21
_periodic_bc =
False
22
_dimensions = 2
23
_equation =
SWE_W_Bathymetry
()
24
_end_time = 0.5
25
26
def
__init__
(self):
27
return
28
29
def
initial_conditions
(self):
30
return
"""
31
// The number of cells will be odd, this computes half of the total -1
32
// e.g. 27 cells -> 13, 81 cells -> 40
33
// We then place the circle so that it's center is that many cells from
34
// the left domain boundary.
35
const int numberOfCells = DomainSize[0]/(2*h[0]);
36
37
tarch::la::Vector<DIMENSIONS, double> damBreakCenter = {
38
DomainOffset[0] + (numberOfCells * h[0]),
39
0.0
40
};
41
42
Q[0] = 2.0; // h
43
Q[1] = 0.0; // v_x
44
Q[2] = 0.0; // v_y
45
Q[3] = (tarch::la::norm2(x - damBreakCenter) < 0.2 ? 0.5 : 0.0); // b
46
"""
47
48
def
boundary_conditions
(self):
49
return
"""
50
Qoutside[0] = 2.0; // h
51
Qoutside[1] = 0.0; // v_x
52
Qoutside[2] = 0.0; // v_y
53
Qoutside[3] = 0.0; // b
54
"""
equations.swe.SWE_W_Bathymetry
Definition:
swe.py:6
scenarios.scenario.Scenario
Definition:
scenario.py:6
scenarios.swe_radial_dam_break.SWERadialDamBreak
Classic radial dam break SWE equations, with constant initial water height but a bump in the bathymet...
Definition:
swe_radial_dam_break.py:12
scenarios.swe_radial_dam_break.SWERadialDamBreak.__init__
def __init__(self)
Definition:
swe_radial_dam_break.py:26
scenarios.swe_radial_dam_break.SWERadialDamBreak.initial_conditions
def initial_conditions(self)
Definition:
swe_radial_dam_break.py:29
scenarios.swe_radial_dam_break.SWERadialDamBreak.boundary_conditions
def boundary_conditions(self)
Definition:
swe_radial_dam_break.py:48
tests
exahype2
aderdg
scenarios
swe_radial_dam_break.py
Generated by
1.9.1