Changeset 483
- Timestamp:
- Nov 4, 2004, 10:18:24 AM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/flatbed.py
r232 r483 14 14 15 15 #Create basic mesh 16 N = 817 points, vertices, boundary = rectangular(N, N )16 N = 150 17 points, vertices, boundary = rectangular(N, N, 1000, 1000) 18 18 19 19 #Create shallow water domain 20 20 domain = Domain(points, vertices, boundary) 21 domain.smooth = False 22 domain.visualise = True 23 domain.default_order=2 21 domain.smooth = True 22 domain.visualise = False 23 domain.store = True 24 domain.default_order=1 25 26 #Set driving forces 27 manning = 0.07 28 manning = 0.0 29 inflow_level = 10.0 30 domain.set_quantity('friction', manning) 24 31 25 32 … … 27 34 # Boundary conditions 28 35 Br = Reflective_boundary(domain) 29 Bd = Dirichlet_boundary([ 0.2,0.,0.])36 Bd = Dirichlet_boundary([inflow_level,0.,0.]) 30 37 31 38 domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br}) 39 domain.check_integrity() 32 40 33 34 domain.check_integrity()35 41 36 42 ###################### 37 43 #Evolution 38 #for t in domain.evolve(yieldstep = 0.05, finaltime = 1.): 39 # domain.write_time() 40 41 42 #import sys; sys.exit() 43 44 ###################### 45 #Evolution 46 for t in domain.evolve(yieldstep = 0.01, finaltime = 0.03): 44 for t in domain.evolve(yieldstep = 10, finaltime = 500): 47 45 domain.write_time() 48 46 49 print domain.quantities['level'].centroid_values[:4] 50 print domain.quantities['xmomentum'].centroid_values[:4] 51 print domain.quantities['ymomentum'].centroid_values[:4] 52 domain.distribute_to_vertices_and_edges() 53 print 54 print domain.quantities['level'].vertex_values[:4,0] 55 print domain.quantities['xmomentum'].vertex_values[:4,0] 56 print domain.quantities['ymomentum'].vertex_values[:4,0] 47 print 'Done' 48 -
inundation/ga/storm_surge/pyvolution/flatbed_compare.py
r458 r483 1 1 """Example of shallow water wave equation. 2 2 3 Comparison of flatbed between mark 2(Grohm) and mark 3 3 Generate slope 4 4 5 5 """ … … 10 10 from mesh_factory import rectangular 11 11 from shallow_water import Domain, Reflective_boundary, Dirichlet_boundary,\ 12 Transmissive_boundary,Constant_height12 Constant_height 13 13 from Numeric import array 14 14 15 15 #Create basic mesh 16 N = 1016 N = 8 17 17 points, vertices, boundary = rectangular(N, N) 18 18 19 19 #Create shallow water domain 20 20 domain = Domain(points, vertices, boundary) 21 22 if N < 20:23 domain.visualise = True24 else:25 domain.visualise = False26 domain.store = True27 domain.format = 'sww'28 domain.filename = 'compare_py3'29 30 #domain.visualise = False31 21 domain.smooth = False 32 domain.default_order = 1 33 34 35 print 'Field values' 36 domain.set_quantity('elevation', 0.0) 37 domain.set_quantity('friction', 1) 22 domain.visualise = True 23 domain.default_order=2 38 24 39 25 … … 42 28 Br = Reflective_boundary(domain) 43 29 Bd = Dirichlet_boundary([0.2,0.,0.]) 44 Bt = Transmissive_boundary(domain)45 30 46 domain.set_boundary({'left': Bd, 'right': Bt, 'top': Bt, 'bottom': Bt}) 31 domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br}) 32 33 47 34 domain.check_integrity() 48 49 print domain.quantities['elevation'].centroid_values[:4]50 print domain.quantities['friction'].centroid_values[:4]51 35 52 36 ###################### 53 37 #Evolution 54 for t in domain.evolve(yieldstep = 0.01, finaltime = 0.5): 55 domain.write_time() 56 #print 57 58 #print domain.quantities['level'].centroid_values 59 #print domain.quantities['xmomentum'].centroid_values 60 #print domain.quantities['ymomentum'].centroid_values 61 62 #print 'R' 63 #print domain.quantities['level'].edge_values 38 #for t in domain.evolve(yieldstep = 0.05, finaltime = 1.): 39 # domain.write_time() 64 40 65 41 42 #import sys; sys.exit() 43 44 ###################### 45 #Evolution 46 for t in domain.evolve(yieldstep = 0.01, finaltime = 0.03): 47 domain.write_time() 48 49 print domain.quantities['level'].centroid_values[:4] 50 print domain.quantities['xmomentum'].centroid_values[:4] 51 print domain.quantities['ymomentum'].centroid_values[:4] 52 domain.distribute_to_vertices_and_edges() 53 print 54 print domain.quantities['level'].vertex_values[:4,0] 55 print domain.quantities['xmomentum'].vertex_values[:4,0] 56 print domain.quantities['ymomentum'].vertex_values[:4,0]
Note: See TracChangeset
for help on using the changeset viewer.