Changeset 6659


Ignore:
Timestamp:
Mar 31, 2009, 4:52:19 AM (16 years ago)
Author:
ole
Message:

Extended simulation time in flowtests. Computed flows are now within the 1% relative error but the calculated Manning depths are still not in good agreement with actual depth - especially for large values of Manning's n.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py

    r6654 r6659  
    68956895        """
    68966896
     6897        # FIXME(Ole): Move this and the following test to validate_all.py as they are
     6898        # rather time consuming
     6899       
    68976900        verbose = True
    68986901       
     
    69146917        #------------------------------------------------------------------------------
    69156918        number_of_inflows = 2 # Number of inflows on top of each other
    6916         finaltime = 300.0
     6919        finaltime = 1000.0 #6000.0
    69176920
    69186921        length = 300.
    69196922        width  = 20.
    6920         dx = dy = 2          # Resolution: of grid on both axes
     6923        dx = dy = 5          # Resolution: of grid on both axes
    69216924
    69226925        points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),
    69236926                                                       len1=length, len2=width)
    69246927
    6925         for mannings_n in [0.0, 0.012, 0.035, 0.070, 0.150]:
     6928        for mannings_n in [0.150, 0.07, 0.035]: #[0.012, 0.035, 0.070, 0.150]:
    69266929            for slope in [1.0/300, 1.0/150, 1.0/75]:
    69276930                # Loop over a range of bedslopes representing sub to super critical flows
     
    69796982
    69806983                for t in domain.evolve(yieldstep=100.0, finaltime=finaltime):
    6981                     if verbose :
    6982                         print domain.timestepping_statistics()
     6984                    pass
     6985                    #if verbose :
     6986                    #    print domain.timestepping_statistics()
     6987
     6988                if verbose:
     6989                    print domain.volumetric_balance_statistics()                                                           
     6990
    69836991
    69846992
     
    69927000                if verbose:
    69937001                    print '90 degree flowline: ANUGA = %f, Ref = %f' % (q, ref_flow)
    6994                 #assert num.allclose(q, ref_flow, rtol=1.0e-2), msg         
     7002                assert num.allclose(q, ref_flow, rtol=1.0e-2), msg         
    69957003
    69967004                           
     
    70017009                    print '45 degree flowline: ANUGA = %f, Ref = %f' % (q, ref_flow)
    70027010                   
    7003                 #assert num.allclose(q, ref_flow, rtol=1.0e-2), msg         
     7011                assert num.allclose(q, ref_flow, rtol=1.0e-2), msg         
    70047012
    70057013                # Stage recorder (gauge) in middle of plane at 200m
     
    70167024                msg = 'Predicted depth of flow was %f, should have been %f' % (domain_depth, normal_depth)               
    70177025                if verbose:
    7018                     print 'Depth: ANUGA = %f, Mannings = %f' % (domain_depth, normal_depth)
    7019 
     7026                    diff = abs(domain_depth-normal_depth)
     7027                    print 'Depth: ANUGA = %f, Mannings = %f, E=%f' % (domain_depth,
     7028                                                                      normal_depth,
     7029                                                                      diff/domain_depth)
     7030                   
     7031                    assert diff < 0.1
     7032                   
    70207033                if slope >= 1.0/100:
    70217034                    # Really super critical flow is not as stable.
     
    70547067        # Setup computational domain
    70557068        #------------------------------------------------------------------------------
    7056         finaltime = 300.0
     7069        finaltime = 1000.0
    70577070
    70587071        length = 300.
     
    70707083                                                       len1=length, len2=width)
    70717084
    7072         for mannings_n in [0.0, 0.012, 0.035]:
    7073             for slope in [0.0, 1.0/300, 1.0/150]:
     7085        for mannings_n in [0.035]: #[0.0, 0.012, 0.035]:
     7086            for slope in [1.0/300]: #[0.0, 1.0/300, 1.0/150]:
    70747087                # Loop over a range of bedslopes representing sub to super critical flows
    70757088
     
    71307143                        print domain.volumetric_balance_statistics()                       
    71317144                                   
     7145                                   
     7146                   
    71327147                # 90 degree flowline at 200m                                   
    71337148                q=domain.get_flow_through_cross_section([[200.0,0.0],[200.0,20.0]])
     
    71687183                               
    71697184if __name__ == "__main__":
    7170     suite = unittest.makeSuite(Test_Shallow_Water, 'test_friction_dependent_flow_using_flowline')
    7171     #suite = unittest.makeSuite(Test_Shallow_Water, 'test_volumetric_balance_computation')
     7185    #suite = unittest.makeSuite(Test_Shallow_Water, 'test_friction_dependent_flow_using_flowline')
     7186    suite = unittest.makeSuite(Test_Shallow_Water, 'test_inflow')
    71727187    #suite = unittest.makeSuite(Test_Shallow_Water, 'test_total_volume')           
    71737188    #suite = unittest.makeSuite(Test_Shallow_Water, 'test')       
Note: See TracChangeset for help on using the changeset viewer.