def test_boyd_6(self):
        """test_boyd_6
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski    
        """
        # FIXME(Ole): This test fails (20 Feb 2009)

        g=9.81
        culvert_slope=1  # Downward

        inlet_depth=1.50
        inlet_velocity= 4.0
        outlet_depth=0.8
        outlet_velocity=4.0
        culvert_length=10.0
        culvert_width=3.60
        culvert_height=1.20
        
        culvert_type='box'
        manning=0.013
        sum_loss=1.5

        inlet_specific_energy=inlet_depth + 0.5*inlet_velocity**2/g 
        z_in = 10.0
        z_out = 10.0-culvert_length*culvert_slope/100
        E_in = z_in+inlet_depth + 0.5*inlet_velocity**2/g
        E_out = z_out+outlet_depth + 0.5*outlet_velocity**2/g
        delta_total_energy = E_in-E_out



        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
                                                 outlet_depth,
                                                 inlet_velocity,
                                                 outlet_velocity,
                                                 inlet_specific_energy, 
                                                 delta_total_energy, 
                                                 g,
                                                 culvert_length,
                                                 culvert_width,
                                                 culvert_height,
                                                 culvert_type,
                                                 manning,
                                                 sum_loss)        
        #print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy))
        #print ('%s,%.3f'%('Delta E = ',delta_total_energy))
        
        #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST06 Q-v-d',Q,v,d))
        #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',13.546, 3.136, 1.20))
        assert num.allclose(Q, 13.546, rtol=1.0e-2) #inflow
        assert num.allclose(v, 3.136, rtol=1.0e-2) #outflow velocity
        assert num.allclose(d, 1.20, rtol=1.0e-2) #depth at outlet used to calc v
Esempio n. 2
0
    def test_boyd_5(self):
        """test_boyd_5
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski    
        """
        # FIXME(Ole): This test fails (20 Feb 2009)

        g=9.81
        culvert_slope=10  # Downward

        inlet_depth=1.50
        inlet_velocity= 1.0
        outlet_depth=2.5
        outlet_velocity=0.5
        culvert_length=10.0
        culvert_width=0.0
        culvert_height=1.20
        
        culvert_type='circle'
        manning=0.013
        sum_loss=1.5

        inlet_specific_energy=inlet_depth + old_div(0.5*inlet_velocity**2,g) 
        z_in = 10.0
        z_out = 10.0-old_div(culvert_length*culvert_slope,100)
        E_in = z_in+inlet_depth + old_div(0.5*inlet_velocity**2,g)
        E_out = z_out+outlet_depth + old_div(0.5*outlet_velocity**2,g)
        delta_total_energy = E_in-E_out



        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
                                                 outlet_depth,
                                                 inlet_velocity,
                                                 outlet_velocity,
                                                 inlet_specific_energy, 
                                                 delta_total_energy, 
                                                 g,
                                                 culvert_length,
                                                 culvert_width,
                                                 culvert_height,
                                                 culvert_type,
                                                 manning,
                                                 sum_loss)        
        #print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy))
        #print ('%s,%.3f'%('Delta E = ',delta_total_energy))
        
        #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST05 Q-v-d',Q,v,d))
        #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',0.759, 0.671, 1.20))
        assert num.allclose(Q, 0.759, rtol=1.0e-2) #inflow
        assert num.allclose(v, 0.671, rtol=1.0e-2) #outflow velocity
        assert num.allclose(d, 1.20, rtol=1.0e-2) #depth at outlet used to calc v
    def test_boyd_1(self):
        """test_boyd_1
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski    
        """
        # FIXME(Ole): This test fails (20 Feb 2009)

        g=9.81


        inlet_depth=0.150
        outlet_depth=0.15
        inlet_velocity=1.00
        outlet_velocity=0.5
        
        culvert_length=10.0
        culvert_width=3.6
        culvert_height=1.20
        
        culvert_type='box'
        manning=0.013
        sum_loss=1.5

        inlet_specific_energy=inlet_depth + 0.5*inlet_velocity**2/g 
        culvert_slope=1  # % Downward
        z_in = 10.0
        z_out = -culvert_length*culvert_slope/100
        E_in = z_in+inlet_depth + 0.5*inlet_velocity**2/g
        E_out = z_out+outlet_depth + 0.5*outlet_velocity**2/g
        delta_total_energy = E_in-E_out
        inlet_specific_energy=inlet_depth + 0.5*inlet_velocity**2/g 

        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
                                                 outlet_depth,
                                                 inlet_velocity,
                                                 outlet_velocity,
                                                 inlet_specific_energy, 
                                                 delta_total_energy, 
                                                 g,
                                                 culvert_length,
                                                 culvert_width,
                                                 culvert_height,
                                                 culvert_type,
                                                 manning,
                                                 sum_loss)
        
        #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST01 Q-v-d',Q,v,d))
        #print('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.5526, 1.146, 0.1339))
        assert num.allclose(Q, 0.5526, rtol=1.0e-1) #inflow
        assert num.allclose(v, 1.146, rtol=1.0e-1) #outflow velocity
        assert num.allclose(d, 0.1339, rtol=1.0e-1) #depth at outlet used to calc v 
