Changeset 5437
- Timestamp:
- Jun 25, 2008, 7:10:21 PM (16 years ago)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/culvert_flows/culvert_class.py
r5435 r5437 94 94 if blockage_bottup is None: blockage_bottup=0.00 95 95 if culvert_routine is None: culvert_routine=boyd_generalised_culvert_model 96 if label is None: label = 'culvert_flow_' + id(self) 96 if label is None: label = 'culvert_flow' 97 label += '_' + str(id(self)) 97 98 98 99 # Open log file for storing some specific results... … … 100 101 self.label = label 101 102 102 103 # Create the fundamental culvert polygons from POLYGON 103 # Print something 104 log_to_file(self.log_filename, self.label) 105 log_to_file(self.log_filename, description) 106 log_to_file(self.log_filename, self.culvert_type) 107 108 109 # Create the fundamental culvert polygons from POLYGON 110 if self.culvert_type == 'circle': 111 # Redefine width and height for use with create_culvert_polygons 112 width = height = diameter 113 104 114 P = create_culvert_polygons(end_point0, 105 115 end_point1, … … 135 145 self.verbose = verbose 136 146 self.last_time = 0.0 137 self.temp_keep_delta_t = 0.0138 147 139 148 … … 239 248 elevation = dq['elevation'].get_values(location='centroids', indices=opening.exchange_indices) 240 249 z = mean(elevation) # Average elevation 241 250 242 251 # Estimated depth above the culvert inlet 243 d = w - z 244 252 d = w - z # Used for calculations involving depth 245 253 if d < 0.0: 246 254 # This is possible since w and z are taken at different locations … … 249 257 d = 0.0 250 258 259 260 261 # Depth at exchange area used to trigger calculations 262 stage = dq['stage'].get_values(location='centroids', indices=enquiry_indices) 263 elevation = dq['elevation'].get_values(location='centroids', indices=enquiry_indices) 264 depth = stage - elevation 265 d_trigger = mean(depth) 266 267 268 251 269 # Ratio of depth to culvert height. 252 270 # If ratio > 1 then culvert is running full 253 ratio = d/self.height 271 if self.culvert_type == 'circle': 272 ratio = d/self.diameter 273 else: 274 ratio = d/self.height 254 275 opening.ratio = ratio 255 276 … … 260 281 opening.specific_energy = Es 261 282 262 # Store current average stage and depth with each opening object 283 # Store current average stage and depth with each opening object 263 284 opening.depth = d 285 opening.depth_trigger = d_trigger 264 286 opening.stage = w 265 287 opening.elevation = z -
anuga_core/source/anuga/culvert_flows/culvert_routines.py
r5436 r5437 58 58 sum_loss = culvert.sum_loss 59 59 length = culvert.length 60 61 if inlet.depth >= 0.01:60 61 if inlet.depth_trigger >= 0.01 and inlet.depth >= 0.01: 62 62 # Calculate driving energy 63 63 E = inlet.specific_energy … … 91 91 outlet_culvert_depth = inlet.depth 92 92 width = diameter*sin(alpha) 93 perimeter = alpha*diameter93 #perimeter = alpha*diameter 94 94 case = 'Inlet unsubmerged' 95 95 else: … … 98 98 outlet_culvert_depth = diameter 99 99 width = diameter 100 perimeter = diameter100 #perimeter = diameter 101 101 case = 'Inlet submerged' 102 102 … … 129 129 case = 'Outlet is open channel flow' 130 130 131 hyd_rad = flow_area/perimeter 132 s = 'hydraulic radius at outlet = %f' %hyd_rad 133 log_to_file(log_filename, s) 134 135 # Outlet control velocity using tail water 136 culvert_velocity = sqrt(delta_Et/((sum_loss/2*g)+(manning**2*length)/hyd_rad**1.33333)) 137 Q_outlet_tailwater = flow_area * culvert_velocity 138 139 s = 'Q_outlet_tailwater = %.6f' %Q_outlet_tailwater 140 log_to_file(log_filename, s) 141 Q = min(Q, Q_outlet_tailwater) 142 143 131 144 132 145 else: … … 148 161 flow_area = width*inlet.depth 149 162 outlet_culvert_depth = inlet.depth 150 perimeter=(width+2.0*inlet.depth)163 #perimeter=(width+2.0*inlet.depth) 151 164 case = 'Inlet unsubmerged' 152 165 else: … … 154 167 flow_area = width*height 155 168 outlet_culvert_depth = height 156 perimeter=2.0*(width+height)169 #perimeter=2.0*(width+height) 157 170 case = 'Inlet submerged' 158 171 … … 176 189 perimeter=(width+2.0*outlet.depth) 177 190 case = 'Outlet is open channel flow' 178 179 180 181 182 # Common code for rectangular and circular culvert types 183 hyd_rad = flow_area/perimeter 184 s = 'hydraulic radius at outlet = %f' %hyd_rad 185 log_to_file(log_filename, s) 186 187 # Outlet control velocity using tail water 188 culvert_velocity = sqrt(delta_Et/((sum_loss/2*g)+(manning**2*length)/hyd_rad**1.33333)) 189 Q_outlet_tailwater = flow_area * culvert_velocity 190 191 s = 'Q_outlet_tailwater = %.6f' %Q_outlet_tailwater 192 log_to_file(log_filename, s) 193 Q = min(Q, Q_outlet_tailwater) 194 191 192 hyd_rad = flow_area/perimeter 193 s = 'hydraulic radius at outlet = %f' %hyd_rad 194 log_to_file(log_filename, s) 195 196 # Outlet control velocity using tail water 197 culvert_velocity = sqrt(delta_Et/((sum_loss/2*g)+(manning**2*length)/hyd_rad**1.33333)) 198 Q_outlet_tailwater = flow_area * culvert_velocity 199 200 s = 'Q_outlet_tailwater = %.6f' %Q_outlet_tailwater 201 log_to_file(log_filename, s) 202 Q = min(Q, Q_outlet_tailwater) 203 204 205 # Common code for circle and square geometries 195 206 log_to_file(log_filename, 'Case: "%s"' %case) 196 197 207 flow_rate_control=Q 198 208 … … 209 219 # Determine momentum at the outlet 210 220 barrel_velocity = Q/(flow_area + velocity_protection/flow_area) 221 222 211 223 else: #inlet.depth < 0.01: 212 224 Q = barrel_velocity = outlet_culvert_depth = 0.0 -
anuga_work/development/culvert_flow/culvert_boyd_channel.py
r5436 r5437 219 219 # Close 220 220 221 fid.close()222 221 223 222
Note: See TracChangeset
for help on using the changeset viewer.