source: anuga_work/production/sydney_2006/smf_approx.py @ 4993

Last change on this file since 4993 was 4853, checked in by sexton, 17 years ago

reflecting updated function in other files

File size: 7.2 KB
Line 
1"""Script for running a tsunami inundation scenario for Sydney, NSW, Australia.
2
3Source data such as elevation and boundary data is assumed to be available in
4directories specified by project.py
5The output sww file is stored in project.outputdir
6
7The scenario is defined by a triangular mesh created from project.polygon,
8the elevation data and a simulated submarine landslide.
9
10Ole 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
17import os
18import time
19
20from pylab import *
21ion()
22hold(True)
23
24# Application specific imports
25import project                 # Definition of file names and polygons
26
27def stats_slide(depth,length,width,thickness,slope,gamma):
28    from math import sin, tan, radians, pi, sqrt, exp
29
30    gravity = 9.8
31    massco = 1.0
32    dragco = 1.0
33    psi = 0.0
34    sint = sin(radians(slope))
35    tant = tan(radians(slope))
36    tanp = tan(radians(psi)) 
37   
38    a0 = gravity * sint * ((gamma-1)/(gamma+massco)) * (1-(tanp/tant))
39    ut = sqrt((gravity*depth) * (length*sint/depth) \
40                    * (pi*(gamma-1)/(2*dragco)) * (1-(tanp/tant)))
41    s0 = ut**2 / a0
42    t0 = ut / a0
43
44    #calculate some parameters of the water displacement produced by the slide
45
46    w = t0 * sqrt(gravity*depth)
47    a2D = s0 * (0.0574 - (0.0431*sint)) \
48             * thickness/length \
49             * ((length*sint/depth)**1.25) \
50             * (1 - exp(-2.2*(gamma-1)))
51    a3D = a2D / (1 + (15.5*sqrt(depth/(length*sint))))
52   
53    #scaled_amp = a3D/a2D
54   
55    return a3D, w
56
57def stats_slump(depth,length,width,thickness,slope,gamma):
58    from math import sin, radians, sqrt
59
60    radius = length**2 / (8.0 * thickness)   
61    massco = 1.0
62    dphi = 0.48
63    gravity = 9.8
64    sint = sin(radians(slope))
65
66    s0 = radius * dphi / 2
67    t0 = sqrt((radius*(gamma+massco)) / (gravity*(gamma-1)))
68    a0 = s0 / t0**2
69    um = s0 / t0
70
71    #calculate some parameters of the water displacement produced by the slump
72
73    w = t0 * sqrt(gravity*depth)
74    a2D = s0 * (0.131/sint) \
75             * thickness/length \
76             * (length*sint/depth)**1.25 \
77             * (length/radius)**0.63 * dphi**0.39 \
78             * (1.47 - (0.35*(gamma-1))) * (gamma-1)
79    a3D = a2D / (1. + (2.06*sqrt(depth/length)))
80
81    #scaled_amp = a3D/a2D
82   
83    return a3D, w
84
85which_one = 'slide'
86#which_one = 'slump'
87#par = 'depth'
88#par = 'density'
89par = 'depth'
90
91depths = range(750,2500,50)
92allgammas = arange(1.45,1.85,.05)
93all_lengths=[7000,17000,1000]
94all_slopes = arange(2,10,.2)
95lengths = [16840,13500,4189,9903]
96widths = [8860,4350,2898,4150]
97thicknesses = [424,165,53,140]
98slopes = [4,4,2.3,3.7]
99gammas = [1.46,1.49,1.48,1.48]
100smftype = ['Bulli','Shovel','Yacaaba','Birubi']
101#smfdepths = [2087,968,1119]
102smfdepths = [1470,877,1320,938]
103
104if 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    axis([750,2500,-0.5,6])
150    savefig('depth_vs_amp_data%s'%which_one)
151    figure(2)
152    plot(smfdepths,wdata,'^')
153    savefig('depth_vs_wavelength_data%s'%which_one)
154
155if par == 'density':
156   
157    for i in range(len(lengths)):
158        amp = []
159        wavelength = []
160        for gamma in allgammas:
161           
162            if which_one == 'slide':
163                a, w = stats_slide(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gamma)
164            else:
165                a, w = stats_slump(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gamma)
166
167            amp.append(a)
168            wavelength.append(w/1000.)
169
170        figure(1)
171        plot(allgammas,amp)
172        xlabel('Density (g/cm3)')
173        ylabel('amplitude (m)')
174
175        figure(2)
176        plot(allgammas,wavelength)
177        xlabel('Density (g/cm3)')
178        ylabel('wavelength (km)')
179
180    figure(1)
181    legend(smftype)
182    savefig('density_vs_amp')
183    figure(2)
184    legend(smftype)
185    savefig('density_vs_wavelength')
186
187    adata = []
188    wdata = []
189    for i in range(len(gammas)):
190        if which_one == 'slide':
191            a, w = stats_slide(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i])
192        else:
193            a, w = stats_slump(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i])
194        adata.append(a)
195        wdata.append(w/1000.)
196
197    figure(1)
198    plot(gammas,adata,'^')
199    savefig('density_vs_amp_data%s'%which_one)
200    figure(2)
201    plot(gammas,wdata,'^')
202    savefig('density_vs wavelength_data%s'%which_one)
203
204if par == 'slope':
205   
206    for i in range(len(lengths)):
207        amp = []
208        wavelength = []
209        for slope in all_slopes:
210           
211            if which_one == 'slide':
212                a, w = stats_slide(smfdepths[i],lengths[i],widths[i],thicknesses[i],slope,gammas[i])
213            else:
214                a, w = stats_slump(smfdepths[i],lengths[i],widths[i],thicknesses[i],slope,gammas[i])
215
216            amp.append(a)
217            wavelength.append(w/1000.)
218
219        figure(1)
220        plot(all_slopes,amp)
221        xlabel('Slope (deg)')
222        ylabel('amplitude (m)')
223
224        figure(2)
225        plot(all_slopes,wavelength)
226        xlabel('Slope (deg)')
227        ylabel('wavelength (km)')
228
229    figure(1)
230    legend(smftype)
231    savefig('slope_vs_amp')
232    figure(2)
233    legend(smftype)
234    savefig('slope_vs_wavelength')
235
236    adata = []
237    wdata = []
238    for i in range(len(lengths)):
239        if which_one == 'slide':
240            a, w = stats_slide(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i])
241        else:
242            a, w = stats_slump(smfdepths[i],lengths[i],widths[i],thicknesses[i],slopes[i],gammas[i])
243        adata.append(a)
244        wdata.append(w/1000.)
245
246    figure(1)
247    plot(slopes,adata,'^')
248    savefig('slope_vs_amp_data%s'%which_one)
249    figure(2)
250    plot(slopes,wdata,'^')
251    savefig('slope_vs_wavelength_data%s'%which_one)
252
253
254close('all')
Note: See TracBrowser for help on using the repository browser.