Changeset 7584 for misc/tools/event_selection/wave_energy/run_up.py
- Timestamp:
- Dec 9, 2009, 8:37:58 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/tools/event_selection/wave_energy/run_up.py
r7554 r7584 1 1 """ This code implements run up solutions to the shallow water wave 2 2 equations. 3 4 References: 5 Madsen and Fuhrman 2008. Run-up of tsunamis and long waves 6 in terms of surf-similarity. Coastal Engineering, 55, p209. 3 7 4 8 Creator: Jonathan Griffin, Geoscience Australia … … 8 12 def Madsen(depth, slope, height, period, gravity = 9.81): 9 13 10 freq = (2* np.pi)/period11 a = (depth* np.power(freq,2.0))/(gravity*np.power(slope,2.0))12 print 'a',a13 b = np.power(a,0.25)14 print 'b',b15 run_up = 2*np.power(np.pi,0.5)*b*height14 freq = (2*pi)/period 15 a = (depth*power(freq,2.0))/(gravity*power(slope,2.0)) 16 #print 'a',a 17 b = power(a,0.25) 18 #print 'b',b 19 run_up_madsen = 2*power(np.pi,0.5)*b*height 16 20 21 R_break = gravity*(power(slope,2.0))/(power(freq,2.0)) 22 run_up = np.min(run_up_madsen, R_break) 17 23 return run_up 18 24 19 def surf_sim(depth, slope, height, wavelength, gravity = 9.81): 25 #def surf_sim(depth, slope, height, wavelength, gravity = 9.81): 26 # Add Madsen's surf similarity here 20 27 21 28 29 30 def energy_conserv(crest_integrated_energy,theta = 3.,alpha = 2.,gravity = 9.81): 31 E = crest_integrated_energy 32 print 'crest_integrated_energy', crest_integrated_energy 33 a = 1/tan(alpha*pi/180.) 34 b = 1/tan(theta*pi/180.) 35 36 F = a-b 37 # print 'F',F 38 R3 = 6.*E/(1000.*gravity*F) 39 # print 'R3', R3 40 R = power(R3,(1./3.)) 41 42 return R 22 43 23 44 import numpy as np 45 from numpy import tan, sin, cos, power,pi 24 46 if __name__ == '__main__': 25 47 sys.exit(main())
Note: See TracChangeset
for help on using the changeset viewer.