Changeset 8828
- Timestamp:
- Apr 15, 2013, 9:00:10 PM (12 years ago)
- Location:
- trunk/anuga_core
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/generic_domain.py
r8810 r8828 1566 1566 1567 1567 # Update any other quantities that might be useful 1568 self.update_other_quantities()1568 # self.update_other_quantities() 1569 1569 1570 1570 # Update extrema if necessary (for reporting) -
trunk/anuga_core/source/anuga/shallow_water/shallow_water_domain.py
r8815 r8828 1401 1401 """ 1402 1402 1403 1404 1403 return 1404 1405 """ 1405 1406 if self.flow_algorithm == 'yusuke': 1406 1407 return … … 1430 1431 # raise Exception('Unknown order') 1431 1432 1432 1433 """ 1433 1434 1434 1435 def update_centroids_of_velocities_and_height(self): -
trunk/anuga_core/source/anuga/structures/boyd_box_operator.py
r8827 r8828 91 91 def discharge_routine(self): 92 92 93 93 local_debug = False 94 94 95 95 if self.use_velocity_head: 96 self.delta_total_energy = self.inlets[0].get_enquiry_total_energy() - self.inlets[1].get_enquiry_total_energy() 96 self.delta_total_energy = \ 97 self.inlets[0].get_enquiry_total_energy() - self.inlets[1].get_enquiry_total_energy() 97 98 else: 98 self.delta_total_energy = self.inlets[0].get_enquiry_stage() - self.inlets[1].get_enquiry_stage() 99 self.delta_total_energy = \ 100 self.inlets[0].get_enquiry_stage() - self.inlets[1].get_enquiry_stage() 99 101 100 102 self.inflow = self.inlets[0] … … 106 108 self.delta_total_energy = -self.delta_total_energy 107 109 108 109 110 111 112 local_debug = False113 110 114 111 if self.inflow.get_enquiry_depth() > 0.01: #this value was 0.01: -
trunk/anuga_core/source/anuga/structures/inlet_operator.py
r8680 r8828 30 30 anuga.Operator.__init__(self, domain, description, label, logging, verbose) 31 31 32 33 32 self.line = numpy.array(line, dtype='d') 34 33 … … 51 50 52 51 self.set_default(default) 52 53 self.activate_logging() 53 54 54 55 -
trunk/anuga_core/source/anuga/structures/test_boyd_box_operator.py
r8129 r8828 130 130 use_velocity_head=False, 131 131 manning=culvert_mannings, 132 logging=True, 132 133 label='3.6x3.6RCBC', 133 134 verbose=False) -
trunk/anuga_core/source/anuga/structures/test_inlet_operator.py
r8506 r8828 114 114 Q2 = 10.0 115 115 116 Inlet_operator(domain, line1, Q1 )116 Inlet_operator(domain, line1, Q1, logging=True) 117 117 Inlet_operator(domain, line2, Q2) 118 118 -
trunk/anuga_core/source/anuga_parallel/parallel_boyd_box_operator.py
r8826 r8828 3 3 import pypar 4 4 5 from anuga.structures.boyd_box_operator import discharge_routine as sequential_discharge_routine5 from anuga.structures.boyd_box_operator import boyd_box_function 6 6 7 7 from parallel_inlet_operator import Parallel_Inlet_operator … … 382 382 #print "ZZZZZ: driving energy = %f" %(self.driving_energy) 383 383 384 depth = self.culvert_height385 width = self.culvert_width386 flow_width = self.culvert_width387 driving_energy = self.driving_energy388 sum_loss = self.sum_loss389 culvert_length= self.culvert_length390 manning = self.manning391 delta_total_energy = self.delta_total_energy384 # depth = self.culvert_height 385 # width = self.culvert_width 386 # flow_width = self.culvert_width 387 # driving_energy = self.driving_energy 388 # sum_loss = self.sum_loss 389 # culvert_length= self.culvert_length 390 # manning = self.manning 391 # delta_total_energy = self.delta_total_energy 392 392 393 393 394 394 395 396 397 # intially assume the culvert flow is controlled by the inlet 398 # check unsubmerged and submerged condition and use Min Q 399 # but ensure the correct flow area and wetted perimeter are used 400 Q_inlet_unsubmerged = 0.544*anuga.g**0.5*width*driving_energy**1.50 # Flow based on Inlet Ctrl Inlet Unsubmerged 401 Q_inlet_submerged = 0.702*anuga.g**0.5*width*depth**0.89*driving_energy**0.61 # Flow based on Inlet Ctrl Inlet Submerged 402 403 # FIXME(Ole): Are these functions really for inlet control? 404 if Q_inlet_unsubmerged < Q_inlet_submerged: 405 Q = Q_inlet_unsubmerged 406 dcrit = (Q**2/anuga.g/width**2)**0.333333 407 if dcrit > depth: 408 dcrit = depth 409 flow_area = width*dcrit 410 perimeter= 2.0*(width+dcrit) 411 else: # dcrit < depth 412 flow_area = width*dcrit 413 perimeter= 2.0*dcrit+width 414 outlet_culvert_depth = dcrit 415 case = 'Inlet unsubmerged Box Acts as Weir' 416 else: # Inlet Submerged but check internal culvert flow depth 417 Q = Q_inlet_submerged 418 dcrit = (Q**2/anuga.g/width**2)**0.333333 419 if dcrit > depth: 420 dcrit = depth 421 flow_area = width*dcrit 422 perimeter= 2.0*(width+dcrit) 423 else: # dcrit < depth 424 flow_area = width*dcrit 425 perimeter= 2.0*dcrit+width 426 outlet_culvert_depth = dcrit 427 case = 'Inlet submerged Box Acts as Orifice' 428 429 dcrit = (Q**2/anuga.g/width**2)**0.333333 430 # May not need this .... check if same is done above 431 outlet_culvert_depth = dcrit 432 if outlet_culvert_depth > depth: 433 outlet_culvert_depth = depth # Once again the pipe is flowing full not partfull 434 flow_area = width*depth # Cross sectional area of flow in the culvert 435 perimeter = 2*(width+depth) 436 self.case = 'Inlet CTRL Outlet unsubmerged PIPE PART FULL' 437 else: 438 flow_area = width * outlet_culvert_depth 439 perimeter = width+2*outlet_culvert_depth 440 case = 'INLET CTRL Culvert is open channel flow we will for now assume critical depth' 441 # Initial Estimate of Flow for Outlet Control using energy slope 442 #( may need to include Culvert Bed Slope Comparison) 443 hyd_rad = flow_area/perimeter 444 culvert_velocity = math.sqrt(delta_total_energy/((sum_loss/2/anuga.g)+(manning**2*culvert_length)/hyd_rad**1.33333)) 445 Q_outlet_tailwater = flow_area * culvert_velocity 446 447 448 if delta_total_energy < driving_energy: 449 # Calculate flows for outlet control 450 451 # Determine the depth at the outlet relative to the depth of flow in the Culvert 452 if outflow_enq_depth > depth: # The Outlet is Submerged 453 outlet_culvert_depth=depth 454 flow_area=width*depth # Cross sectional area of flow in the culvert 455 perimeter=2.0*(width+depth) 456 case = 'Outlet submerged' 457 else: # Here really should use the Culvert Slope to calculate Actual Culvert Depth & Velocity 458 dcrit = (Q**2/anuga.g/width**2)**0.333333 459 outlet_culvert_depth=dcrit # For purpose of calculation assume the outlet depth = Critical Depth 460 if outlet_culvert_depth > depth: 461 outlet_culvert_depth=depth 462 flow_area=width*depth 463 perimeter=2.0*(width+depth) 464 case = 'Outlet is Flowing Full' 465 else: 466 flow_area=width*outlet_culvert_depth 467 perimeter=(width+2.0*outlet_culvert_depth) 468 case = 'Outlet is open channel flow' 469 470 hyd_rad = flow_area/perimeter 471 472 473 474 # Final Outlet control velocity using tail water 475 culvert_velocity = math.sqrt(delta_total_energy/((sum_loss/2/anuga.g)+(manning**2*culvert_length)/hyd_rad**1.33333)) 476 Q_outlet_tailwater = flow_area * culvert_velocity 477 478 Q = min(Q, Q_outlet_tailwater) 479 else: 480 481 pass 482 #FIXME(Ole): What about inlet control? 483 484 culv_froude=math.sqrt(Q**2*flow_width/(anuga.g*flow_area**3)) 485 486 if local_debug: 487 anuga.log.critical('FLOW AREA = %s' % str(flow_area)) 488 anuga.log.critical('PERIMETER = %s' % str(perimeter)) 489 anuga.log.critical('Q final = %s' % str(Q)) 490 anuga.log.critical('FROUDE = %s' % str(culv_froude)) 491 492 # Determine momentum at the outlet 493 barrel_velocity = Q/(flow_area + anuga.velocity_protection/flow_area) 494 395 Q, barrel_velocity, outlet_culvert_depth, case = \ 396 boyd_box_function(depth =self.culvert_height, 397 width =self.culvert_width, 398 flow_width =self.culvert_width, 399 length =self.culvert_length, 400 driving_energy =self.driving_energy, 401 delta_total_energy =self.delta_total_energy, 402 outlet_enquiry_depth=outflow_enq_depth, 403 sum_loss =self.sum_loss, 404 manning =self.manning) 495 405 496 406 -
trunk/anuga_core/source/anuga_parallel/test_all.py
r8426 r8828 20 20 #List files that should be excluded from the testing process. 21 21 #E.g. if they are known to fail and under development 22 exclude_files = ['test_failure.py' ]22 exclude_files = ['test_failure.py', 'test_parallel_boyd_pipe_operator.py'] 23 23 24 24 # Directories that should not be searched for test files. -
trunk/anuga_core/source/anuga_parallel/test_parallel_frac_op.py
r8507 r8828 167 167 boyd_box0 = None 168 168 169 inlet0 = Inlet_operator(domain, line0, Q0, verbose = False)170 inlet1 = Inlet_operator(domain, line1, Q1, verbose = False)169 inlet0 = Inlet_operator(domain, line0, Q0, logging=True, description='inlet0', verbose = False) 170 inlet1 = Inlet_operator(domain, line1, Q1, logging=True, description='inlet1', verbose = False) 171 171 172 172 # Enquiry point [ 19. 2.5] is contained in two domains in 4 proc case … … 180 180 use_velocity_head=False, 181 181 manning=0.013, 182 logging=True, 183 description='boyd_box_0', 182 184 verbose=False) 183 185 -
trunk/anuga_core/test_all.py
r8779 r8828 18 18 try: 19 19 import pypar 20 except: 21 print 'anuga_parallel tests not run as pypar not installed' 22 else: 20 23 os.chdir(buildroot) 21 24 os.chdir('source') … … 25 28 print 'Changing to', os.getcwd() 26 29 execfile('test_all.py') 27 except:28 print 'anuga_parallel tests not run as pypar not installed'29 30 30 31 31
Note: See TracChangeset
for help on using the changeset viewer.