Ignore:
Timestamp:
Sep 2, 2010, 11:12:53 AM (14 years ago)
Author:
steve
Message:

Hopefully merged Narimans mannings and Steve velocity and momentum switches

File:
1 edited

Legend:

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

    r7985 r7989  
    2525                 manning=0.013,
    2626                 enquiry_gap=0.2,
     27                 use_momentum_jet=True,
     28                 use_velocity_head=True,
    2729                 verbose=False):
    2830       
     
    4345        self.enquiry_gap = enquiry_gap
    4446        self.verbose = verbose
     47
     48        self.use_momentum_jet = use_momentum_jet
     49        self.use_velocity_head= use_velocity_head
    4550       
    4651        self.culvert = Boyd_box_culvert(self.domain,
     
    5156                                        self.manning,
    5257                                        self.enquiry_gap,
     58                                        self.use_velocity_head,
    5359                                        self.verbose)
    5460       
     
    110116
    111117           
    112             outflow_extra_height = Q*timestep_star/outflow.get_area()
    113             outflow_direction = - outflow.outward_culvert_vector
    114             outflow_extra_momentum = outflow_extra_height*barrel_speed*outflow_direction
    115            
    116 
    117             gain = outflow_extra_height*outflow.get_area()
    118            
    119             #print Q, Q*timestep, barrel_speed, outlet_depth, Qstar, factor, timestep_star
    120             #print '  ', loss, gain
    121 
    122 
    123             new_outflow_height = outflow.get_average_height() + outflow_extra_height
    124             new_outflow_xmom = outflow.get_average_xmom() + outflow_extra_momentum[0]
    125             new_outflow_ymom = outflow.get_average_ymom() + outflow_extra_momentum[1]
    126 
    127             outflow.set_heights(new_outflow_height)
    128 
    129             outflow.set_xmoms(barrel_speed*new_outflow_height*outflow_direction[0])
    130             outflow.set_ymoms(barrel_speed*new_outflow_height*outflow_direction[1])
    131 
    132             #outflow.set_xmoms(new_outflow_xmom)
    133             #outflow.set_ymoms(new_outflow_ymom)
    134            
    135             #print '   outflow volume ',outflow.get_total_water_volume()
     118        outflow_extra_height = Q*timestep_star/outflow.get_area()
     119        outflow_direction = - outflow.outward_culvert_vector
     120        outflow_extra_momentum = outflow_extra_height*barrel_speed*outflow_direction
     121           
     122
     123        gain = outflow_extra_height*outflow.get_area()
     124           
     125        #print Q, Q*timestep, barrel_speed, outlet_depth, Qstar, factor, timestep_star
     126        #print '  ', loss, gain
     127
     128
     129
     130        new_outflow_height = outflow.get_average_height() + outflow_extra_height
     131
     132
     133        if self.use_momentum_jet :
     134            # FIXME (SR) Review momentum to account for possible hydraulic jumps at outlet
     135            #new_outflow_xmom = outflow.get_average_xmom() + outflow_extra_momentum[0]
     136            #new_outflow_ymom = outflow.get_average_ymom() + outflow_extra_momentum[1]
     137
     138            new_outflow_xmom = barrel_speed*new_outflow_height*outflow_direction[0]
     139            new_outflow_ymom = barrel_speed*new_outflow_height*outflow_direction[1]
     140
     141        else:
     142            #new_outflow_xmom = outflow.get_average_xmom()
     143            #new_outflow_ymom = outflow.get_average_ymom()
     144
     145            new_outflow_xmom = 0.0
     146            new_outflow_ymom = 0.0
     147
     148
     149        outflow.set_heights(new_outflow_height)
     150        outflow.set_xmoms(new_outflow_xmom)
     151        outflow.set_ymoms(new_outflow_ymom)
     152
     153
     154           
     155        #print '   outflow volume ',outflow.get_total_water_volume()
    136156
    137157    def print_stats(self):
Note: See TracChangeset for help on using the changeset viewer.