Ignore:
Timestamp:
Jun 25, 2008, 7:10:21 PM (15 years ago)
Author:
ole
Message:

Finished culvert flow work with a good working solution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/culvert_flows/culvert_class.py

    r5435 r5437  
    9494        if blockage_bottup is None: blockage_bottup=0.00
    9595        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))
    9798       
    9899        # Open log file for storing some specific results...
     
    100101        self.label = label
    101102
    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       
    104114        P = create_culvert_polygons(end_point0,
    105115                                    end_point1,
     
    135145        self.verbose = verbose
    136146        self.last_time = 0.0       
    137         self.temp_keep_delta_t = 0.0
    138147       
    139148
     
    239248                elevation = dq['elevation'].get_values(location='centroids', indices=opening.exchange_indices)
    240249                z = mean(elevation)                   # Average elevation
    241                
     250
    242251            # Estimated depth above the culvert inlet
    243             d = w - z
    244 
     252            d = w - z  # Used for calculations involving depth
    245253            if d < 0.0:
    246254                # This is possible since w and z are taken at different locations
     
    249257                d = 0.0
    250258           
     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
    251269            # Ratio of depth to culvert height.
    252270            # 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 
    254275            opening.ratio = ratio
    255276               
     
    260281            opening.specific_energy = Es           
    261282           
    262             # Store current average stage and depth with each opening object 
     283            # Store current average stage and depth with each opening object
    263284            opening.depth = d
     285            opening.depth_trigger = d_trigger           
    264286            opening.stage = w
    265287            opening.elevation = z
Note: See TracChangeset for help on using the changeset viewer.