Changeset 8002
 Timestamp:
 Sep 4, 2010, 9:38:37 PM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/anuga_core/source/anuga/structures/boyd_pipe_operator.py
r7998 r8002 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 from anuga.utilities.numerical_tools import safe_acos as acos6 3 import types 7 4 8 import structure_operator 9 10 class Boyd_pipe_operator(structure_operator.Structure_operator): 5 class Boyd_pipe_operator(anuga.Structure_operator): 11 6 """Culvert flow  transfer water from one location to another via a circular pipe culvert. 12 7 Sets up the geometry of problem … … 33 28 verbose=False): 34 29 35 structure_operator.Structure_operator.__init__(self,36 37 38 39 40 41 42 43 44 45 46 30 anuga.Structure_operator.__init__(self, 31 domain, 32 end_point0, 33 end_point1, 34 width=diameter, 35 height=None, 36 apron=apron, 37 manning=manning, 38 enquiry_gap=enquiry_gap, 39 description=description, 40 verbose=verbose) 41 47 42 48 43 if type(losses) == types.DictType: … … 180 175 if self.inflow.get_enquiry_height() > 0.01: #this value was 0.01: Remember this needs to be compared to the Invert Lvl 181 176 if local_debug =='true': 182 log.critical('Specific E & Deltat Tot E = %s, %s'177 anuga.log.critical('Specific E & Deltat Tot E = %s, %s' 183 178 % (str(self.inflow.get_enquiry_specific_energy()), 184 179 str(self.delta_total_energy))) 185 log.critical('culvert type = %s' % str(culvert_type))180 anuga.log.critical('culvert type = %s' % str(culvert_type)) 186 181 # Water has risen above inlet 187 182 … … 211 206 if self.inflow.get_average_height() > 0.01: #this should test against invert 212 207 if local_debug =='true': 213 log.critical('Specific E & Deltat Tot E = %s, %s'208 anuga.log.critical('Specific E & Deltat Tot E = %s, %s' 214 209 % (str(self.inflow.get_average_specific_energy()), 215 210 str(self.delta_total_energy))) 216 log.critical('culvert type = %s' % str(culvert_type))211 anuga.log.critical('culvert type = %s' % str(culvert_type)) 217 212 # Water has risen above inlet 218 213 … … 225 220 226 221 # Calculate flows for inlet control for circular pipe 227 Q_inlet_unsubmerged = 0.421* g**0.5*diameter**0.87*self.inflow.get_average_specific_energy()**1.63 # Inlet Ctrl Inlet Unsubmerged228 Q_inlet_submerged = 0.530* g**0.5*diameter**1.87*self.inflow.get_average_specific_energy()**0.63 # Inlet Ctrl Inlet Submerged222 Q_inlet_unsubmerged = 0.421*anuga.g**0.5*diameter**0.87*self.inflow.get_average_specific_energy()**1.63 # Inlet Ctrl Inlet Unsubmerged 223 Q_inlet_submerged = 0.530*anuga.g**0.5*diameter**1.87*self.inflow.get_average_specific_energy()**0.63 # Inlet Ctrl Inlet Submerged 229 224 # Note for to SUBMERGED TO OCCUR self.inflow.get_average_specific_energy() should be > 1.2 x diameter.... Should Check !!! 230 225 … … 236 231 # THE LOWEST Value will Control Calcs From here 237 232 # Calculate Critical Depth Based on the Adopted Flow as an Estimate 238 dcrit1 = diameter/1.26*(Q/ g**0.5*diameter**2.5)**(1/3.75)239 dcrit2 = diameter/0.95*(Q/ g**0.5*diameter**2.5)**(1/1.95)233 dcrit1 = diameter/1.26*(Q/anuga.g**0.5*diameter**2.5)**(1/3.75) 234 dcrit2 = diameter/0.95*(Q/anuga.g**0.5*diameter**2.5)**(1/1.95) 240 235 # From Boyd Paper ESTIMATE of Dcrit has 2 criteria as 241 236 if dcrit1/diameter > 0.85: … … 252 247 case = 'Inlet CTRL Outlet submerged Circular PIPE FULL' 253 248 if local_debug == 'true': 254 log.critical('Inlet CTRL Outlet submerged Circular '249 anuga.log.critical('Inlet CTRL Outlet submerged Circular ' 255 250 'PIPE FULL') 256 251 else: 257 #alpha = a cos(1  outlet_culvert_depth/diameter) # Where did this Come From ????/258 alpha = a cos(12*outlet_culvert_depth/diameter)*2252 #alpha = anuga.acos(1  outlet_culvert_depth/diameter) # Where did this Come From ????/ 253 alpha = anuga.acos(12*outlet_culvert_depth/diameter)*2 259 254 #flow_area = diameter**2 * (alpha  sin(alpha)*cos(alpha)) # Pipe is Running Partly Full at the INLET WHRE did this Come From ????? 260 255 flow_area = diameter**2/8*(alpha  math.sin(alpha)) # Equation from GIECK 5th Ed. Pg. B3 … … 263 258 case = 'INLET CTRL Culvert is open channel flow we will for now assume critical depth' 264 259 if local_debug =='true': 265 log.critical('INLET CTRL Culvert is open channel flow '260 anuga.log.critical('INLET CTRL Culvert is open channel flow ' 266 261 'we will for now assume critical depth') 267 log.critical('Q Outlet Depth and ALPHA = %s, %s, %s'262 anuga.log.critical('Q Outlet Depth and ALPHA = %s, %s, %s' 268 263 % (str(Q), str(outlet_culvert_depth), 269 264 str(alpha))) … … 279 274 case = 'Outlet submerged' 280 275 if local_debug =='true': 281 log.critical('Outlet submerged')276 anuga.log.critical('Outlet submerged') 282 277 else: # Culvert running PART FULL for PART OF ITS LENGTH Here really should use the Culvert Slope to calculate Actual Culvert Depth & Velocity 283 278 # IF self.outflow.get_average_height() < diameter 284 dcrit1 = diameter/1.26*(Q/ g**0.5*diameter**2.5)**(1/3.75)285 dcrit2 = diameter/0.95*(Q/ g**0.5*diameter**2.5)**(1/1.95)279 dcrit1 = diameter/1.26*(Q/anuga.g**0.5*diameter**2.5)**(1/3.75) 280 dcrit2 = diameter/0.95*(Q/anuga.g**0.5*diameter**2.5)**(1/1.95) 286 281 if dcrit1/diameter >0.85: 287 282 outlet_culvert_depth= dcrit2 … … 295 290 case = 'Outlet unsubmerged PIPE FULL' 296 291 if local_debug =='true': 297 log.critical('Outlet unsubmerged PIPE FULL')292 anuga.log.critical('Outlet unsubmerged PIPE FULL') 298 293 else: 299 alpha = a cos(12*outlet_culvert_depth/diameter)*2294 alpha = anuga.acos(12*outlet_culvert_depth/diameter)*2 300 295 flow_area = diameter**2/8*(alpha  math.sin(alpha)) # Equation from GIECK 5th Ed. Pg. B3 301 296 flow_width= diameter*math.sin(alpha/2.0) … … 303 298 case = 'Outlet is open channel flow we will for now assume critical depth' 304 299 if local_debug == 'true': 305 log.critical('Q Outlet Depth and ALPHA = %s, %s, %s'300 anuga.log.critical('Q Outlet Depth and ALPHA = %s, %s, %s' 306 301 % (str(Q), str(outlet_culvert_depth), 307 302 str(alpha))) 308 log.critical('Outlet is open channel flow we '303 anuga.log.critical('Outlet is open channel flow we ' 309 304 'will for now assume critical depth') 310 305 if local_debug == 'true': 311 log.critical('FLOW AREA = %s' % str(flow_area))312 log.critical('PERIMETER = %s' % str(perimeter))313 log.critical('Q Interim = %s' % str(Q))306 anuga.log.critical('FLOW AREA = %s' % str(flow_area)) 307 anuga.log.critical('PERIMETER = %s' % str(perimeter)) 308 anuga.log.critical('Q Interim = %s' % str(Q)) 314 309 hyd_rad = flow_area/perimeter 315 310 … … 320 315 # Outlet control velocity using tail water 321 316 if local_debug =='true': 322 log.critical('GOT IT ALL CALCULATING Velocity')323 log.critical('HydRad = %s' % str(hyd_rad))317 anuga.log.critical('GOT IT ALL CALCULATING Velocity') 318 anuga.log.critical('HydRad = %s' % str(hyd_rad)) 324 319 # Calculate Pipe Culvert Outlet Control Velocity.... May need initial Estimate First ?? 325 320 326 culvert_velocity = math.sqrt(self.delta_total_energy/((self.sum_loss/2/ g)+(self.manning**2*self.culvert_length)/hyd_rad**1.33333))321 culvert_velocity = math.sqrt(self.delta_total_energy/((self.sum_loss/2/anuga.g)+(self.manning**2*self.culvert_length)/hyd_rad**1.33333)) 327 322 Q_outlet_tailwater = flow_area * culvert_velocity 328 323 329 324 330 325 if local_debug =='true': 331 log.critical('VELOCITY = %s' % str(culvert_velocity))332 log.critical('Outlet Ctrl Q = %s' % str(Q_outlet_tailwater))326 anuga.log.critical('VELOCITY = %s' % str(culvert_velocity)) 327 anuga.log.critical('Outlet Ctrl Q = %s' % str(Q_outlet_tailwater)) 333 328 if self.log_filename is not None: 334 329 s = 'Q_outlet_tailwater = %.6f' %Q_outlet_tailwater … … 336 331 Q = min(Q, Q_outlet_tailwater) 337 332 if local_debug =='true': 338 log.critical('%s,%.3f,%.3f'333 anuga.log.critical('%s,%.3f,%.3f' 339 334 % ('dcrit 1 , dcit2 =',dcrit1,dcrit2)) 340 log.critical('%s,%.3f,%.3f,%.3f'335 anuga.log.critical('%s,%.3f,%.3f,%.3f' 341 336 % ('Q and Velocity and Depth=', Q, 342 337 culvert_velocity, outlet_culvert_depth)) 343 338 344 culv_froude=math.sqrt(Q**2*flow_width/( g*flow_area**3))345 if local_debug =='true': 346 log.critical('FLOW AREA = %s' % str(flow_area))347 log.critical('PERIMETER = %s' % str(perimeter))348 log.critical('Q final = %s' % str(Q))349 log.critical('FROUDE = %s' % str(culv_froude))339 culv_froude=math.sqrt(Q**2*flow_width/(anuga.g*flow_area**3)) 340 if local_debug =='true': 341 anuga.log.critical('FLOW AREA = %s' % str(flow_area)) 342 anuga.log.critical('PERIMETER = %s' % str(perimeter)) 343 anuga.log.critical('Q final = %s' % str(Q)) 344 anuga.log.critical('FROUDE = %s' % str(culv_froude)) 350 345 351 346 # Determine momentum at the outlet 352 barrel_velocity = Q/(flow_area + velocity_protection/flow_area)347 barrel_velocity = Q/(flow_area + anuga.velocity_protection/flow_area) 353 348 354 349 else: # self.inflow.get_average_height() < 0.01:
Note: See TracChangeset
for help on using the changeset viewer.