Changeset 2418
- Timestamp:
- Feb 16, 2006, 4:26:43 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
development/momentum_sink/CCS.py
r2417 r2418 12 12 13 13 14 swwfile_B = project.outputdir + sep + ' friction_n=10_3135.sww'15 swwfile_F = project.outputdir + sep + 'friction_n=20_3135.sww' 14 swwfile_B = project.outputdir + sep + 'Buildings_3662.sww' 15 16 16 17 17 gauge_depth = Numeric.arrayrange(0, 2.5*WidtH, 5) … … 27 27 quantities = ['stage', 'elevation', 'xmomentum', 'ymomentum'] 28 28 29 30 29 31 f_B = file_function(swwfile_B, 30 32 quantities = quantities, … … 32 34 verbose = True, 33 35 use_cache = True) 36 fric_OK=[] 37 Friction = [1,2,3,5,7,10,20,30,50] 38 for fric in Friction: 39 swwfile_F = project.outputdir + sep + 'friction_n=' + repr(fric) + '_3135.sww' 40 f_F = file_function(swwfile_F, 41 quantities = quantities, 42 interpolation_points = gauge_locations, 43 verbose = True, 44 use_cache = True) 34 45 35 f_F = file_function(swwfile_F, 36 quantities = quantities, 37 interpolation_points = gauge_locations, 38 verbose = True, 39 use_cache = True) 40 41 42 T = Numeric.arrayrange(0,500,20) 43 #T = [ 20, 50, 100, 150, 200 ] 44 45 for t in T: 46 model_time = [] 46 t=500 47 47 48 stages_B = [] 48 49 stages_F = [] … … 64 65 velB = sqrt(uhB*uhB + vhB*vhB) / (wB + 1.e-30) #Absolute velocity 65 66 velF = sqrt(uhF*uhF + vhF*vhF) / (wF + 1.e-30) #Absolute velocity 66 #print velB, "buiding velocity"67 #print velF, "friction velocity"68 67 69 68 stages_B.append(wB) 70 69 stages_F.append(wF) 71 #elevations.append(zB) #Should be constant over time72 #momenta.append(mB)73 #velocityB.append(velB)74 #velocityF.append(velF)75 70 76 #print len(stages), "stages" 71 72 77 73 diff = abs(Numeric.array(stages_B) - Numeric.array(stages_F)) 78 #print diff, "difference" 74 75 if max(diff) < 1.2: 76 print "_-_-_-_-_-_-_-_-_-_-_-_" 77 print fric, " this file is OK" 78 print "-_-_-_-_-_-_-_-_-_-_-_-" 79 fric_OK.append(fric) 80 #print swwfile_F, "this file OK" 81 else: 82 print fric, " this file is definelty NOT OK" 83 print fric_OK, "THESE FRICTION VALUES ARE OK" 84 85 79 86 80 87 81 ion()82 hold(True)83 subplot(211)84 85 plot(gauge_depth, stages_B, '-b',gauge_depth,stages_F,'-r')86 title('Time_%d_ vs water depth (n=%f, BP=%f)' %(t, fric, porosity))87 xlabel('gauge length(m)')88 ylabel('water depths (m)')89 #savefig('Comp_Time%d_B_vs_F' %t)90 hold(False)91 #savefig('Final_comp_n=%s' %fric)92 subplot(212)93 subplots_adjust(hspace = 0.4)94 plot(gauge_depth, diff, 'g')95 title('Final Differences in water levels')96 xlabel('gauge length(m)')97 ylabel('water differences (m)')98 savefig('Final_Water_diff_n=%s' %fric)99 print "finished"100 101
Note: See TracChangeset
for help on using the changeset viewer.