Changeset 7035 for branches/numpy/anuga/culvert_flows/culvert_class.py
- Timestamp:
- May 14, 2009, 2:24:54 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/numpy/anuga/culvert_flows/culvert_class.py
r6902 r7035 15 15 16 16 import numpy 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,
Note: See TracChangeset
for help on using the changeset viewer.