1 | """Script for running a tsunami inundation scenario for Wollongong, NSW, Australia. |
---|
2 | |
---|
3 | Source data such as elevation and boundary data is assumed to be available in |
---|
4 | directories specified by project_slide_parameters.py |
---|
5 | The output sww file is stored in project_slide_parameters.outputtimedir |
---|
6 | |
---|
7 | The scenario is defined by a triangular mesh created from project.polygon, |
---|
8 | the elevation data and a tsunami wave generated by s submarine mass failure. |
---|
9 | |
---|
10 | Bridgette Lewis, 2008 |
---|
11 | """ |
---|
12 | |
---|
13 | #------------------------------------------------------------------------------- |
---|
14 | # Import necessary modules |
---|
15 | #------------------------------------------------------------------------------- |
---|
16 | |
---|
17 | # Standard modules |
---|
18 | import os |
---|
19 | import time |
---|
20 | from shutil import copy |
---|
21 | from os.path import dirname, basename |
---|
22 | from os import mkdir, access, F_OK, sep |
---|
23 | import sys |
---|
24 | |
---|
25 | # Related major packages |
---|
26 | from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files |
---|
27 | from anuga.shallow_water import smf |
---|
28 | |
---|
29 | # Application specific imports |
---|
30 | import project_slide_parameters # Definition of file names and polygons |
---|
31 | import project_slide |
---|
32 | |
---|
33 | #------------------------------------------------------------------------------- |
---|
34 | # Set up scenario (tsunami_source is a callable object used with set_quantity) |
---|
35 | #------------------------------------------------------------------------------- |
---|
36 | from smf import slide_tsunami |
---|
37 | |
---|
38 | # effect on a3D and wavelength |
---|
39 | length = project_slide_parameters.birubi_length |
---|
40 | width = project_slide_parameters.birubi_width |
---|
41 | depth = project_slide_parameters.birubi_depth |
---|
42 | slope = project_slide_parameters.birubi_slope |
---|
43 | thickness = project_slide_parameters.birubi_thickness |
---|
44 | alpha = project_slide_parameters.birubi_alpha |
---|
45 | x0 = project_slide_parameters.slide_origin_birubi[0] |
---|
46 | y0 = project_slide_parameters.slide_origin_birubi[1] |
---|
47 | |
---|
48 | gamma = 1.85 |
---|
49 | massco = 1.0 |
---|
50 | dragco = 1.0 |
---|
51 | |
---|
52 | # no effect on a3D and wavelength but used in Double Gaussian |
---|
53 | dx = 0.01 |
---|
54 | kappa = 3. |
---|
55 | kappad = 0.8 |
---|
56 | |
---|
57 | # this doesn't seem to apper anywhere in smf |
---|
58 | frictionco = 0.01 |
---|
59 | |
---|
60 | # scaling for Double Gaussian function |
---|
61 | scale = 30. # Bridgette's fiddle |
---|
62 | |
---|
63 | fid = open('test.csv','w') |
---|
64 | s = 'parameter, wavelength, 3D_amp, eta_min\n' |
---|
65 | fid.write(s) |
---|
66 | |
---|
67 | for i in range(30): |
---|
68 | scale = scale - 1. |
---|
69 | #length = length + 10. |
---|
70 | #depth = depth - 10. |
---|
71 | tsunami_source = slide_tsunami(length=length, |
---|
72 | width=width, |
---|
73 | depth=depth, |
---|
74 | slope=slope, |
---|
75 | thickness=thickness, |
---|
76 | x0=x0, |
---|
77 | y0=y0, |
---|
78 | alpha=alpha, |
---|
79 | gamma=gamma, |
---|
80 | massco=massco, |
---|
81 | dragco=dragco, |
---|
82 | frictionco=frictionco, |
---|
83 | dx=dx, |
---|
84 | kappa=kappa, |
---|
85 | kappad=kappad, |
---|
86 | scale=scale, |
---|
87 | verbose=False) |
---|
88 | |
---|
89 | #parameter = depth |
---|
90 | #parameter = length |
---|
91 | parameter = scale |
---|
92 | |
---|
93 | s = '%.6f, %.6f, %.6f, %.6f \n' %(parameter,tsunami_source.wavelength,tsunami_source.a3D,tsunami_source.nmin) |
---|
94 | fid.write(s) |
---|
95 | |
---|
96 | fid.close() |
---|