Peano
Loading...
Searching...
No Matches
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
3from .scenario import Scenario
4
5import os
6import sys
7
8sys.path.insert(0, os.path.abspath("../equations"))
9from equations import SWE_W_Bathymetry
10
11
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
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
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"""
Classic radial dam break SWE equations, with constant initial water height but a bump in the bathymet...