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_pipe_operator.py

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