Ignore:
Timestamp:
Sep 7, 2010, 9:17:12 PM (12 years ago)
Author:
habili
Message:

Deleting unnecessary structure test scripts

File:
1 edited

Legend:

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

    r8001 r8008  
    6666        self.discharge = 0.0
    6767        self.velocity = 0.0
    68        
    69        
    70     def __call__(self):
    71        
    72         timestep = self.domain.get_timestep()
    73        
    74         self.__determine_inflow_outflow()
    75        
    76         Q, barrel_speed, outlet_depth = self.__discharge_routine()
    77 
    78         old_inflow_height = self.inflow.get_average_height()
    79         old_inflow_xmom = self.inflow.get_average_xmom()
    80         old_inflow_ymom = self.inflow.get_average_ymom()
    81            
    82         if old_inflow_height > 0.0 :
    83                 Qstar = Q/old_inflow_height
    84         else:
    85                 Qstar = 0.0
    86 
    87         factor = 1.0/(1.0 + Qstar*timestep/self.inflow.get_area())
    88 
    89         new_inflow_height = old_inflow_height*factor
    90         new_inflow_xmom = old_inflow_xmom*factor
    91         new_inflow_ymom = old_inflow_ymom*factor
    92            
    93 
    94         self.inflow.set_heights(new_inflow_height)
    95 
    96         #inflow.set_xmoms(Q/inflow.get_area())
    97         #inflow.set_ymoms(0.0)
    98 
    99 
    100         self.inflow.set_xmoms(new_inflow_xmom)
    101         self.inflow.set_ymoms(new_inflow_ymom)
    102 
    103 
    104         loss = (old_inflow_height - new_inflow_height)*self.inflow.get_area()
    105 
    106            
    107         # set outflow
    108         if old_inflow_height > 0.0 :
    109                 timestep_star = timestep*new_inflow_height/old_inflow_height
    110         else:
    111             timestep_star = 0.0
    112 
    113            
    114         outflow_extra_height = Q*timestep_star/self.outflow.get_area()
    115         outflow_direction = - self.outflow.outward_culvert_vector
    116         outflow_extra_momentum = outflow_extra_height*barrel_speed*outflow_direction
    117            
    118 
    119         gain = outflow_extra_height*self.outflow.get_area()
    120            
    121         #print Q, Q*timestep, barrel_speed, outlet_depth, Qstar, factor, timestep_star
    122         #print '  ', loss, gain
    123 
    124         # Stats
    125         self.discharge  = Q#outflow_extra_height*self.outflow.get_area()/timestep
    126         self.velocity = barrel_speed#self.discharge/outlet_depth/self.width
    127 
    128         new_outflow_height = self.outflow.get_average_height() + outflow_extra_height
    129 
    130         if self.use_momentum_jet :
    131             # FIXME (SR) Review momentum to account for possible hydraulic jumps at outlet
    132             #new_outflow_xmom = outflow.get_average_xmom() + outflow_extra_momentum[0]
    133             #new_outflow_ymom = outflow.get_average_ymom() + outflow_extra_momentum[1]
    134 
    135             new_outflow_xmom = barrel_speed*new_outflow_height*outflow_direction[0]
    136             new_outflow_ymom = barrel_speed*new_outflow_height*outflow_direction[1]
    137 
    138         else:
    139             #new_outflow_xmom = outflow.get_average_xmom()
    140             #new_outflow_ymom = outflow.get_average_ymom()
    141 
    142             new_outflow_xmom = 0.0
    143             new_outflow_ymom = 0.0
    144 
    145 
    146         self.outflow.set_heights(new_outflow_height)
    147         self.outflow.set_xmoms(new_outflow_xmom)
    148         self.outflow.set_ymoms(new_outflow_ymom)
    149 
    150 
    151     def __determine_inflow_outflow(self):
    152         # Determine flow direction based on total energy difference
    153 
    154         if self.use_velocity_head:
    155             self.delta_total_energy = self.inlets[0].get_enquiry_total_energy() - self.inlets[1].get_enquiry_total_energy()
    156         else:
    157             self.delta_total_energy = self.inlets[0].get_enquiry_stage() - self.inlets[1].get_enquiry_stage()
    158 
    159 
    160         self.inflow  = self.inlets[0]
    161         self.outflow = self.inlets[1]
    162        
    163 
    164         if self.delta_total_energy < 0:
    165             self.inflow  = self.inlets[1]
    166             self.outflow = self.inlets[0]
    167             self.delta_total_energy = -self.delta_total_energy
    16868
    16969   
    170     def __discharge_routine(self):
     70    def discharge_routine(self):
    17171
    17272        local_debug ='false'
Note: See TracChangeset for help on using the changeset viewer.