Changeset 6948 for anuga_core/source
- Timestamp:
- May 5, 2009, 9:24:16 AM (16 years ago)
- Location:
- anuga_core/source/anuga/culvert_flows
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/culvert_flows/culvert_class.py
r6299 r6948 15 15 16 16 import Numeric as num 17 17 from math import sqrt 18 18 19 19 class Below_interval(Exception): pass … … 137 137 manning=None, # Mannings Roughness for Culvert 138 138 sum_loss=None, 139 use_velocity_head=False, 139 use_velocity_head=False, # FIXME(Ole): Get rid of - always True 140 140 use_momentum_jet=False, # FIXME(Ole): Not yet implemented 141 141 label=None, … … 464 464 log_filename = self.log_filename 465 465 466 # Compute stage and energy at the466 # Compute stage, energy and velocity at the 467 467 # enquiry points at each end of the culvert 468 468 openings = self.openings … … 474 474 depth = h = stage-opening.elevation 475 475 476 476 477 # Get velocity 478 xmomentum = dq['xmomentum'].get_values(location='centroids', 479 indices=[idx])[0] 480 ymomentum = dq['xmomentum'].get_values(location='centroids', 481 indices=[idx])[0] 482 483 if h > minimum_allowed_height: 484 u = xmomentum/(h + velocity_protection/h) 485 v = ymomentum/(h + velocity_protection/h) 486 else: 487 u = v = 0.0 488 489 v_squared = u*u + v*v 490 477 491 if self.use_velocity_head is True: 478 xmomentum = dq['xmomentum'].get_values(location='centroids', 479 indices=[idx])[0] 480 ymomentum = dq['xmomentum'].get_values(location='centroids', 481 indices=[idx])[0] 482 483 if h > minimum_allowed_height: 484 u = xmomentum/(h + velocity_protection/h) 485 v = ymomentum/(h + velocity_protection/h) 486 else: 487 u = v = 0.0 488 489 velocity_head = 0.5*(u*u + v*v)/g 492 velocity_head = 0.5*v_squared/g 490 493 else: 491 494 velocity_head = 0.0 … … 495 498 opening.stage = stage 496 499 opening.depth = depth 500 opening.velocity = sqrt(v_squared) 497 501 498 502 … … 583 587 self.culvert_routine(inlet.depth, 584 588 outlet.depth, 589 inlet.velocity, 590 outlet.velocity, 585 591 inlet.specific_energy, 586 592 delta_total_energy, -
anuga_core/source/anuga/culvert_flows/culvert_routines.py
r6623 r6948 19 19 def boyd_generalised_culvert_model(inlet_depth, 20 20 outlet_depth, 21 inlet_velocity, 22 outlet_velocity, 21 23 inlet_specific_energy, 22 24 delta_total_energy, -
anuga_core/source/anuga/culvert_flows/test_culvert_routines.py
r6676 r6948 31 31 inlet_depth=2.0 32 32 outlet_depth=0.0 33 34 inlet_velocity=0.0, 35 outlet_velocity=0.0, 33 36 34 37 culvert_length=4.0 … … 49 52 Q, v, d = boyd_generalised_culvert_model(inlet_depth, 50 53 outlet_depth, 54 inlet_velocity, 55 outlet_velocity, 51 56 inlet_specific_energy, 52 57 delta_total_energy, … … 80 85 outlet_depth=0.0 81 86 87 inlet_velocity=0.0, 88 outlet_velocity=0.0, 89 82 90 culvert_length=4.0 83 91 culvert_width=1.2 … … 97 105 Q, v, d = boyd_generalised_culvert_model(inlet_depth, 98 106 outlet_depth, 107 inlet_velocity, 108 outlet_velocity, 99 109 inlet_specific_energy, 100 110 delta_total_energy, … … 189 199 Q, v, d = boyd_generalised_culvert_model(inlet_depth, 190 200 outlet_depth, 201 inlet_velocity, 202 outlet_velocity, 191 203 inlet_specific_energy, 192 204 delta_total_energy,
Note: See TracChangeset
for help on using the changeset viewer.