Changeset 2466
- Timestamp:
- Mar 2, 2006, 3:51:08 PM (19 years ago)
- Location:
- development/momentum_sink
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
development/momentum_sink/CCS.py
r2458 r2466 15 15 from numerical_tools import norm, corr, err 16 16 17 B_list=['buildings_Str_D=3_1714.sww', 18 'buildings_Str_D=5_1578.sww', 19 'buildings_Str_D=7_1067.sww', 20 'buildings_Str_D=9_1052.sww', 21 'buildings_Str_D=11_694.sww', 22 'buildings_Str_D=13_693.sww', 23 'buildings_Str_D=15_717.sww', 24 'buildings_Str_D=17_749.sww', 25 'buildings_Str_D=19_1008.sww', 26 'buildings_Str_D=21_1581.sww', 27 'buildings_Str_D=23_1798.sww'] 17 B_list=['buildings_Orth(45)_D=3_1566.sww', 18 'buildings_Orth(45)_D=5_1247.sww', 19 'buildings_Orth(45)_D=7_1270.sww', 20 'buildings_Orth(45)_D=9_804.sww', 21 'buildings_Orth(45)_D=11_844.sww', 22 'buildings_Orth(45)_D=13_918.sww', 23 'buildings_Orth(45)_D=15_1250.sww', 24 'buildings_Orth(45)_D=17_1735.sww'] 28 25 29 26 30 fd = open(" Straight_log_report.csv", 'w')31 fd.write( ' Straight_log_report. Summary at bottom.' + '\n' )27 fd = open("buildings_Orth(45)_report.csv", 'w') 28 fd.write( 'buildings_Orth(45)_report. Summary at bottom.' + '\n' ) 32 29 33 30 … … 59 56 60 57 #Read model output 61 quantities = ['stage', ' elevation', 'xmomentum', 'ymomentum']58 quantities = ['stage', 'xmomentum', 'ymomentum'] 62 59 63 60 f_B = file_function(swwfile_B, … … 70 67 least_norm=[100] 71 68 Normal=[] 72 #Friction = Numeric.arrayrange(1,120,1) 73 Friction = [0.025, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000] 69 Friction_large = list(Numeric.arange(1,120,1)) 70 Friction = list(Numeric.arange(0.025,1,0.025)) 71 #Friction_log = [0.025, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000] 72 Friction.extend(Friction_large) 74 73 for fric in Friction: 75 74 swwfile_F = project.outputdir + sep + 'friction_n=' + str(fric) + '_3135.sww' … … 84 83 stages_B = [] 85 84 stages_F = [] 85 vel_B=[] 86 vel_F=[] 86 87 for i, GL in enumerate(gauge_depth): 87 88 89 k = len(gauge_depth) # point of velocity comparision 88 90 # mines data from specified time values in sww file 89 91 # Building file 90 92 wB = f_B(t, point_id = i)[0] 91 zB = f_B(t, point_id = i)[1] 92 uhB = f_B(t, point_id = i)[2] 93 vhB = f_B(t, point_id = i)[3] 93 uhB = f_B(t, point_id = i)[1] 94 vhB = f_B(t, point_id = i)[2] 94 95 # Friction file 95 96 wF = f_F(t, point_id = i)[0] 96 uhF = f_B(t, point_id = i)[ 2]97 vhF = f_B(t, point_id = i)[ 3]97 uhF = f_B(t, point_id = i)[1] 98 vhF = f_B(t, point_id = i)[2] 98 99 99 100 #m = sqrt(uh*uh + vh*vh) #Absolute momentum … … 102 103 stages_B.append(wB) 103 104 stages_F.append(wF) 104 105 105 106 107 vel_B.append(velB) 108 vel_F.append(velF) 106 109 Ar_B = Numeric.array(stages_B) 107 110 Ar_F = Numeric.array(stages_F) … … 115 118 least_norm = norm_F 116 119 fric_OK = fric 120 117 121 else: 118 122 print fric, " NOT OK" 123 119 124 120 125 print fric_OK, " <- This Manning's n is best fit from 2nd norm test" … … 125 130 Breadth.append(bre) 126 131 127 print len(Friction), "friction"128 print len(Normal), "normal"132 print vel_F, "friction" 133 print vel_B, "Buildings" 129 134 fd.write('_______________________________________________________' + '\n' ) 130 135 fd.write( '<<<< Mannings n for [' + B_file + '] >>>>' + '\n' ) … … 140 145 len_file=Numeric.arrayrange(0,len(B_list),1) 141 146 fd.write('_______________________________________________________' + '\n' ) 142 fd.write( '<<<<< Straight_log_report Summary >>>>>' + '\n' )147 fd.write( '<<<<< buildings_Orth(45)_report Summary >>>>>' + '\n' ) 143 148 fd.write( 'width, footprint ratio, mannings n, 2nd norm ' + '\n') 144 149 for i in len_file: -
development/momentum_sink/loop_friction.py
r2458 r2466 24 24 from pmesh.mesh import importMeshFromFile 25 25 26 #Friction = Numeric.arrayrange(0.025,1,0.025)27 Friction = [150,200,500,1000,2000,5000,10000] 26 Friction = Numeric.arrayrange(0.025,1,0.025) 27 #Friction = Numeric.arrayrange(1,120,1) 28 28 for fric in Friction: 29 29 meshname = project_friction.meshname -
development/momentum_sink/run_buildings.py
r2458 r2466 55 55 domain.set_datadir(project.outputdir) 56 56 domain.store = True 57 domain.quantities_to_be_stored = ['stage' ]57 domain.quantities_to_be_stored = ['stage', 'xmomentum', 'ymomentum'] 58 58 59 59 print 'Number of triangles = ', len(domain)
Note: See TracChangeset
for help on using the changeset viewer.