Changeset 9737 for trunk/anuga_core/anuga/structures
- Timestamp:
- Oct 4, 2016, 4:13:00 PM (9 years ago)
- Location:
- trunk/anuga_core/anuga/structures
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/anuga/structures/boyd_box_operator.py
r9598 r9737 26 26 domain, 27 27 losses, 28 width, 29 height=None, 28 width, 29 height=None, 30 blockage=0.0, # added by DPM 24/7/2016 30 31 z1=0.0, 31 z2=0.0, 32 z2=0.0, 32 33 end_points=None, 33 34 exchange_lines=None, … … 54 55 width=width, 55 56 height=height, 56 diameter=None, 57 blockage=blockage, # added by DPM 24/7/2016 58 diameter=None, 57 59 apron=apron, 58 60 manning=manning, … … 81 83 self.culvert_width = self.get_culvert_width() 82 84 self.culvert_height = self.get_culvert_height() 85 self.culvert_blockage = self.get_culvert_blockage()#added DPM 24/7/2016 83 86 84 87 #FIXME SR: Why is this hard coded! … … 193 196 print 'width ',self.culvert_width 194 197 print 'depth ',self.culvert_height 198 print 'culvert blockage ',self.culvert_blockage #added DPM 24/7/2016 195 199 print 'flow_width ',self.culvert_width 196 200 print 'length ' ,self.culvert_length … … 207 211 boyd_box_function(width =self.culvert_width, 208 212 depth =self.culvert_height, 213 blockage =self.culvert_blockage,#added DPM 24/7/2016 209 214 flow_width =self.culvert_width, 210 length =self.culvert_length, 215 length =self.culvert_length, 211 216 driving_energy =self.driving_energy, 212 217 delta_total_energy =self.delta_total_energy, … … 234 239 235 240 else: 236 237 241 Q = barrel_velocity = outlet_culvert_depth = 0.0 242 case = 'Inlet dry' 238 243 239 244 … … 256 261 def boyd_box_function(width, 257 262 depth, 263 blockage, # added by DPM 24/7/2016 258 264 flow_width, 259 length, 265 length, 260 266 driving_energy, 261 267 delta_total_energy, … … 269 275 270 276 local_debug = False 271 272 Q_inlet_unsubmerged = 0.544*anuga.g**0.5* width*driving_energy**1.50 # Flow based on Inlet Ctrl Inlet Unsubmerged273 Q_inlet_submerged = 0.702*anuga.g**0.5* width*depth**0.89*driving_energy**0.61 # Flow based on Inlet Ctrl Inlet Submerged277 278 Q_inlet_unsubmerged = 0.544*anuga.g**0.5*(1-blockage)*width*driving_energy**1.50 # Flow based on Inlet Ctrl Inlet Unsubmerged 279 Q_inlet_submerged = 0.702*anuga.g**0.5*(1-blockage)**2*width*depth**0.89*driving_energy**0.61 # Flow based on Inlet Ctrl Inlet Submerged 274 280 275 281 # FIXME(Ole): Are these functions really for inlet control? 276 282 if Q_inlet_unsubmerged < Q_inlet_submerged: 277 283 Q = Q_inlet_unsubmerged 278 dcrit = (Q**2/anuga.g/ width**2)**0.333333284 dcrit = (Q**2/anuga.g/((1-blockage)*width)**2)**0.333333 279 285 if dcrit > depth: 280 286 dcrit = depth 281 flow_area = width*dcrit282 perimeter= 2.0*( width+dcrit)287 flow_area = (1-blockage)*width*dcrit 288 perimeter= 2.0*(1-blockage)*(width+dcrit) 283 289 else: # dcrit < depth 284 flow_area = width*dcrit285 perimeter= 2.0* dcrit+width290 flow_area = (1-blockage)*width*dcrit 291 perimeter= 2.0*(1-blockage)*dcrit+(1-blockage)*width 286 292 outlet_culvert_depth = dcrit 287 293 case = 'Inlet unsubmerged Box Acts as Weir' 288 294 else: # Inlet Submerged but check internal culvert flow depth 289 295 Q = Q_inlet_submerged 290 dcrit = (Q**2/anuga.g/ width**2)**0.333333296 dcrit = (Q**2/anuga.g/((1-blockage)*width)**2)**0.333333 291 297 if dcrit > depth: 292 298 dcrit = depth 293 flow_area = width*dcrit294 perimeter= 2.0*( width+dcrit)299 flow_area = (1-blockage)*width*dcrit 300 perimeter= 2.0*(1-blockage)*(width+dcrit) 295 301 else: # dcrit < depth 296 flow_area = width*dcrit297 perimeter= 2.0* dcrit+width302 flow_area = (1-blockage)*width*dcrit 303 perimeter= 2.0*(1-blockage)*dcrit+(1-blockage)*width 298 304 outlet_culvert_depth = dcrit 299 305 case = 'Inlet submerged Box Acts as Orifice' 300 306 301 dcrit = (Q**2/anuga.g/width**2)**0.333333 307 dcrit = (Q**2/anuga.g/((1-blockage)*width)**2)**0.333333 308 302 309 # May not need this .... check if same is done above 303 310 outlet_culvert_depth = dcrit 311 304 312 if outlet_culvert_depth > depth: 305 313 outlet_culvert_depth = depth # Once again the pipe is flowing full not partfull 306 flow_area = width*depth # Cross sectional area of flow in the culvert307 perimeter = 2*( width+depth)314 flow_area = (1-blockage)*width*depth # Cross sectional area of flow in the culvert 315 perimeter = 2*(1-blockage)*(width+depth) 308 316 case = 'Inlet CTRL Outlet unsubmerged PIPE PART FULL' 309 317 else: 310 flow_area = width * outlet_culvert_depth311 perimeter = width+2*outlet_culvert_depth318 flow_area = (1-blockage)*width * outlet_culvert_depth 319 perimeter = (1-blockage)*width+2*(1-blockage)*outlet_culvert_depth 312 320 case = 'INLET CTRL Culvert is open channel flow we will for now assume critical depth' 313 321 # Initial Estimate of Flow for Outlet Control using energy slope 314 322 #( may need to include Culvert Bed Slope Comparison) 323 315 324 hyd_rad = flow_area/perimeter 325 316 326 culvert_velocity = math.sqrt(delta_total_energy/((sum_loss/2/anuga.g) \ 317 327 +(manning**2*length)/hyd_rad**1.33333)) … … 325 335 if outlet_enquiry_depth > depth: # The Outlet is Submerged 326 336 outlet_culvert_depth=depth 327 flow_area= width*depth # Cross sectional area of flow in the culvert328 perimeter=2.0*( width+depth)337 flow_area=(1-blockage)*width*depth # Cross sectional area of flow in the culvert 338 perimeter=2.0*(1-blockage)*(width+depth) 329 339 case = 'Outlet submerged' 330 340 else: # Here really should use the Culvert Slope to calculate Actual Culvert Depth & Velocity 331 dcrit = (Q**2/anuga.g/ width**2)**0.333333341 dcrit = (Q**2/anuga.g/((1-blockage)*width)**2)**0.333333 332 342 outlet_culvert_depth=dcrit # For purpose of calculation assume the outlet depth = Critical Depth 333 343 if outlet_culvert_depth > depth: 334 344 outlet_culvert_depth=depth 335 flow_area= width*depth336 perimeter=2.0*( width+depth)345 flow_area=(1-blockage)*width*depth 346 perimeter=2.0*(1-blockage)*(width+depth) 337 347 case = 'Outlet is Flowing Full' 338 348 else: 339 flow_area= width*outlet_culvert_depth340 perimeter=( width+2.0*outlet_culvert_depth)349 flow_area=(1-blockage)*width*outlet_culvert_depth 350 perimeter=((1-blockage)*width+2.0*(1-blockage)*outlet_culvert_depth) 341 351 case = 'Outlet is open channel flow' 342 352 343 353 hyd_rad = flow_area/perimeter 344 354 … … 371 381 372 382 return Q, barrel_velocity, outlet_culvert_depth, flow_area, case 373 374 375 376 377 378 379 380 -
trunk/anuga_core/anuga/structures/riverwall.py
r9602 r9737 33 33 # 1947), 34 34 # Q1 = 2/3*headwater_head*sqrt(g*2/3*headwater_head)*Qfactor 35 # Q2 = 2/3*tailwater_head*sqrt(g*2/3* headwater_head)*Qfactor36 # ID = Q1*(1-Q2/Q1)**0.38535 # Q2 = 2/3*tailwater_head*sqrt(g*2/3*tailwater_head)*Qfactor 36 # ID = Q1*(1-Q2/Q1)**0.385 37 37 # 38 38 # Denote SW as the 'shallow-water' weir flux, computed from the approximate -
trunk/anuga_core/anuga/structures/structure_operator.py
r9734 r9737 33 33 z1=None,#added by PM 4/10/2013 34 34 z2=None,#added by PM 4/10/2013 35 blockage=None,#added by PM 24/7/2016 35 36 apron=None, 36 37 manning=None, … … 85 86 self.diameter = diameter 86 87 self.z1 = z1 #added by PM 4/10/2013 87 self.z2 = z2 #added by PM 4/10/2013 88 self.z2 = z2 #added by PM 4/10/2013 89 self.blockage = blockage #added by PM 24/7/2016 88 90 self.apron = apron 89 91 self.manning = manning … … 367 369 368 370 self.culvert_z2 = z2 #added by PM 4/10/2013 371 372 def set_culvert_blockage(self, blockage): #added by PM 24/7/2016 373 374 self.culvert_blockage = blockage #added by PM 24/7/2016 369 375 370 376 def __process_non_skew_culvert(self): … … 642 648 return self.z2 #added by PM 4/10/2013 643 649 650 def get_culvert_blockage(self): #added by PM 24/7/2016 651 652 return self.blockage #added by PM 24/7/2016 653 644 654 def get_culvert_apron(self): 645 655 -
trunk/anuga_core/anuga/structures/tests/test_boyd_box_operator.py
r9440 r9737 352 352 culvert_width=3.6 353 353 culvert_height=1.20 354 culvert_blockage = 0.00 354 355 355 356 culvert_type='box' … … 371 372 print 'width ',culvert_width 372 373 print 'depth ',culvert_height 374 print 'blockage',culvert_blockage 373 375 print 'flow_width ',culvert_width 374 376 print 'length ' ,culvert_length … … 378 380 print 'sum_loss ',sum_loss 379 381 print 'manning ',manning 380 381 382 382 383 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 383 culvert_height, 384 culvert_height, 385 culvert_blockage, 384 386 culvert_width, 385 387 culvert_length, … … 528 530 culvert_width=3.60 529 531 culvert_height=1.20 530 532 culvert_blockage = 0.00 533 531 534 culvert_type='box' 532 535 manning=0.013 … … 548 551 print 'width ',culvert_width 549 552 print 'depth ',culvert_height 553 print 'blockage',culvert_blockage 550 554 print 'flow_width ',culvert_width 551 555 print 'length ' ,culvert_length … … 555 559 print 'sum_loss ',sum_loss 556 560 print 'manning ',manning 557 561 558 562 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 559 culvert_height, 563 culvert_height, 564 culvert_blockage, 560 565 culvert_width, 561 566 culvert_length, … … 702 707 culvert_width=3.60 703 708 culvert_height=1.20 704 709 culvert_blockage = 0.00 710 705 711 culvert_type='box' 706 712 manning=0.013 … … 723 729 print 'width ',culvert_width 724 730 print 'depth ',culvert_height 731 print 'blockage',culvert_blockage 725 732 print 'flow_width ',culvert_width 726 733 print 'length ' ,culvert_length … … 730 737 print 'sum_loss ',sum_loss 731 738 print 'manning ',manning 732 739 733 740 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 734 culvert_height, 741 culvert_height, 742 culvert_blockage, 735 743 culvert_width, 736 744 culvert_length, … … 881 889 inlet_velocity=1.0 882 890 outlet_velocity=0.5 891 883 892 culvert_length=10.0 884 893 culvert_width=3.60 885 894 culvert_height=1.20 886 895 culvert_blockage = 0.00 896 887 897 culvert_type='box' 888 898 manning=0.013 … … 907 917 print 'width ',culvert_width 908 918 print 'depth ',culvert_height 919 print 'blockage',culvert_blockage 909 920 print 'flow_width ',culvert_width 910 921 print 'length ' ,culvert_length … … 914 925 print 'sum_loss ',sum_loss 915 926 print 'manning ',manning 916 927 917 928 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 918 culvert_height, 929 culvert_height, 930 culvert_blockage, 919 931 culvert_width, 920 932 culvert_length, … … 1057 1069 outlet_depth=2.5 1058 1070 outlet_velocity=0.5 1071 1059 1072 culvert_length=10.0 1060 1073 culvert_width=3.60 1061 1074 culvert_height=1.20 1062 1075 culvert_blockage = 0.00 1076 1063 1077 culvert_type='box' 1064 1078 manning=0.013 … … 1080 1094 print 'width ',culvert_width 1081 1095 print 'depth ',culvert_height 1096 print 'blockage',culvert_blockage 1082 1097 print 'flow_width ',culvert_width 1083 1098 print 'length ' ,culvert_length … … 1087 1102 print 'sum_loss ',sum_loss 1088 1103 print 'manning ',manning 1089 1104 1090 1105 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 1091 culvert_height, 1106 culvert_height, 1107 culvert_blockage, 1092 1108 culvert_width, 1093 1109 culvert_length, … … 1234 1250 outlet_depth=0.80 1235 1251 outlet_velocity=4.0 1252 1236 1253 culvert_length=10.0 1237 1254 culvert_width=3.60 1238 1255 culvert_height=1.20 1239 1256 culvert_blockage = 0.00 1257 1240 1258 culvert_type='box' 1241 1259 manning=0.013 … … 1257 1275 print 'width ',culvert_width 1258 1276 print 'depth ',culvert_height 1277 print 'blockage',culvert_blockage 1259 1278 print 'flow_width ',culvert_width 1260 1279 print 'length ' ,culvert_length … … 1266 1285 1267 1286 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 1268 culvert_height, 1287 culvert_height, 1288 culvert_blockage, 1269 1289 culvert_width, 1270 1290 culvert_length, … … 1411 1431 culvert_width=3.6 1412 1432 culvert_height=1.20 1413 1433 culvert_blockage = 0.00 1434 1414 1435 culvert_type='box' 1415 1436 manning=0.013 … … 1434 1455 print 'width ',culvert_width 1435 1456 print 'depth ',culvert_height 1457 print 'blockage',culvert_blockage 1436 1458 print 'flow_width ',culvert_width 1437 1459 print 'length ' ,culvert_length … … 1443 1465 1444 1466 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 1445 culvert_height, 1467 culvert_height, 1468 culvert_blockage, 1446 1469 culvert_width, 1447 1470 culvert_length, … … 1600 1623 culvert_width=3.60 1601 1624 culvert_height=1.20 1602 1625 culvert_blockage = 0.00 1626 1603 1627 culvert_type='box' 1604 1628 manning=0.013 … … 1621 1645 print 'width ',culvert_width 1622 1646 print 'depth ',culvert_height 1647 print 'blockage',culvert_blockage 1623 1648 print 'flow_width ',culvert_width 1624 1649 print 'length ' ,culvert_length … … 1630 1655 1631 1656 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 1632 culvert_height, 1657 culvert_height, 1658 culvert_blockage, 1633 1659 culvert_width, 1634 1660 culvert_length, … … 1782 1808 culvert_width=3.60 1783 1809 culvert_height=1.20 1784 1810 culvert_blockage = 0.00 1811 1785 1812 culvert_type='box' 1786 1813 manning=0.013 … … 1803 1830 print 'width ',culvert_width 1804 1831 print 'depth ',culvert_height 1832 print 'blockage',culvert_blockage 1805 1833 print 'flow_width ',culvert_width 1806 1834 print 'length ' ,culvert_length … … 1812 1840 1813 1841 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 1814 culvert_height, 1842 culvert_height, 1843 culvert_blockage, 1815 1844 culvert_width, 1816 1845 culvert_length, … … 1963 1992 outlet_depth=0.8 1964 1993 inlet_velocity=1.0 1965 outlet_velocity=0.5 1994 outlet_velocity=0.5 1995 1966 1996 culvert_length=10.0 1967 1997 culvert_width=3.60 1968 1998 culvert_height=1.20 1999 culvert_blockage = 0.0 1969 2000 1970 2001 culvert_type='box' … … 1989 2020 print 'width ',culvert_width 1990 2021 print 'depth ',culvert_height 2022 print 'blockage',culvert_blockage 1991 2023 print 'flow_width ',culvert_width 1992 2024 print 'length ' ,culvert_length … … 1998 2030 1999 2031 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 2000 culvert_height, 2032 culvert_height, 2033 culvert_blockage, 2001 2034 culvert_width, 2002 2035 culvert_length, … … 2150 2183 outlet_depth=1.3 2151 2184 outlet_velocity=0.5 2185 2152 2186 culvert_length=10.0 2153 2187 culvert_width=3.60 2154 2188 culvert_height=1.20 2189 culvert_blockage = 0.00 2155 2190 2156 2191 culvert_type='box' … … 2174 2209 print 'width ',culvert_width 2175 2210 print 'depth ',culvert_height 2211 print 'blockage',culvert_blockage 2176 2212 print 'flow_width ',culvert_width 2177 2213 print 'length ' ,culvert_length … … 2183 2219 2184 2220 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 2185 culvert_height, 2221 culvert_height, 2222 culvert_blockage, 2186 2223 culvert_width, 2187 2224 culvert_length, … … 2335 2372 outlet_depth=0.8 2336 2373 outlet_velocity=4.0 2374 2337 2375 culvert_length=10.0 2338 2376 culvert_width=3.60 2339 2377 culvert_height=1.20 2378 culvert_blockage = 0.00 2340 2379 2341 2380 culvert_type='box' … … 2359 2398 print 'width ',culvert_width 2360 2399 print 'depth ',culvert_height 2400 print 'blockage',culvert_blockage 2361 2401 print 'flow_width ',culvert_width 2362 2402 print 'length ' ,culvert_length … … 2368 2408 2369 2409 Q, v, d, flow_area, case= boyd_box_function(culvert_width, 2370 culvert_height, 2410 culvert_height, 2411 culvert_blockage, 2371 2412 culvert_width, 2372 2413 culvert_length, -
trunk/anuga_core/anuga/structures/weir_orifice_trapezoid_operator.py
r9598 r9737 52 52 width=width, 53 53 height=height, 54 culvert_slope=culvert_slope,54 #culvert_slope=culvert_slope, 55 55 z1=z1, 56 56 z2=z2,
Note: See TracChangeset
for help on using the changeset viewer.