Esempio n. 4
0
    def test_boyd_1(self):
        """test_boyd_1
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski    
        """
        # FIXME(Ole): This test fails (20 Feb 2009)

        g=9.81


        inlet_depth=0.150
        outlet_depth=0.15
        inlet_velocity=1.00
        outlet_velocity=0.5
        
        culvert_length=10.0
        culvert_width=0.0
        culvert_height=1.20
        
        culvert_type='circle'
        manning=0.013
        sum_loss=1.5

        inlet_specific_energy=inlet_depth + old_div(0.5*inlet_velocity**2,g) 
        culvert_slope=10.0  # % Downward
        z_in = 10.0
        z_out = old_div(-culvert_length*culvert_slope,100)
        E_in = z_in+inlet_depth + old_div(0.5*inlet_velocity**2,g)
        E_out = z_out+outlet_depth + old_div(0.5*outlet_velocity**2,g)
        delta_total_energy = E_in-E_out
        inlet_specific_energy=inlet_depth + old_div(0.5*inlet_velocity**2,g) 

        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
                                                 outlet_depth,
                                                 inlet_velocity,
                                                 outlet_velocity,
                                                 inlet_specific_energy, 
                                                 delta_total_energy, 
                                                 g,
                                                 culvert_length,
                                                 culvert_width,
                                                 culvert_height,
                                                 culvert_type,
                                                 manning,
                                                 sum_loss)
        
        #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST01 Q-v-d',Q,v,d))
        #print('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.113, 0.297, 0.443))
        assert num.allclose(Q, 0.113, rtol=1.0e-1) #inflow
        assert num.allclose(v, 0.297, rtol=1.0e-1) #outflow velocity
        assert num.allclose(d, 0.443, rtol=1.0e-1) #depth at outlet used to calc v 
