Changeset 7985
- Timestamp:
- Sep 2, 2010, 9:51:03 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/structures/culvert_operator.py
r7984 r7985 14 14 Input: Two points, pipe_size (either diameter or width, height), 15 15 mannings_rougness, 16 """ 16 """ 17 17 18 18 def __init__(self, … … 23 23 height=None, 24 24 apron=None, 25 manning=0.013, 25 26 enquiry_gap=0.2, 26 27 verbose=False): … … 39 40 self.height = height 40 41 self.apron = apron 42 self.manning = manning 41 43 self.enquiry_gap = enquiry_gap 42 44 self.verbose = verbose … … 47 49 self.height, 48 50 self.apron, 51 self.manning, 49 52 self.enquiry_gap, 50 53 self.verbose) … … 70 73 71 74 old_inflow_height = inflow.get_average_height() 72 73 74 75 76 Qstar = Q/old_inflow_height77 78 Qstar = 0.079 80 81 82 83 84 85 86 87 75 old_inflow_xmom = inflow.get_average_xmom() 76 old_inflow_ymom = inflow.get_average_ymom() 77 78 if old_inflow_height > 0.0 : 79 Qstar = Q/old_inflow_height 80 else: 81 Qstar = 0.0 82 83 factor = 1.0/(1.0 + Qstar*timestep/inflow.get_area()) 84 85 86 87 new_inflow_height = old_inflow_height*factor 88 new_inflow_xmom = old_inflow_xmom*factor 89 new_inflow_ymom = old_inflow_ymom*factor 90 88 91 89 92 inflow.set_heights(new_inflow_height) … … 99 102 loss = (old_inflow_height - new_inflow_height)*inflow.get_area() 100 103 101 102 103 104 timestep_star = timestep*new_inflow_height/old_inflow_height105 104 105 # set outflow 106 if old_inflow_height > 0.0 : 107 timestep_star = timestep*new_inflow_height/old_inflow_height 108 else: 106 109 timestep_star = 0.0 107 110 108 109 outflow_extra_height = Q*timestep_star/outflow.get_area()110 outflow_direction = - outflow.outward_culvert_vector111 outflow_extra_momentum = outflow_extra_height*barrel_speed*outflow_direction112 113 114 gain = outflow_extra_height*outflow.get_area()115 116 #print Q, Q*timestep, barrel_speed, outlet_depth, Qstar, factor, timestep_star117 #print ' ', loss, gain118 119 120 new_outflow_height = outflow.get_average_height() + outflow_extra_height121 new_outflow_xmom = outflow.get_average_xmom() + outflow_extra_momentum[0]122 new_outflow_ymom = outflow.get_average_ymom() + outflow_extra_momentum[1]123 124 outflow.set_heights(new_outflow_height)125 126 outflow.set_xmoms(barrel_speed*new_outflow_height*outflow_direction[0])127 outflow.set_ymoms(barrel_speed*new_outflow_height*outflow_direction[1])128 129 #outflow.set_xmoms(new_outflow_xmom)130 #outflow.set_ymoms(new_outflow_ymom)131 132 #print ' outflow volume ',outflow.get_total_water_volume()111 112 outflow_extra_height = Q*timestep_star/outflow.get_area() 113 outflow_direction = - outflow.outward_culvert_vector 114 outflow_extra_momentum = outflow_extra_height*barrel_speed*outflow_direction 115 116 117 gain = outflow_extra_height*outflow.get_area() 118 119 #print Q, Q*timestep, barrel_speed, outlet_depth, Qstar, factor, timestep_star 120 #print ' ', loss, gain 121 122 123 new_outflow_height = outflow.get_average_height() + outflow_extra_height 124 new_outflow_xmom = outflow.get_average_xmom() + outflow_extra_momentum[0] 125 new_outflow_ymom = outflow.get_average_ymom() + outflow_extra_momentum[1] 126 127 outflow.set_heights(new_outflow_height) 128 129 outflow.set_xmoms(barrel_speed*new_outflow_height*outflow_direction[0]) 130 outflow.set_ymoms(barrel_speed*new_outflow_height*outflow_direction[1]) 131 132 #outflow.set_xmoms(new_outflow_xmom) 133 #outflow.set_ymoms(new_outflow_ymom) 134 135 #print ' outflow volume ',outflow.get_total_water_volume() 133 136 134 137 def print_stats(self):
Note: See TracChangeset
for help on using the changeset viewer.