Changeset 6659
- Timestamp:
- Mar 31, 2009, 4:52:19 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py
r6654 r6659 6895 6895 """ 6896 6896 6897 # FIXME(Ole): Move this and the following test to validate_all.py as they are 6898 # rather time consuming 6899 6897 6900 verbose = True 6898 6901 … … 6914 6917 #------------------------------------------------------------------------------ 6915 6918 number_of_inflows = 2 # Number of inflows on top of each other 6916 finaltime = 300.06919 finaltime = 1000.0 #6000.0 6917 6920 6918 6921 length = 300. 6919 6922 width = 20. 6920 dx = dy = 2# Resolution: of grid on both axes6923 dx = dy = 5 # Resolution: of grid on both axes 6921 6924 6922 6925 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy), 6923 6926 len1=length, len2=width) 6924 6927 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]: 6926 6929 for slope in [1.0/300, 1.0/150, 1.0/75]: 6927 6930 # Loop over a range of bedslopes representing sub to super critical flows … … 6979 6982 6980 6983 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 6983 6991 6984 6992 … … 6992 7000 if verbose: 6993 7001 print '90 degree flowline: ANUGA = %f, Ref = %f' % (q, ref_flow) 6994 #assert num.allclose(q, ref_flow, rtol=1.0e-2), msg7002 assert num.allclose(q, ref_flow, rtol=1.0e-2), msg 6995 7003 6996 7004 … … 7001 7009 print '45 degree flowline: ANUGA = %f, Ref = %f' % (q, ref_flow) 7002 7010 7003 #assert num.allclose(q, ref_flow, rtol=1.0e-2), msg7011 assert num.allclose(q, ref_flow, rtol=1.0e-2), msg 7004 7012 7005 7013 # Stage recorder (gauge) in middle of plane at 200m … … 7016 7024 msg = 'Predicted depth of flow was %f, should have been %f' % (domain_depth, normal_depth) 7017 7025 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 7020 7033 if slope >= 1.0/100: 7021 7034 # Really super critical flow is not as stable. … … 7054 7067 # Setup computational domain 7055 7068 #------------------------------------------------------------------------------ 7056 finaltime = 300.07069 finaltime = 1000.0 7057 7070 7058 7071 length = 300. … … 7070 7083 len1=length, len2=width) 7071 7084 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]: 7074 7087 # Loop over a range of bedslopes representing sub to super critical flows 7075 7088 … … 7130 7143 print domain.volumetric_balance_statistics() 7131 7144 7145 7146 7132 7147 # 90 degree flowline at 200m 7133 7148 q=domain.get_flow_through_cross_section([[200.0,0.0],[200.0,20.0]]) … … 7168 7183 7169 7184 if __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') 7172 7187 #suite = unittest.makeSuite(Test_Shallow_Water, 'test_total_volume') 7173 7188 #suite = unittest.makeSuite(Test_Shallow_Water, 'test')
Note: See TracChangeset
for help on using the changeset viewer.