Esempio n. 5
0
    def test_boyd_2(self):
        """test_boyd_2
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski    
        """
        # FIXME(Ole): This test fails (20 Feb 2009)

        g=9.81
        culvert_slope=10  # Downward

        inlet_depth=0.500
        outlet_depth=0.700
        inlet_velocity=1.0
        outlet_velocity=0.50
        
        culvert_length=10.0
        culvert_width=0.0
        culvert_height=1.20
        culvert_width=0.0
        culvert_type='circle'
        manning=0.013
        sum_loss=1.5

        inlet_specific_energy=inlet_depth + 0.5*inlet_velocity**2/g 
        z_in = 0.0
        z_out = -culvert_length*culvert_slope/100
        E_in = z_in+inlet_depth + 0.5*inlet_velocity**2/g
        E_out = z_out+outlet_depth + 0.5*outlet_velocity**2/g
        delta_total_energy = E_in-E_out

        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
                                                 outlet_depth,
                                                 inlet_velocity,
                                                 outlet_velocity,
                                                 inlet_specific_energy, 
                                                 delta_total_energy, 
                                                 g,
                                                 culvert_length,
                                                 culvert_width,
                                                 culvert_height,
                                                 culvert_type,
                                                 manning,
                                                 sum_loss)
        
        #print ('%s,%.2f,%.2f,%.2f' %('ANUGAcalcsTEST02 Q-v-d',Q,v,d))
        #print ('%s,%.2f,%.2f,%.2f' %('Spreadsheet_Boydcalcs', 0.585, 0.873, 0.687))
        assert num.allclose(Q, 0.585, rtol=1.0e-1) #inflow
        assert num.allclose(v, 0.873, rtol=1.0e-1) #outflow velocity
        assert num.allclose(d, 0.687, rtol=1.0e-1) #depth at outlet used to calc v  
    def Xtest_boyd_00(self):
        """test_boyd_00
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski    
        """
        # FIXME(Ole): This test fails (20 Feb 2009)

        g=9.81
        culvert_slope=0.1  # Downward

        inlet_depth=0.2
        outlet_depth=0.0

        inlet_velocity=0.0,
        outlet_velocity=0.0,                
        
        culvert_length=4.0
        culvert_width=1.2
        culvert_height=0.75

        culvert_type='box'
        manning=0.013
        sum_loss=0.0

        inlet_specific_energy=inlet_depth #+0.5*v**2/g 
        z_in = 0.0
        z_out = -culvert_length*culvert_slope/100
        E_in = z_in+inlet_depth # + 
        E_out = z_out+outlet_depth # +
        delta_total_energy = E_in-E_out

        Q, v, d = boyd_generalised_culvert_model(inlet_depth, 
                                                 outlet_depth,
                                                 inlet_velocity,
                                                 outlet_velocity,
                                                 inlet_specific_energy, 
                                                 delta_total_energy, 
                                                 g,
                                                 culvert_length,
                                                 culvert_width,
                                                 culvert_height,
                                                 culvert_type,
                                                 manning,
                                                 sum_loss)
        
        #print Q, v, d
        assert num.allclose(Q, 0.185, rtol=1.0e-3)
    def test_boyd_0(self):
        """test_boyd_0
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski
        This test is the only one that passed in late February 2009
        """
      
        g=9.81
        culvert_slope=0.1  # Downward

        inlet_depth=2.0
        outlet_depth=0.0
        
        inlet_velocity=0.0,
        outlet_velocity=0.0,        

        culvert_length=4.0
        culvert_width=1.2
        culvert_height=0.75

        culvert_type='box'
        manning=0.013
        sum_loss=0.0

        inlet_specific_energy=inlet_depth #+0.5*v**2/g 
        z_in = 0.0
        z_out = -culvert_length*culvert_slope/100
        E_in = z_in+inlet_depth # + 
        E_out = z_out+outlet_depth # +
        delta_total_energy = E_in-E_out

        Q, v, d = boyd_generalised_culvert_model(inlet_depth, 
                                                 outlet_depth,
                                                 inlet_velocity,
                                                 outlet_velocity,
                                                 inlet_specific_energy, 
                                                 delta_total_energy, 
                                                 g,
                                                 culvert_length,
                                                 culvert_width,
                                                 culvert_height,
                                                 culvert_type,
                                                 manning,
                                                 sum_loss)
        
        #print Q, v, d
        assert num.allclose(Q, 3.118, rtol=1.0e-3)
    def Xtest_boyd_2(self):
        """test_boyd_2
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski    
        """
        # FIXME(Ole): This test fails (20 Feb 2009)

        g=9.81
        culvert_slope=0.01  # Downward

        inlet_depth=1.135
        outlet_depth=0.0

        culvert_length=4.0
        culvert_width=0.75
        culvert_height=0.75
        
        culvert_type='pipe'
        manning=0.013
        sum_loss=1.5

        inlet_specific_energy=inlet_depth #+0.5*v**2/g 
        z_in = 0.0
        z_out = -culvert_length*culvert_slope/100
        E_in = z_in+inlet_depth  #+ 0.5*v**2/g
        E_out = z_out+outlet_depth  #+ 0.5*v**2/g
        delta_total_energy = E_in-E_out

        Q, v, d = boyd_generalised_culvert_model(inlet_depth, 
                                                 outlet_depth,
                                                 inlet_velocity,
                                                 outlet_velocity,
                                                 inlet_specific_energy, 
                                                 delta_total_energy, 
                                                 g,
                                                 culvert_length,
                                                 culvert_width,
                                                 culvert_height,
                                                 culvert_type,
                                                 manning,
                                                 sum_loss)
        
        print Q, v, d
        assert num.allclose(Q, 1.00, rtol=1.0e-2) #inflow
        assert num.allclose(v, 2.59, rtol=1.0e-2) #outflow velocity
        assert num.allclose(d, 0.563, rtol=1.0e-2) #depth at outlet used to calc v  
    def test_boyd_6(self):
        """test_boyd_6
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski    
        """
        # FIXME(Ole): This test fails (20 Feb 2009)

        g = 9.81
        culvert_slope = 10  # Downward

        inlet_depth = 1.50
        inlet_velocity = 4.0
        outlet_depth = 0.80
        outlet_velocity = 4.0
        culvert_length = 10.0
        culvert_width = 3.60
        culvert_height = 1.20

        culvert_type = 'box'
        manning = 0.013
        sum_loss = 1.5

        inlet_specific_energy = inlet_depth + 0.5 * inlet_velocity**2 / g
        z_in = 10.0
        z_out = 10.0 - culvert_length * culvert_slope / 100
        E_in = z_in + inlet_depth + 0.5 * inlet_velocity**2 / g
        E_out = z_out + outlet_depth + 0.5 * outlet_velocity**2 / g
        delta_total_energy = E_in - E_out

        Q, v, d = boyd_generalised_culvert_model(
            inlet_depth, outlet_depth, inlet_velocity, outlet_velocity,
            inlet_specific_energy, delta_total_energy, g, culvert_length,
            culvert_width, culvert_height, culvert_type, manning, sum_loss)
        #print ('%s,%.3f'%('SPEC_E = ',inlet_specific_energy))
        #print ('%s,%.3f'%('Delta E = ',delta_total_energy))

        #print ('%s,%.3f,%.3f,%.3f' %('ANUGAcalcsTEST06 Q-v-d',Q,v,d))
        #print ('%s,%.3f,%.3f,%.3f' %('Spreadsheet_Boydcalcs',15.537, 3.597, 1.20))
        assert num.allclose(Q, 15.537, rtol=1.0e-2)  #inflow
        assert num.allclose(v, 3.597, rtol=1.0e-2)  #outflow velocity
        assert num.allclose(d, 1.20,
                            rtol=1.0e-2)  #depth at outlet used to calc v
    def Xtest_boyd_10(self):
        """test_boyd_9
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski    
        """
        # FIXME(Ole): This test fails (20 Feb 2009)

        g = 9.81
        culvert_slope = 0.1  # Downward

        inlet_depth = 1.901
        outlet_depth = 1.5

        culvert_length = 4.0
        culvert_width = 0.75
        culvert_height = 0.75

        culvert_type = 'pipe'
        manning = 0.013
        sum_loss = 1.5

        inlet_specific_energy = inlet_depth  #+0.5*v**2/g
        z_in = 0.0
        z_out = -culvert_length * culvert_slope / 100
        E_in = z_in + inlet_depth  #+ 0.5*v**2/g
        E_out = z_out + outlet_depth  #+ 0.5*v**2/g
        delta_total_energy = E_in - E_out

        Q, v, d = boyd_generalised_culvert_model(inlet_depth, outlet_depth,
                                                 inlet_specific_energy,
                                                 delta_total_energy, g,
                                                 culvert_length, culvert_width,
                                                 culvert_height, culvert_type,
                                                 manning, sum_loss)

        print Q, v, d
        assert num.allclose(Q, 1.00, rtol=1.0e-2)  #inflow
        assert num.allclose(v, 2.204, rtol=1.0e-2)  #outflow velocity
        assert num.allclose(d, 0.76,
                            rtol=1.0e-2)  #depth at outlet used to calc v
    def Xtest_boyd_00(self):
        """test_boyd_00
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski    
        """
        # FIXME(Ole): This test fails (20 Feb 2009)

        g = 9.81
        culvert_slope = 0.1  # Downward

        inlet_depth = 0.2
        outlet_depth = 0.0

        inlet_velocity = 0.0,
        outlet_velocity = 0.0,

        culvert_length = 4.0
        culvert_width = 1.2
        culvert_height = 0.75

        culvert_type = 'box'
        manning = 0.013
        sum_loss = 0.0

        inlet_specific_energy = inlet_depth  #+0.5*v**2/g
        z_in = 0.0
        z_out = -culvert_length * culvert_slope / 100
        E_in = z_in + inlet_depth  # +
        E_out = z_out + outlet_depth  # +
        delta_total_energy = E_in - E_out

        Q, v, d = boyd_generalised_culvert_model(
            inlet_depth, outlet_depth, inlet_velocity, outlet_velocity,
            inlet_specific_energy, delta_total_energy, g, culvert_length,
            culvert_width, culvert_height, culvert_type, manning, sum_loss)

        #print Q, v, d
        assert num.allclose(Q, 0.185, rtol=1.0e-3)
    def test_boyd_0(self):
        """test_boyd_0
        
        This tests the Boyd routine with data obtained from ??? by Petar Milevski
        This test is the only one that passed in late February 2009
        """

        g = 9.81
        culvert_slope = 0.1  # Downward

        inlet_depth = 2.0
        outlet_depth = 0.0

        inlet_velocity = 0.0,
        outlet_velocity = 0.0,

        culvert_length = 4.0
        culvert_width = 1.2
        culvert_height = 0.75

        culvert_type = 'box'
        manning = 0.013
        sum_loss = 0.0

        inlet_specific_energy = inlet_depth  #+0.5*v**2/g
        z_in = 0.0
        z_out = -culvert_length * culvert_slope / 100
        E_in = z_in + inlet_depth  # +
        E_out = z_out + outlet_depth  # +
        delta_total_energy = E_in - E_out

        Q, v, d = boyd_generalised_culvert_model(
            inlet_depth, outlet_depth, inlet_velocity, outlet_velocity,
            inlet_specific_energy, delta_total_energy, g, culvert_length,
            culvert_width, culvert_height, culvert_type, manning, sum_loss)

        #print Q, v, d
        assert num.allclose(Q, 3.118, rtol=1.0e-3)