Changeset 2417
- Timestamp:
- Feb 16, 2006, 3:41:21 PM (19 years ago)
- Location:
- development/momentum_sink
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
development/momentum_sink/PCS.py
r2415 r2417 7 7 import project 8 8 from pyvolution.util import file_function 9 #from pyvolution.coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn 10 # from coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn9 from create_buildings import porosity, WidtH 10 # from run_friction import fric 11 11 from pylab import * 12 #from compare_sww import gauge_locations13 12 14 13 fric = 1 15 14 #swwfile = project.newoutputname + '.sww' 16 15 #swwfile = project.outputname 17 swwfile_B = project.outputdir + sep + 'Buildings_3790.sww'18 swwfile_F = project.outputdir + sep + 'Buildings_3662.sww'19 #swwfile_F = project.outputdir + sep + 'friction_3135.sww'20 16 21 gauge_depth = Numeric.arrayrange(0, 700, 10) 17 #swwfile_B = project.outputdir + sep + 'Buildings_3790.sww' 18 #swwfile_B = project.outputdir + sep + 'Buildings_3662.sww' 19 swwfile_B = project.outputdir + sep + 'friction_n=10_3135.sww' 20 swwfile_F = project.outputdir + sep + 'friction_n=20_3135.sww' 21 22 gauge_depth = Numeric.arrayrange(0, 2.5*WidtH, 5) 22 23 gauge_breadth = 100 23 24 gauge_locations = [] … … 55 56 velocity = [] 56 57 for i, GL in enumerate(gauge_depth): 58 59 # mines data from specified time values in sww file 57 60 wB = f_B(t, point_id = i)[0] 58 61 zB = f_B(t, point_id = i)[1] … … 82 85 83 86 ion() 84 hold(False) 87 hold(True) 88 subplot(211) 89 85 90 plot(gauge_depth, stages_B, '-b',gauge_depth,stages_F,'-r') 86 title('Time_%d_ vs water depth ' %t)91 title('Time_%d_ vs water depth (n=%f, BP=%f)' %(t, fric, porosity)) 87 92 xlabel('gauge length(m)') 88 93 ylabel('water depths (m)') 89 savefig('Comp_Time%d_B_vs_F' %t) 90 #plot(gauge_depth, diff, 'g') 91 #title('differences') 92 # raw_input('Next') 94 #savefig('Comp_Time%d_B_vs_F' %t) 95 hold(False) 96 #savefig('Final_comp_n=%s' %fric) 97 subplot(212) 98 subplots_adjust(hspace = 0.4) 99 plot(gauge_depth, diff, 'g') 100 title('Final Differences in water levels') 101 xlabel('gauge length(m)') 102 ylabel('water differences (m)') 103 savefig('Final_Water_diff_n=%s' %fric) 93 104 print "finished" 94 105 -
development/momentum_sink/create_buildings.py
r2415 r2417 7 7 8 8 9 WidtH = 200 # width of boudary in metres 10 depth = 20 # depth of building side to oncoming wave 11 breadth = 20 # breadth of building 12 print "building footprint" 13 print depth * breadth , "m^2" 14 block = 625 15 BL = block**0.5 16 17 porosity = breadth/BL 18 print porosity, " Building porosity" 9 19 10 20 def create_mesh(maximum_triangle_area, … … 18 28 m = Mesh() 19 29 # Boundary of problem 20 WidtH = 200 # width of boudary in metres30 21 31 #W = WidtH/8 22 32 #L = W … … 26 36 27 37 # inner polygons => building boundaries 28 depth = 4 # depth of building side to oncoming wave38 29 39 wh = depth/2 30 breadth = 4 # breadth of building40 31 41 lh = breadth/2 32 42 33 print "building footprint"34 print depth * breadth , "m^2"35 block = 62536 BL = block**0.537 43 ForDep = (0.2*WidtH) + (BL/2) 38 44 RearDep = 1.2*WidtH 39 porosity = breadth/BL40 print porosity, " Building porosity"41 45 42 46 Breadths = Numeric.arrayrange( (BL/2), WidtH, (BL)) -
development/momentum_sink/project_friction.py
r2379 r2417 12 12 13 13 scenario_dir_name = 'momentum_sink_2005' 14 basename = 'friction '14 basename = 'friction_n=' 15 15 16 16 if sys.platform == 'win32': -
development/momentum_sink/run_friction.py
r2415 r2417 4 4 # #name does not have the extension 5 5 6 7 # set friction value for zone 8 fric=10 9 10 # fwojhrt 6 11 import time 7 12 … … 60 65 domain.set_quantity('friction', 0.01) 61 66 domain.set_quantity('stage', 0) 62 domain.set_region(Set_region('mound', 'friction', 10)) #, location='unique vertices'))67 domain.set_region(Set_region('mound', 'friction', fric)) #, location='unique vertices')) 63 68 #Setup Boundary Conditions 64 69 print domain.get_boundary_tags()
Note: See TracChangeset
for help on using the changeset viewer.