Changeset 2772 for inundation/examples/bedslope.py
- Timestamp:
- Apr 27, 2006, 11:10:38 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/examples/bedslope.py
r2619 r2772 1 1 """Simple example of shallow water wave equation using Pyvolution 2 2 3 Water driven by linear slope and Dirichlet boundary 3 Water driven up a linear slope with a time varying boundary, 4 similar to beach environment 4 5 5 6 """ … … 12 13 13 14 #Create basic triangular mesh 14 points, vertices, boundary = rectangular( 2, 1)15 points, vertices, boundary = rectangular(10, 10) 15 16 16 17 #Create shallow water domain … … 30 31 domain.set_quantity('friction', 0.1) 31 32 32 h = 0.0 5 # Constant depth33 domain.set_quantity('stage', expression = 'elevation + %f' %h)33 h = 0.00 # Constant depth over elevation 34 domain.set_quantity('stage', -.4) 34 35 35 36 … … 41 42 Bd = Dirichlet_boundary([0.2,0.,0.]) 42 43 Bw = Time_boundary(domain=domain, 43 f=lambda t: [(0.1*sin(t*2*pi) ), 0.0, 0.0])44 f=lambda t: [(0.1*sin(t*2*pi)-0.3), 0.0, 0.0]) 44 45 45 46 46 47 print 'Tags are ', domain.get_boundary_tags() 47 48 48 domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br}) 49 #domain.set_boundary({'left': Bw, 'right': Br, 'top': Br, 'bottom': Br}) 49 domain.set_boundary({'left': Br, 'right': Bw, 'top': Br, 'bottom': Br}) 50 50 51 51 … … 54 54 domain.check_integrity() 55 55 56 for t in domain.evolve(yieldstep = 0.1, finaltime = 0.2):56 for t in domain.evolve(yieldstep = 0.1, finaltime = 4.0): 57 57 domain.write_time() 58 58
Note: See TracChangeset
for help on using the changeset viewer.