1 | """Script for running a tsunami inundation scenario for Sydney, NSW, Australia. |
---|
2 | |
---|
3 | Source data such as elevation and boundary data is assumed to be available in |
---|
4 | directories specified by project.py |
---|
5 | The output sww file is stored in project.outputdir |
---|
6 | |
---|
7 | The scenario is defined by a triangular mesh created from project.polygon, |
---|
8 | the elevation data and a simulated submarine landslide. |
---|
9 | |
---|
10 | Ole Nielsen and Duncan Gray, GA - 2005 and Adrian Hitchman and Jane Sexton, GA - 2006 |
---|
11 | """ |
---|
12 | |
---|
13 | #-------------------------------------------------------------------------------# Import necessary modules |
---|
14 | #------------------------------------------------------------------------------- |
---|
15 | |
---|
16 | # Standard modules |
---|
17 | import os |
---|
18 | import time |
---|
19 | |
---|
20 | from pylab import * |
---|
21 | ion() |
---|
22 | hold(True) |
---|
23 | |
---|
24 | # Application specific imports |
---|
25 | import project # Definition of file names and polygons |
---|
26 | from anuga.shallow_water.smf import slide_tsunami, slump_tsunami # Function for submarine mudslide |
---|
27 | |
---|
28 | def stats_slide(depth,length,width,thickness,slope,gamma): |
---|
29 | from math import sin, tan, radians, pi, sqrt, exp |
---|
30 | |
---|
31 | gravity = 9.8 |
---|
32 | massco = 1.0 |
---|
33 | dragco = 1.0 |
---|
34 | psi = 0.0 |
---|
35 | sint = sin(radians(slope)) |
---|
36 | tant = tan(radians(slope)) |
---|
37 | tanp = tan(radians(psi)) |
---|
38 | |
---|
39 | a0 = gravity * sint * ((gamma-1)/(gamma+massco)) * (1-(tanp/tant)) |
---|
40 | ut = sqrt((gravity*depth) * (length*sint/depth) \ |
---|
41 | * (pi*(gamma-1)/(2*dragco)) * (1-(tanp/tant))) |
---|
42 | s0 = ut**2 / a0 |
---|
43 | t0 = ut / a0 |
---|
44 | |
---|
45 | #calculate some parameters of the water displacement produced by the slide |
---|
46 | |
---|
47 | w = t0 * sqrt(gravity*depth) |
---|
48 | a2D = s0 * (0.0574 - (0.0431*sint)) \ |
---|
49 | * thickness/length \ |
---|
50 | * ((length*sint/depth)**1.25) \ |
---|
51 | * (1 - exp(-2.2*(gamma-1))) |
---|
52 | a3D = a2D / (1 + (15.5*sqrt(depth/(length*sint)))) |
---|
53 | |
---|
54 | #scaled_amp = a3D/a2D |
---|
55 | |
---|
56 | return a3D, w |
---|
57 | |
---|
58 | def stats_slump(depth,length,width,thickness,slope,gamma): |
---|
59 | from math import sin, radians, sqrt |
---|
60 | |
---|
61 | radius = length**2 / (8.0 * thickness) |
---|
62 | massco = 1.0 |
---|
63 | dphi = 0.48 |
---|
64 | gravity = 9.8 |
---|
65 | sint = sin(radians(slope)) |
---|
66 | |
---|
67 | s0 = radius * dphi / 2 |
---|
68 | t0 = sqrt((radius*(gamma+massco)) / (gravity*(gamma-1))) |
---|
69 | a0 = s0 / t0**2 |
---|
70 | um = s0 / t0 |
---|
71 | |
---|
72 | #calculate some parameters of the water displacement produced by the slump |
---|
73 | |
---|
74 | w = t0 * sqrt(gravity*depth) |
---|
75 | a2D = s0 * (0.131/sint) \ |
---|
76 | * thickness/length \ |
---|
77 | * (length*sint/depth)**1.25 \ |
---|
78 | * (length/radius)**0.63 * dphi**0.39 \ |
---|
79 | * (1.47 - (0.35*(gamma-1))) * (gamma-1) |
---|
80 | a3D = a2D / (1. + (2.06*sqrt(depth/length))) |
---|
81 | |
---|
82 | #scaled_amp = a3D/a2D |
---|
83 | |
---|
84 | return a3D, w |
---|
85 | |
---|
86 | which_one = 'slide' |
---|
87 | #which_one = 'slump' |
---|
88 | #par = 'depth' |
---|
89 | #par = 'density' |
---|
90 | par = 'slope' |
---|
91 | |
---|
92 | depths = range(750,2500,50) |
---|
93 | allgammas = arange(1.45,1.85,.05) |
---|
94 | all_lengths=[7000,17000,1000] |
---|
95 | all_slopes = arange(2,10,.2) |
---|
96 | lengths = [16840,13500,7050] |
---|
97 | widths = [8860,4350,3080] |
---|
98 | thicknesses = [424,165,144] |
---|
99 | slopes = [4,4,3] |
---|
100 | gammas = [1.46,1.49,1.48] |
---|
101 | smftype = ['Bulli','Shovel','Yacaaba'] |
---|
102 | smfdepths = [2087,968,1119] |
---|
103 | |
---|
104 | if par == 'depth': |
---|
105 | |
---|
106 | for i in range(len(lengths)): |
---|
107 | amp = [] |
---|
108 | wavelength = [] |
---|
109 | for depth in depths: |
---|
110 | |
---|
111 | if which_one == 'slide': |
---|
112 | a, w = stats_slide(depth,lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i]) |
---|
113 | else: |
---|
114 | a, w = stats_slump(depth,lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i]) |
---|
115 | |
---|
116 | amp.append(a) |
---|
117 | wavelength.append(w/1000.) |
---|
118 | |
---|
119 | figure(1) |
---|
120 | plot(depths,amp) |
---|
121 | xlabel('Depth (m)') |
---|
122 | ylabel('amplitude (m)') |
---|
123 | |
---|
124 | figure(2) |
---|
125 | plot(depths,wavelength) |
---|
126 | xlabel('Depth (m)') |
---|
127 | ylabel('wavelength (km)') |
---|
128 | |
---|
129 | figure(1) |
---|
130 | legend(smftype) |
---|
131 | savefig('depth_vs_amp') |
---|
132 | |
---|
133 | figure(2) |
---|
134 | legend(smftype) |
---|
135 | savefig('depth_vs_wavelength') |
---|
136 | |
---|
137 | adata = [] |
---|
138 | wdata = [] |
---|
139 | for i in range(len(smfdepths)): |
---|
140 | if which_one == 'slide': |
---|
141 | a, w = stats_slide(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i]) |
---|
142 | else: |
---|
143 | a, w = stats_slump(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i]) |
---|
144 | adata.append(a) |
---|
145 | wdata.append(w/1000.) |
---|
146 | |
---|
147 | figure(1) |
---|
148 | plot(smfdepths,adata,'^') |
---|
149 | savefig('depth_vs_amp_data%s'%which_one) |
---|
150 | figure(2) |
---|
151 | plot(smfdepths,wdata,'^') |
---|
152 | savefig('depth_vs_wavelength_data%s'%which_one) |
---|
153 | |
---|
154 | if par == 'density': |
---|
155 | |
---|
156 | for i in range(len(lengths)): |
---|
157 | amp = [] |
---|
158 | wavelength = [] |
---|
159 | for gamma in allgammas: |
---|
160 | |
---|
161 | if which_one == 'slide': |
---|
162 | a, w = stats_slide(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gamma) |
---|
163 | else: |
---|
164 | a, w = stats_slump(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gamma) |
---|
165 | |
---|
166 | amp.append(a) |
---|
167 | wavelength.append(w/1000.) |
---|
168 | |
---|
169 | figure(1) |
---|
170 | plot(allgammas,amp) |
---|
171 | xlabel('Density (g/cm3)') |
---|
172 | ylabel('amplitude (m)') |
---|
173 | |
---|
174 | figure(2) |
---|
175 | plot(allgammas,wavelength) |
---|
176 | xlabel('Density (g/cm3)') |
---|
177 | ylabel('wavelength (km)') |
---|
178 | |
---|
179 | figure(1) |
---|
180 | legend(smftype) |
---|
181 | savefig('density_vs_amp') |
---|
182 | figure(2) |
---|
183 | legend(smftype) |
---|
184 | savefig('density_vs_wavelength') |
---|
185 | |
---|
186 | adata = [] |
---|
187 | wdata = [] |
---|
188 | for i in range(len(gammas)): |
---|
189 | if which_one == 'slide': |
---|
190 | a, w = stats_slide(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i]) |
---|
191 | else: |
---|
192 | a, w = stats_slump(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i]) |
---|
193 | adata.append(a) |
---|
194 | wdata.append(w/1000.) |
---|
195 | |
---|
196 | figure(1) |
---|
197 | plot(gammas,adata,'^') |
---|
198 | savefig('density_vs_amp_data%s'%which_one) |
---|
199 | figure(2) |
---|
200 | plot(gammas,wdata,'^') |
---|
201 | savefig('density_vs wavelength_data%s'%which_one) |
---|
202 | |
---|
203 | if par == 'slope': |
---|
204 | |
---|
205 | for i in range(len(lengths)): |
---|
206 | amp = [] |
---|
207 | wavelength = [] |
---|
208 | for slope in all_slopes: |
---|
209 | |
---|
210 | if which_one == 'slide': |
---|
211 | a, w = stats_slide(smfdepths[i],lengths[i],widths[i],thicknesses[i],slope,gammas[i]) |
---|
212 | else: |
---|
213 | a, w = stats_slump(smfdepths[i],lengths[i],widths[i],thicknesses[i],slope,gammas[i]) |
---|
214 | |
---|
215 | amp.append(a) |
---|
216 | wavelength.append(w/1000.) |
---|
217 | |
---|
218 | figure(1) |
---|
219 | plot(all_slopes,amp) |
---|
220 | xlabel('Slope (deg)') |
---|
221 | ylabel('amplitude (m)') |
---|
222 | |
---|
223 | figure(2) |
---|
224 | plot(all_slopes,wavelength) |
---|
225 | xlabel('Slope (deg)') |
---|
226 | ylabel('wavelength (km)') |
---|
227 | |
---|
228 | figure(1) |
---|
229 | legend(smftype) |
---|
230 | savefig('slope_vs_amp') |
---|
231 | figure(2) |
---|
232 | legend(smftype) |
---|
233 | savefig('slope_vs_wavelength') |
---|
234 | |
---|
235 | adata = [] |
---|
236 | wdata = [] |
---|
237 | for i in range(len(lengths)): |
---|
238 | if which_one == 'slide': |
---|
239 | a, w = stats_slide(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i]) |
---|
240 | else: |
---|
241 | a, w = stats_slump(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i]) |
---|
242 | adata.append(a) |
---|
243 | wdata.append(w/1000.) |
---|
244 | |
---|
245 | figure(1) |
---|
246 | plot(slopes,adata,'^') |
---|
247 | savefig('slope_vs_amp_data%s'%which_one) |
---|
248 | figure(2) |
---|
249 | plot(slopes,wdata,'^') |
---|
250 | savefig('slope_vs_wavelength_data%s'%which_one) |
---|
251 | |
---|
252 | |
---|
253 | close('all') |
---|
254 | |
---|
255 | ##import sys; sys.exit() |
---|
256 | ##tsunami_source = slide_tsunami(length=16840.0, |
---|
257 | ## width=8860.0, |
---|
258 | ## depth=2087.0, |
---|
259 | ## slope=4.0, |
---|
260 | ## thickness=424.0, |
---|
261 | ## gamma=1.46, |
---|
262 | ## #dphi=0.23, |
---|
263 | ## x0=project.slump_origin2[0], |
---|
264 | ## y0=project.slump_origin2[1], |
---|
265 | ## #alpha=0.0, |
---|
266 | ## #domain=domain, |
---|
267 | ## verbose=True) |
---|
268 | ## tsunami_source = slump_tsunami(length=16840.0, |
---|
269 | ## width=8860.0, |
---|
270 | ## #depth=2087.0, |
---|
271 | ## slope=4.0, |
---|
272 | ## thickness=424.0, |
---|
273 | ## gamma=1.45, |
---|
274 | ## #dphi=0.23, |
---|
275 | ## #radius = 3330, |
---|
276 | ## x0=project.slump_origin2[0], |
---|
277 | ## y0=project.slump_origin2[1], |
---|
278 | ## #alpha=0.0, |
---|
279 | ## #domain=domain, |
---|
280 | ## verbose=True) |
---|