Changeset 6676


Ignore:
Timestamp:
Apr 1, 2009, 1:12:32 PM (15 years ago)
Author:
ole
Message:

Added Culvert tests from Petar Milevsky - all bar one are disabled with a preceding X for the time being as they don't pass yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/culvert_flows/test_culvert_routines.py

    r6675 r6676  
    112112        #assert num.allclose(d, 0.0)
    113113       
     114
     115
     116    def Xtest_boyd_1(self):
     117        """test_boyd_1
     118       
     119        This tests the Boyd routine with data obtained from ??? by Petar Milevski   
     120        """
     121        # FIXME(Ole): This test fails (20 Feb 2009)
     122
     123        g=9.81
     124        culvert_slope=0.01  # Downward
     125
     126        inlet_depth=0.263
     127        outlet_depth=0.0
     128
     129        culvert_length=4.0
     130        culvert_width=0.75
     131        culvert_height=0.75
     132       
     133        culvert_type='pipe'
     134        manning=0.013
     135        sum_loss=1.5
     136
     137        inlet_specific_energy=inlet_depth #+0.5*v**2/g
     138        z_in = 0.0
     139        z_out = -culvert_length*culvert_slope/100
     140        E_in = z_in+inlet_depth  #+ 0.5*v**2/g
     141        E_out = z_out+outlet_depth  #+ 0.5*v**2/g
     142        delta_total_energy = E_in-E_out
     143
     144        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
     145                                                 outlet_depth,
     146                                                 inlet_specific_energy,
     147                                                 delta_total_energy,
     148                                                 g,
     149                                                 culvert_length,
     150                                                 culvert_width,
     151                                                 culvert_height,
     152                                                 culvert_type,
     153                                                 manning,
     154                                                 sum_loss)
     155       
     156        print Q, v, d
     157        assert num.allclose(Q, 0.10, rtol=1.0e-2) #inflow
     158        assert num.allclose(v, 1.13, rtol=1.0e-2) #outflow velocity
     159        assert num.allclose(d, 0.15, rtol=1.0e-2) #depth at outlet used to calc v
     160       
     161    def Xtest_boyd_2(self):
     162        """test_boyd_2
     163       
     164        This tests the Boyd routine with data obtained from ??? by Petar Milevski   
     165        """
     166        # FIXME(Ole): This test fails (20 Feb 2009)
     167
     168        g=9.81
     169        culvert_slope=0.01  # Downward
     170
     171        inlet_depth=1.135
     172        outlet_depth=0.0
     173
     174        culvert_length=4.0
     175        culvert_width=0.75
     176        culvert_height=0.75
     177       
     178        culvert_type='pipe'
     179        manning=0.013
     180        sum_loss=1.5
     181
     182        inlet_specific_energy=inlet_depth #+0.5*v**2/g
     183        z_in = 0.0
     184        z_out = -culvert_length*culvert_slope/100
     185        E_in = z_in+inlet_depth  #+ 0.5*v**2/g
     186        E_out = z_out+outlet_depth  #+ 0.5*v**2/g
     187        delta_total_energy = E_in-E_out
     188
     189        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
     190                                                 outlet_depth,
     191                                                 inlet_specific_energy,
     192                                                 delta_total_energy,
     193                                                 g,
     194                                                 culvert_length,
     195                                                 culvert_width,
     196                                                 culvert_height,
     197                                                 culvert_type,
     198                                                 manning,
     199                                                 sum_loss)
     200       
     201        print Q, v, d
     202        assert num.allclose(Q, 1.00, rtol=1.0e-2) #inflow
     203        assert num.allclose(v, 2.59, rtol=1.0e-2) #outflow velocity
     204        assert num.allclose(d, 0.563, rtol=1.0e-2) #depth at outlet used to calc v 
     205
     206    def Xtest_boyd_3(self):
     207        """test_boyd_3
     208       
     209        This tests the Boyd routine with data obtained from ??? by Petar Milevski   
     210        """
     211        # FIXME(Ole): This test fails (20 Feb 2009)
     212
     213        g=9.81
     214        culvert_slope=0.01  # Downward
     215
     216        inlet_depth=12.747
     217        outlet_depth=0.0
     218
     219        culvert_length=4.0
     220        culvert_width=0.75
     221        culvert_height=0.75
     222       
     223        culvert_type='pipe'
     224        manning=0.013
     225        sum_loss=1.5
     226
     227        inlet_specific_energy=inlet_depth #+0.5*v**2/g
     228        z_in = 0.0
     229        z_out = -culvert_length*culvert_slope/100
     230        E_in = z_in+inlet_depth  #+ 0.5*v**2/g
     231        E_out = z_out+outlet_depth  #+ 0.5*v**2/g
     232        delta_total_energy = E_in-E_out
     233
     234        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
     235                                                 outlet_depth,
     236                                                 inlet_specific_energy,
     237                                                 delta_total_energy,
     238                                                 g,
     239                                                 culvert_length,
     240                                                 culvert_width,
     241                                                 culvert_height,
     242                                                 culvert_type,
     243                                                 manning,
     244                                                 sum_loss)
     245       
     246        print Q, v, d
     247        assert num.allclose(Q, 5.00, rtol=1.0e-2) #inflow
     248        assert num.allclose(v, 11.022, rtol=1.0e-2) #outflow velocity
     249        assert num.allclose(d, 0.72, rtol=1.0e-2) #depth at outlet used to calc v
     250
     251    def Xtest_boyd_4(self):
     252        """test_boyd_4
     253       
     254        This tests the Boyd routine with data obtained from ??? by Petar Milevski   
     255        """
     256        # FIXME(Ole): This test fails (20 Feb 2009)
     257
     258        g=9.81
     259        culvert_slope=0.01  # Downward
     260
     261        inlet_depth=1.004
     262        outlet_depth=1.00
     263
     264        culvert_length=4.0
     265        culvert_width=0.75
     266        culvert_height=0.75
     267       
     268        culvert_type='pipe'
     269        manning=0.013
     270        sum_loss=1.5
     271
     272        inlet_specific_energy=inlet_depth #+0.5*v**2/g
     273        z_in = 0.0
     274        z_out = -culvert_length*culvert_slope/100
     275        E_in = z_in+inlet_depth  #+ 0.5*v**2/g
     276        E_out = z_out+outlet_depth  #+ 0.5*v**2/g
     277        delta_total_energy = E_in-E_out
     278
     279        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
     280                                                 outlet_depth,
     281                                                 inlet_specific_energy,
     282                                                 delta_total_energy,
     283                                                 g,
     284                                                 culvert_length,
     285                                                 culvert_width,
     286                                                 culvert_height,
     287                                                 culvert_type,
     288                                                 manning,
     289                                                 sum_loss)
     290       
     291        print Q, v, d
     292        assert num.allclose(Q, 0.10, rtol=1.0e-2) #inflow
     293        assert num.allclose(v, 0.22, rtol=1.0e-2) #outflow velocity
     294        assert num.allclose(d, 0.76, rtol=1.0e-2) #depth at outlet used to calc v
     295
     296    def Xtest_boyd_5(self):
     297        """test_boyd_5
     298       
     299        This tests the Boyd routine with data obtained from ??? by Petar Milevski   
     300        """
     301        # FIXME(Ole): This test fails (20 Feb 2009)
     302
     303        g=9.81
     304        culvert_slope=0.01  # Downward
     305
     306        inlet_depth=1.401
     307        outlet_depth=1.00
     308
     309        culvert_length=4.0
     310        culvert_width=0.75
     311        culvert_height=0.75
     312       
     313        culvert_type='pipe'
     314        manning=0.013
     315        sum_loss=1.5
     316
     317        inlet_specific_energy=inlet_depth #+0.5*v**2/g
     318        z_in = 0.0
     319        z_out = -culvert_length*culvert_slope/100
     320        E_in = z_in+inlet_depth  #+ 0.5*v**2/g
     321        E_out = z_out+outlet_depth  #+ 0.5*v**2/g
     322        delta_total_energy = E_in-E_out
     323
     324        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
     325                                                 outlet_depth,
     326                                                 inlet_specific_energy,
     327                                                 delta_total_energy,
     328                                                 g,
     329                                                 culvert_length,
     330                                                 culvert_width,
     331                                                 culvert_height,
     332                                                 culvert_type,
     333                                                 manning,
     334                                                 sum_loss)
     335       
     336        print Q, v, d
     337        assert num.allclose(Q, 1.00, rtol=1.0e-2) #inflow
     338        assert num.allclose(v, 2.204, rtol=1.0e-2) #outflow velocity
     339        assert num.allclose(d, 0.76, rtol=1.0e-2) #depth at outlet used to calc v
     340
     341
     342    def Xtest_boyd_6(self):
     343        """test_boyd_5
     344       
     345        This tests the Boyd routine with data obtained from ??? by Petar Milevski   
     346        """
     347        # FIXME(Ole): This test fails (20 Feb 2009)
     348
     349        g=9.81
     350        culvert_slope=0.01  # Downward
     351
     352        inlet_depth=12.747
     353        outlet_depth=1.00
     354
     355        culvert_length=4.0
     356        culvert_width=0.75
     357        culvert_height=0.75
     358       
     359        culvert_type='pipe'
     360        manning=0.013
     361        sum_loss=1.5
     362
     363        inlet_specific_energy=inlet_depth #+0.5*v**2/g
     364        z_in = 0.0
     365        z_out = -culvert_length*culvert_slope/100
     366        E_in = z_in+inlet_depth  #+ 0.5*v**2/g
     367        E_out = z_out+outlet_depth  #+ 0.5*v**2/g
     368        delta_total_energy = E_in-E_out
     369
     370        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
     371                                                 outlet_depth,
     372                                                 inlet_specific_energy,
     373                                                 delta_total_energy,
     374                                                 g,
     375                                                 culvert_length,
     376                                                 culvert_width,
     377                                                 culvert_height,
     378                                                 culvert_type,
     379                                                 manning,
     380                                                 sum_loss)
     381       
     382        print Q, v, d
     383        assert num.allclose(Q, 5.00, rtol=1.0e-2) #inflow
     384        assert num.allclose(v, 11.022, rtol=1.0e-2) #outflow velocity
     385        assert num.allclose(d, 0.76, rtol=1.0e-2) #depth at outlet used to calc v
     386
     387
     388    def Xtest_boyd_7(self):
     389        """test_boyd_7
     390       
     391        This tests the Boyd routine with data obtained from ??? by Petar Milevski   
     392        """
     393        # FIXME(Ole): This test fails (20 Feb 2009)
     394
     395        g=9.81
     396        culvert_slope=0.1  # Downward
     397
     398        inlet_depth=0.303
     399        outlet_depth=0.00
     400
     401        culvert_length=4.0
     402        culvert_width=0.75
     403        culvert_height=0.75
     404       
     405        culvert_type='pipe'
     406        manning=0.013
     407        sum_loss=1.5
     408
     409        inlet_specific_energy=inlet_depth #+0.5*v**2/g
     410        z_in = 0.0
     411        z_out = -culvert_length*culvert_slope/100
     412        E_in = z_in+inlet_depth  #+ 0.5*v**2/g
     413        E_out = z_out+outlet_depth  #+ 0.5*v**2/g
     414        delta_total_energy = E_in-E_out
     415
     416        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
     417                                                 outlet_depth,
     418                                                 inlet_specific_energy,
     419                                                 delta_total_energy,
     420                                                 g,
     421                                                 culvert_length,
     422                                                 culvert_width,
     423                                                 culvert_height,
     424                                                 culvert_type,
     425                                                 manning,
     426                                                 sum_loss)
     427       
     428        print Q, v, d
     429        assert num.allclose(Q, 0.10, rtol=1.0e-2) #inflow
     430        assert num.allclose(v, 1.13, rtol=1.0e-2) #outflow velocity
     431        assert num.allclose(d, 0.19, rtol=1.0e-2) #depth at outlet used to calc v
     432
     433
     434    def Xtest_boyd_8(self):
     435        """test_boyd_8
     436       
     437        This tests the Boyd routine with data obtained from ??? by Petar Milevski   
     438        """
     439        # FIXME(Ole): This test fails (20 Feb 2009)
     440
     441        g=9.81
     442        culvert_slope=0.1  # Downward
     443
     444        inlet_depth=1.135
     445        outlet_depth=0.00
     446
     447        culvert_length=4.0
     448        culvert_width=0.75
     449        culvert_height=0.75
     450       
     451        culvert_type='pipe'
     452        manning=0.013
     453        sum_loss=1.5
     454
     455        inlet_specific_energy=inlet_depth #+0.5*v**2/g
     456        z_in = 0.0
     457        z_out = -culvert_length*culvert_slope/100
     458        E_in = z_in+inlet_depth  #+ 0.5*v**2/g
     459        E_out = z_out+outlet_depth  #+ 0.5*v**2/g
     460        delta_total_energy = E_in-E_out
     461
     462        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
     463                                                 outlet_depth,
     464                                                 inlet_specific_energy,
     465                                                 delta_total_energy,
     466                                                 g,
     467                                                 culvert_length,
     468                                                 culvert_width,
     469                                                 culvert_height,
     470                                                 culvert_type,
     471                                                 manning,
     472                                                 sum_loss)
     473       
     474        print Q, v, d
     475        assert num.allclose(Q, 1.00, rtol=1.0e-2) #inflow
     476        assert num.allclose(v, 2.204, rtol=1.0e-2) #outflow velocity
     477        assert num.allclose(d, 0.76, rtol=1.0e-2) #depth at outlet used to calc v
     478
     479    def Xtest_boyd_9(self):
     480        """test_boyd_9
     481       
     482        This tests the Boyd routine with data obtained from ??? by Petar Milevski   
     483        """
     484        # FIXME(Ole): This test fails (20 Feb 2009)
     485
     486        g=9.81
     487        culvert_slope=0.1  # Downward
     488
     489        inlet_depth=1.1504
     490        outlet_depth=1.5
     491
     492        culvert_length=4.0
     493        culvert_width=0.75
     494        culvert_height=0.75
     495       
     496        culvert_type='pipe'
     497        manning=0.013
     498        sum_loss=1.5
     499
     500        inlet_specific_energy=inlet_depth #+0.5*v**2/g
     501        z_in = 0.0
     502        z_out = -culvert_length*culvert_slope/100
     503        E_in = z_in+inlet_depth  #+ 0.5*v**2/g
     504        E_out = z_out+outlet_depth  #+ 0.5*v**2/g
     505        delta_total_energy = E_in-E_out
     506
     507        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
     508                                                 outlet_depth,
     509                                                 inlet_specific_energy,
     510                                                 delta_total_energy,
     511                                                 g,
     512                                                 culvert_length,
     513                                                 culvert_width,
     514                                                 culvert_height,
     515                                                 culvert_type,
     516                                                 manning,
     517                                                 sum_loss)
     518       
     519        print Q, v, d
     520        assert num.allclose(Q, 0.10, rtol=1.0e-2) #inflow
     521        assert num.allclose(v, 0.22, rtol=1.0e-2) #outflow velocity
     522        assert num.allclose(d, 0.76, rtol=1.0e-2) #depth at outlet used to calc v
     523
     524
     525    def Xtest_boyd_10(self):
     526        """test_boyd_9
     527       
     528        This tests the Boyd routine with data obtained from ??? by Petar Milevski   
     529        """
     530        # FIXME(Ole): This test fails (20 Feb 2009)
     531
     532        g=9.81
     533        culvert_slope=0.1  # Downward
     534
     535        inlet_depth=1.901
     536        outlet_depth=1.5
     537
     538        culvert_length=4.0
     539        culvert_width=0.75
     540        culvert_height=0.75
     541       
     542        culvert_type='pipe'
     543        manning=0.013
     544        sum_loss=1.5
     545
     546        inlet_specific_energy=inlet_depth #+0.5*v**2/g
     547        z_in = 0.0
     548        z_out = -culvert_length*culvert_slope/100
     549        E_in = z_in+inlet_depth  #+ 0.5*v**2/g
     550        E_out = z_out+outlet_depth  #+ 0.5*v**2/g
     551        delta_total_energy = E_in-E_out
     552
     553        Q, v, d = boyd_generalised_culvert_model(inlet_depth,
     554                                                 outlet_depth,
     555                                                 inlet_specific_energy,
     556                                                 delta_total_energy,
     557                                                 g,
     558                                                 culvert_length,
     559                                                 culvert_width,
     560                                                 culvert_height,
     561                                                 culvert_type,
     562                                                 manning,
     563                                                 sum_loss)
     564       
     565        print Q, v, d
     566        assert num.allclose(Q, 1.00, rtol=1.0e-2) #inflow
     567        assert num.allclose(v, 2.204, rtol=1.0e-2) #outflow velocity
     568        assert num.allclose(d, 0.76, rtol=1.0e-2) #depth at outlet used to calc v
    114569   
    115570               
Note: See TracChangeset for help on using the changeset viewer.