Changeset 5437 for anuga_core/source/anuga/culvert_flows/culvert_class.py
- Timestamp:
- Jun 25, 2008, 7:10:21 PM (15 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.