- Timestamp:
- Aug 25, 2010, 12:31:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/structures/culvert_operator.py
r7971 r7974 389 389 v = 0.0 390 390 391 v_squared= u**2 + v**2391 uv2 = u**2 + v**2 392 392 393 393 if self.use_velocity_head is True: 394 velocity_head = 0.5* v_squared/g394 velocity_head = 0.5*uv2/g 395 395 else: 396 396 velocity_head = 0.0 397 397 398 total_energies[i] = velocity_head + stage 399 specific_energies[i] = velocity_head + depth 400 velocities[i] = math.sqrt(v_squared) 398 inlet.set_total_energy(velocity_head + stage) 399 inlet.set_specific_energy(velocity_head + depth) 401 400 402 401 # We now need to deal with each opening individually 403 402 # Determine flow direction based on total energy difference 404 delta_total_energy = total_energies[0] - total_energies[1] 403 delta_total_energy = inlets[0].get_total_energy() - inlets[1].get_total_energy() 404 405 405 if delta_total_energy >= 0: 406 406 inlet = inlets[0] 407 407 outlet = inlets[1] 408 408 else: 409 msg = 'Total energy difference is negative' 410 assert delta_total_energy >= 0.0, msg 409 inlet = inlets[1] 410 outlet = inlets[2] 411 412 #msg = 'Total energy difference is negative' 413 #assert delta_total_energy >= 0.0, msg 411 414 412 415 # Recompute slope and issue warning if flow is uphill … … 428 431 429 432 # Determine controlling energy (driving head) for culvert 430 if inlet. specific_energy> delta_total_energy:433 if inlet.get_specific_energy() > delta_total_energy: 431 434 # Outlet control 432 435 driving_head = delta_total_energy 433 436 else: 434 437 # Inlet control 435 driving_head = inlet.specific_energy 436 437 if self.inlet.depth <= self.trigger_depth: 438 driving_head = inlet.get_specific_energy() 439 440 inlet_depth = inlet.get_average_stage() - inlet.get_average_elevation() 441 outlet_depth = outlet.get_average_stage() - outlet.get_average_elevation() 442 443 if inlet_depth <= self.trigger_depth: 438 444 Q = 0.0 439 445 else: … … 471 477 # User culvert routine 472 478 Q, barrel_velocity, culvert_outlet_depth =\ 473 self.culvert_routine(inlet .depth,474 outlet .depth,475 inlet. velocity,476 outlet. velocity,477 inlet. specific_energy,479 self.culvert_routine(inlet_depth, 480 outlet_depth, 481 inlet.get_average_velocity(), 482 outlet.get_average_velocity(), 483 inlet.get_specific_energy(), 478 484 delta_total_energy, 479 485 g,
Note: See TracChangeset
for help on using the changeset viewer.