Changeset 8001
- Timestamp:
- Sep 4, 2010, 9:37:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/structures/boyd_box_operator.py
r7997 r8001 1 from anuga.geometry.polygon import inside_polygon, polygon_area 2 from anuga.config import g, velocity_protection 3 import anuga.utilities.log as log 1 import anuga 4 2 import math 5 3 import types 6 4 7 import structure_operator 8 9 class Boyd_box_operator(structure_operator.Structure_operator): 5 class Boyd_box_operator(anuga.Structure_operator): 10 6 """Culvert flow - transfer water from one rectangular box to another. 11 7 Sets up the geometry of problem … … 33 29 verbose=False): 34 30 35 structure_operator.Structure_operator.__init__(self,36 37 38 39 40 41 42 43 44 45 31 anuga.Structure_operator.__init__(self, 32 domain, 33 end_point0, 34 end_point1, 35 width, 36 height, 37 apron, 38 manning, 39 enquiry_gap, 40 description, 41 verbose) 46 42 47 43 … … 49 45 self.sum_loss = sum(losses.values()) 50 46 elif type(losses) == types.ListType: 51 self.sum_loss es= sum(losses)52 else: 53 self.sum_loss es= losses47 self.sum_loss = sum(losses) 48 else: 49 self.sum_loss = losses 54 50 55 51 self.use_momentum_jet = use_momentum_jet … … 79 75 80 76 Q, barrel_speed, outlet_depth = self.__discharge_routine() 81 82 #inflow = self.routine.get_inflow()83 #outflow = self.routine.get_outflow()84 77 85 78 old_inflow_height = self.inflow.get_average_height() … … 181 174 if self.inflow.get_enquiry_height() > 0.01: #this value was 0.01: 182 175 if local_debug =='true': 183 log.critical('Specific E & Deltat Tot E = %s, %s'176 anuga.log.critical('Specific E & Deltat Tot E = %s, %s' 184 177 % (str(self.inflow.get_enquiry_specific_energy()), 185 178 str(self.delta_total_energy))) 186 log.critical('culvert type = %s' % str(culvert_type))179 anuga.log.critical('culvert type = %s' % str(culvert_type)) 187 180 # Water has risen above inlet 188 181 … … 205 198 # check unsubmerged and submerged condition and use Min Q 206 199 # but ensure the correct flow area and wetted perimeter are used 207 Q_inlet_unsubmerged = 0.544* g**0.5*width*self.driving_energy**1.50 # Flow based on Inlet Ctrl Inlet Unsubmerged208 Q_inlet_submerged = 0.702* g**0.5*width*height**0.89*self.driving_energy**0.61 # Flow based on Inlet Ctrl Inlet Submerged200 Q_inlet_unsubmerged = 0.544*anuga.g**0.5*width*self.driving_energy**1.50 # Flow based on Inlet Ctrl Inlet Unsubmerged 201 Q_inlet_submerged = 0.702*anuga.g**0.5*width*height**0.89*self.driving_energy**0.61 # Flow based on Inlet Ctrl Inlet Submerged 209 202 210 203 # FIXME(Ole): Are these functions really for inlet control? 211 204 if Q_inlet_unsubmerged < Q_inlet_submerged: 212 205 Q = Q_inlet_unsubmerged 213 dcrit = (Q**2/ g/width**2)**0.333333206 dcrit = (Q**2/anuga.g/width**2)**0.333333 214 207 if dcrit > height: 215 208 dcrit = height … … 223 216 else: # Inlet Submerged but check internal culvert flow depth 224 217 Q = Q_inlet_submerged 225 dcrit = (Q**2/ g/width**2)**0.333333218 dcrit = (Q**2/anuga.g/width**2)**0.333333 226 219 if dcrit > height: 227 220 dcrit = height … … 234 227 case = 'Inlet submerged Box Acts as Orifice' 235 228 236 dcrit = (Q**2/ g/width**2)**0.333333229 dcrit = (Q**2/anuga.g/width**2)**0.333333 237 230 # May not need this .... check if same is done above 238 231 outlet_culvert_depth = dcrit … … 249 242 #( may need to include Culvert Bed Slope Comparison) 250 243 hyd_rad = flow_area/perimeter 251 culvert_velocity = math.sqrt(self.delta_total_energy/((self.sum_loss/2/ g)+(self.manning**2*self.culvert_length)/hyd_rad**1.33333))244 culvert_velocity = math.sqrt(self.delta_total_energy/((self.sum_loss/2/anuga.g)+(self.manning**2*self.culvert_length)/hyd_rad**1.33333)) 252 245 Q_outlet_tailwater = flow_area * culvert_velocity 253 246 … … 263 256 case = 'Outlet submerged' 264 257 else: # Here really should use the Culvert Slope to calculate Actual Culvert Depth & Velocity 265 dcrit = (Q**2/ g/width**2)**0.333333258 dcrit = (Q**2/anuga.g/width**2)**0.333333 266 259 outlet_culvert_depth=dcrit # For purpose of calculation assume the outlet depth = Critical Depth 267 260 if outlet_culvert_depth > height: … … 282 275 283 276 # Final Outlet control velocity using tail water 284 culvert_velocity = math.sqrt(self.delta_total_energy/((self.sum_loss/2/ g)+(self.manning**2*self.culvert_length)/hyd_rad**1.33333))277 culvert_velocity = math.sqrt(self.delta_total_energy/((self.sum_loss/2/anuga.g)+(self.manning**2*self.culvert_length)/hyd_rad**1.33333)) 285 278 Q_outlet_tailwater = flow_area * culvert_velocity 286 279 … … 293 286 #FIXME(Ole): What about inlet control? 294 287 295 culv_froude=math.sqrt(Q**2*flow_width/( g*flow_area**3))288 culv_froude=math.sqrt(Q**2*flow_width/(anuga.g*flow_area**3)) 296 289 if local_debug =='true': 297 log.critical('FLOW AREA = %s' % str(flow_area))298 log.critical('PERIMETER = %s' % str(perimeter))299 log.critical('Q final = %s' % str(Q))300 log.critical('FROUDE = %s' % str(culv_froude))290 anuga.log.critical('FLOW AREA = %s' % str(flow_area)) 291 anuga.log.critical('PERIMETER = %s' % str(perimeter)) 292 anuga.log.critical('Q final = %s' % str(Q)) 293 anuga.log.critical('FROUDE = %s' % str(culv_froude)) 301 294 302 295 # Determine momentum at the outlet 303 barrel_velocity = Q/(flow_area + velocity_protection/flow_area)296 barrel_velocity = Q/(flow_area + anuga.velocity_protection/flow_area) 304 297 305 298 # END CODE BLOCK for DEPTH > Required depth for CULVERT Flow
Note: See TracChangeset
for help on using the changeset viewer.