Changeset 7995


Ignore:
Timestamp:
Sep 2, 2010, 4:01:03 PM (8 years ago)
Author:
steve
Message:

Added stats

Location:
trunk/anuga_core/source/anuga/structures
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/structures/boyd_box_operator.py

    r7993 r7995  
    4848        self.culvert_height = self.get_culvert_height()
    4949
     50
    5051        self.sum_loss = 0.0
    5152        self.max_velocity = 10.0
    5253        self.log_filename = None
    53        
     54
    5455        self.inlets = self.get_inlets()
     56
     57
     58        # Stats
     59       
     60        self.discharge = 0.0
     61        self.velocity = 0.0
    5562       
    5663       
     
    111118        #print Q, Q*timestep, barrel_speed, outlet_depth, Qstar, factor, timestep_star
    112119        #print '  ', loss, gain
     120
     121        # Stats
     122        self.discharge  = outflow_extra_height*self.outflow.get_area()/timestep
     123        self.velocity = self.discharge/outlet_depth/self.width
    113124
    114125        new_outflow_height = self.outflow.get_average_height() + outflow_extra_height
  • trunk/anuga_core/source/anuga/structures/structure_operator.py

    r7993 r7995  
    66
    77class Structure_operator:
    8     """Culvert flow - transfer water from one rectangular box to another.
     8    """Structure Operator - transfer water from one rectangular box to another.
    99    Sets up the geometry of problem
    1010   
     
    4343        self.enquiry_gap = enquiry_gap
    4444        self.verbose = verbose
     45
     46        self.discharge = 0.0
     47        self.velocity = 0.0
    4548       
    4649        self.__create_exchange_polygons()
     
    149152        print '====================================='
    150153
    151                        
     154
     155    def structure_statistics(self):
     156
     157        message = '---------------------------\n'
     158        message += 'Structure report:\n'
     159        message += '--------------------------\n'
     160        message += 'Discharge [m^3/s]: %.2f\n' % self.discharge
     161        message += 'Velocity  [m/s]: %.2f\n' % self.velocity
     162#        message += 'Total boundary outflow [m^3/s]: %.2f\n' % total_boundary_outflow
     163#        message += 'Net boundary flow by tags [m^3/s]\n'
     164#        for tag in boundary_flows:
     165#            message += '    %s [m^3/s]: %.2f\n' % (tag, boundary_flows[tag])
     166#
     167#        message += 'Total net boundary flow [m^3/s]: %.2f\n' % \
     168#                    (total_boundary_inflow + total_boundary_outflow)
     169#        message += 'Total volume in domain [m^3]: %.2f\n' % \
     170#                    self.compute_total_volume()
     171#
     172#        # The go through explicit forcing update and record the rate of change
     173#        # for stage and
     174#        # record into forcing_inflow and forcing_outflow. Finally compute
     175#        # integral of depth to obtain total volume of domain.
     176#
     177        # FIXME(Ole): This part is not yet done.
     178
     179        return message
     180
    152181    def get_inlets(self):
    153182       
  • trunk/anuga_core/source/anuga/structures/testing_wide_bridge.py

    r7994 r7995  
    256256    print domain.timestepping_statistics()
    257257    print domain.volumetric_balance_statistics()
     258    for culvert in culverts:
     259        print culvert.structure_statistics()
    258260   
    259261
Note: See TracChangeset for help on using the changeset viewer.