Changeset 7074
- Timestamp:
- May 25, 2009, 3:02:58 PM (15 years ago)
- Location:
- anuga_core/source/anuga/culvert_flows
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/culvert_flows/culvert_routines.py
r7073 r7074 82 82 from anuga.config import velocity_protection 83 83 from anuga.utilities.numerical_tools import safe_acos as acos 84 print "STARTING..BOYD................." 84 85 85 local_debug ='false' 86 86 if inlet_depth > 0.1: #this value was 0.01: -
anuga_core/source/anuga/culvert_flows/test_culvert_routines_box_10pct.py
r7073 r7074 69 69 sum_loss) 70 70 71 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST01 Q-v-d',Q,v,d))72 print('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.5526, 1.146, 0.1339))71 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST01 Q-v-d',Q,v,d)) 72 #print('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.5526, 1.146, 0.1339)) 73 73 assert num.allclose(Q, 0.5526, rtol=1.0e-1) #inflow 74 74 assert num.allclose(v, 1.146, rtol=1.0e-1) #outflow velocity … … 119 119 sum_loss) 120 120 121 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST02 Q-v-d',Q,v,d))122 print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 2.508, 1.897, 0.367))121 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST02 Q-v-d',Q,v,d)) 122 #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 2.508, 1.897, 0.367)) 123 123 assert num.allclose(Q, 2.508, rtol=1.0e-1) #inflow 124 124 assert num.allclose(v, 1.897, rtol=1.0e-1) #outflow velocity … … 168 168 manning, 169 169 sum_loss) 170 print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy))171 print ('%s,%.2f'%('Delta E = ',delta_total_energy))172 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST03 Q-v-d',Q,v,d))173 print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 13.554, 3.329, 1.131))170 #print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy)) 171 #print ('%s,%.2f'%('Delta E = ',delta_total_energy)) 172 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST03 Q-v-d',Q,v,d)) 173 #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 13.554, 3.329, 1.131)) 174 174 assert num.allclose(Q, 13.554, rtol=1.0e-2) #inflow 175 175 assert num.allclose(v, 3.329, rtol=1.0e-2) #outflow velocity … … 221 221 manning, 222 222 sum_loss) 223 print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy))224 print ('%s,%.2f'%('Delta E = ',delta_total_energy))225 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST04 Q-v-d',Q,v,d))226 print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 6.609, 2.621, 0.70))223 #print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy)) 224 #print ('%s,%.2f'%('Delta E = ',delta_total_energy)) 225 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST04 Q-v-d',Q,v,d)) 226 #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 6.609, 2.621, 0.70)) 227 227 assert num.allclose(Q, 6.609, rtol=1.0e-2) #inflow 228 228 assert num.allclose(v, 2.621, rtol=1.0e-2) #outflow velocity … … 273 273 manning, 274 274 sum_loss) 275 print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy))276 print ('%s,%.3f'%('Delta E = ',delta_total_energy))277 278 print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST05 Q-v-d',Q,v,d))279 print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',2.961, 0.685, 1.20))275 #print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy)) 276 #print ('%s,%.3f'%('Delta E = ',delta_total_energy)) 277 278 #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST05 Q-v-d',Q,v,d)) 279 #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',2.961, 0.685, 1.20)) 280 280 assert num.allclose(Q, 2.961, rtol=1.0e-2) #inflow 281 281 assert num.allclose(v, 0.685, rtol=1.0e-2) #outflow velocity … … 326 326 manning, 327 327 sum_loss) 328 print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy))329 print ('%s,%.3f'%('Delta E = ',delta_total_energy))330 331 print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST06 Q-v-d',Q,v,d))332 print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',15.537, 3.597, 1.20))328 #print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy)) 329 #print ('%s,%.3f'%('Delta E = ',delta_total_energy)) 330 331 #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST06 Q-v-d',Q,v,d)) 332 #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',15.537, 3.597, 1.20)) 333 333 assert num.allclose(Q, 15.537, rtol=1.0e-2) #inflow 334 334 assert num.allclose(v, 3.597, rtol=1.0e-2) #outflow velocity -
anuga_core/source/anuga/culvert_flows/test_culvert_routines_box_1pct.py
r7073 r7074 69 69 sum_loss) 70 70 71 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST01 Q-v-d',Q,v,d))72 print('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.5526, 1.146, 0.1339))71 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST01 Q-v-d',Q,v,d)) 72 #print('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.5526, 1.146, 0.1339)) 73 73 assert num.allclose(Q, 0.5526, rtol=1.0e-1) #inflow 74 74 assert num.allclose(v, 1.146, rtol=1.0e-1) #outflow velocity … … 119 119 sum_loss) 120 120 121 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST02 Q-v-d',Q,v,d))122 print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.224, 0.152, 0.409))121 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST02 Q-v-d',Q,v,d)) 122 #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.224, 0.152, 0.409)) 123 123 assert num.allclose(Q, 0.224, rtol=1.0e-1) #inflow 124 124 assert num.allclose(v, 0.152, rtol=1.0e-1) #outflow velocity … … 168 168 manning, 169 169 sum_loss) 170 print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy))171 print ('%s,%.2f'%('Delta E = ',delta_total_energy))172 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST03 Q-v-d',Q,v,d))173 print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 13.554, 3.329, 1.131))170 #print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy)) 171 #print ('%s,%.2f'%('Delta E = ',delta_total_energy)) 172 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST03 Q-v-d',Q,v,d)) 173 #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 13.554, 3.329, 1.131)) 174 174 assert num.allclose(Q, 13.554, rtol=1.0e-2) #inflow 175 175 assert num.allclose(v, 3.329, rtol=1.0e-2) #outflow velocity … … 221 221 manning, 222 222 sum_loss) 223 print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy))224 print ('%s,%.2f'%('Delta E = ',delta_total_energy))225 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST04 Q-v-d',Q,v,d))226 print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 5.164, 2.047, 0.70))223 #print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy)) 224 #print ('%s,%.2f'%('Delta E = ',delta_total_energy)) 225 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST04 Q-v-d',Q,v,d)) 226 #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 5.164, 2.047, 0.70)) 227 227 assert num.allclose(Q, 5.164, rtol=1.0e-2) #inflow 228 228 assert num.allclose(v, 2.047, rtol=1.0e-2) #outflow velocity … … 273 273 manning, 274 274 sum_loss) 275 print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy))276 print ('%s,%.3f'%('Delta E = ',delta_total_energy))277 278 print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST05Q-v-d',Q,v,d))279 print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',8.808, 2.039, 1.20))275 #print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy)) 276 #print ('%s,%.3f'%('Delta E = ',delta_total_energy)) 277 278 #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST05Q-v-d',Q,v,d)) 279 #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',8.808, 2.039, 1.20)) 280 280 assert num.allclose(Q, 8.808, rtol=1.0e-2) #inflow 281 281 assert num.allclose(v, 2.039, rtol=1.0e-2) #outflow velocity … … 327 327 manning, 328 328 sum_loss) 329 print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy))330 print ('%s,%.3f'%('Delta E = ',delta_total_energy))331 332 print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST06 Q-v-d',Q,v,d))333 print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',13.546, 3.136, 1.20))329 #print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy)) 330 #print ('%s,%.3f'%('Delta E = ',delta_total_energy)) 331 332 #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST06 Q-v-d',Q,v,d)) 333 #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',13.546, 3.136, 1.20)) 334 334 assert num.allclose(Q, 13.546, rtol=1.0e-2) #inflow 335 335 assert num.allclose(v, 3.136, rtol=1.0e-2) #outflow velocity -
anuga_core/source/anuga/culvert_flows/test_culvert_routines_pipe_10pct.py
r7073 r7074 69 69 sum_loss) 70 70 71 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST01 Q-v-d',Q,v,d))72 print('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.113, 0.297, 0.443))71 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST01 Q-v-d',Q,v,d)) 72 #print('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.113, 0.297, 0.443)) 73 73 assert num.allclose(Q, 0.113, rtol=1.0e-1) #inflow 74 74 assert num.allclose(v, 0.297, rtol=1.0e-1) #outflow velocity … … 119 119 sum_loss) 120 120 121 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST02 Q-v-d',Q,v,d))122 print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.585, 0.873, 0.687))121 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST02 Q-v-d',Q,v,d)) 122 #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.585, 0.873, 0.687)) 123 123 assert num.allclose(Q, 0.585, rtol=1.0e-1) #inflow 124 124 assert num.allclose(v, 0.873, rtol=1.0e-1) #outflow velocity … … 168 168 manning, 169 169 sum_loss) 170 print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy))171 print ('%s,%.2f'%('Delta E = ',delta_total_energy))172 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST03 Q-v-d',Q,v,d))173 print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 3.441, 3.042, 1.2))170 #print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy)) 171 #print ('%s,%.2f'%('Delta E = ',delta_total_energy)) 172 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST03 Q-v-d',Q,v,d)) 173 #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 3.441, 3.042, 1.2)) 174 174 assert num.allclose(Q, 3.441, rtol=1.0e-2) #inflow 175 175 assert num.allclose(v, 3.042, rtol=1.0e-2) #outflow velocity … … 221 221 manning, 222 222 sum_loss) 223 print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy))224 print ('%s,%.2f'%('Delta E = ',delta_total_energy))225 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST04 Q-v-d',Q,v,d))226 print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 1.676, 1.821, 0.91))223 #print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy)) 224 #print ('%s,%.2f'%('Delta E = ',delta_total_energy)) 225 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST04 Q-v-d',Q,v,d)) 226 #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 1.676, 1.821, 0.91)) 227 227 assert num.allclose(Q, 1.676, rtol=1.0e-2) #inflow 228 228 assert num.allclose(v, 1.821, rtol=1.0e-2) #outflow velocity … … 273 273 manning, 274 274 sum_loss) 275 print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy))276 print ('%s,%.3f'%('Delta E = ',delta_total_energy))277 278 print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST05 Q-v-d',Q,v,d))279 print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',0.759, 0.671, 1.20))275 #print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy)) 276 #print ('%s,%.3f'%('Delta E = ',delta_total_energy)) 277 278 #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST05 Q-v-d',Q,v,d)) 279 #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',0.759, 0.671, 1.20)) 280 280 assert num.allclose(Q, 0.759, rtol=1.0e-2) #inflow 281 281 assert num.allclose(v, 0.671, rtol=1.0e-2) #outflow velocity … … 325 325 manning, 326 326 sum_loss) 327 print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST06 Q-v-d',Q,v,d))328 print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',3.962, 3.503, 1.20))327 #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST06 Q-v-d',Q,v,d)) 328 #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',3.962, 3.503, 1.20)) 329 329 assert num.allclose(Q, 3.962, rtol=1.0e-2) #inflow 330 330 assert num.allclose(v, 3.503, rtol=1.0e-2) #outflow velocity -
anuga_core/source/anuga/culvert_flows/test_culvert_routines_pipe_1pct.py
r7073 r7074 69 69 sum_loss) 70 70 71 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST01 Q-v-d',Q,v,d))72 print('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.113, 0.297, 0.443))71 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST01 Q-v-d',Q,v,d)) 72 #print('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.113, 0.297, 0.443)) 73 73 assert num.allclose(Q, 0.113, rtol=1.0e-1) #inflow 74 74 assert num.allclose(v, 0.297, rtol=1.0e-1) #outflow velocity … … 119 119 sum_loss) 120 120 121 print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST02 Q-v-d',Q,v,d))122 print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs', 0.108, 0.152, 0.721))121 #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST02 Q-v-d',Q,v,d)) 122 #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs', 0.108, 0.152, 0.721)) 123 123 assert num.allclose(Q, 0.108, rtol=1.0e-1) #inflow 124 124 assert num.allclose(v, 0.152, rtol=1.0e-1) #outflow velocity … … 168 168 manning, 169 169 sum_loss) 170 print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy))171 print ('%s,%.2f'%('Delta E = ',delta_total_energy))172 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST03 Q-v-d',Q,v,d))173 print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 3.441, 3.042, 1.2))170 #print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy)) 171 #print ('%s,%.2f'%('Delta E = ',delta_total_energy)) 172 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST03 Q-v-d',Q,v,d)) 173 #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 3.441, 3.042, 1.2)) 174 174 assert num.allclose(Q, 3.441, rtol=1.0e-2) #inflow 175 175 assert num.allclose(v, 3.042, rtol=1.0e-2) #outflow velocity … … 221 221 manning, 222 222 sum_loss) 223 print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy))224 print ('%s,%.2f'%('Delta E = ',delta_total_energy))225 print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST04 Q-v-d',Q,v,d))226 print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 1.559, 1.694, 0.91))223 #print ('%s,%.2f'%('SPEC_E = ',inlet_specific_energy)) 224 #print ('%s,%.2f'%('Delta E = ',delta_total_energy)) 225 #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST04 Q-v-d',Q,v,d)) 226 #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 1.559, 1.694, 0.91)) 227 227 assert num.allclose(Q, 1.559, rtol=1.0e-2) #inflow 228 228 assert num.allclose(v, 1.694, rtol=1.0e-2) #outflow velocity … … 273 273 manning, 274 274 sum_loss) 275 print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy))276 print ('%s,%.3f'%('Delta E = ',delta_total_energy))277 278 print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST05 Q-v-d',Q,v,d))279 print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',2.258, 1.996, 1.20))275 #print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy)) 276 #print ('%s,%.3f'%('Delta E = ',delta_total_energy)) 277 278 #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST05 Q-v-d',Q,v,d)) 279 #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',2.258, 1.996, 1.20)) 280 280 assert num.allclose(Q, 2.258, rtol=1.0e-2) #inflow 281 281 assert num.allclose(v, 1.996, rtol=1.0e-2) #outflow velocity … … 325 325 manning, 326 326 sum_loss) 327 print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST06 Q-v-d',Q,v,d))328 print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',3.472, 3.070, 1.20))327 #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST06 Q-v-d',Q,v,d)) 328 #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',3.472, 3.070, 1.20)) 329 329 assert num.allclose(Q, 3.472, rtol=1.0e-2) #inflow 330 330 assert num.allclose(v, 3.070, rtol=1.0e-2) #outflow velocity
Note: See TracChangeset
for help on using the changeset viewer.