- Timestamp:
- Oct 11, 2006, 3:58:53 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/documentation/user_manual/examples/channel_3.py
r3747 r3753 1 1 """Simple water flow example using ANUGA 2 2 3 Water flowing down a channel 3 Water flowing down a channel with more complex topography 4 4 """ 5 5 … … 20 20 width = 5. 21 21 dx = dy = 1 # Resolution: Length of subdivisions on both axes 22 #dx = dy = .1 # Resolution: Length of subdivisions on both axes 22 23 23 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy), len1=length, len2=width) 24 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy), 25 len1=length, len2=width) 24 26 domain = Domain(points, vertices, boundary) 25 27 domain.set_name('channel_3') # Output name … … 30 32 #------------------------------------------------------------------------------ 31 33 def topography(x,y): 32 z = -x/10 # linear bed slope 34 """Complex topography defined by a function of vectors x and y 35 """ 36 37 z = -x/10 33 38 34 39 N = len(x) … … 50 55 51 56 52 domain.set_quantity('elevation', topography) # Use function for elevation 53 domain.set_quantity('friction', 0.01) # Constant friction 54 domain.set_quantity('stage', expression='elevation') # Dry 57 domain.set_quantity('elevation', topography) # Use function for elevation 58 domain.set_quantity('friction', 0.01) # Constant friction 59 domain.set_quantity('stage', 60 expression='elevation') # Dry initial condition 55 61 56 62 … … 58 64 # Setup boundary conditions 59 65 #------------------------------------------------------------------------------ 60 Bi = Dirichlet_boundary([0.4, 0, 0]) 61 Br = Reflective_boundary(domain) 62 Bo = Dirichlet_boundary([-5, 0, 0]) 66 Bi = Dirichlet_boundary([0.4, 0, 0]) # Inflow 67 Br = Reflective_boundary(domain) # Solid reflective wall 68 Bo = Dirichlet_boundary([-5, 0, 0]) # Outflow 63 69 64 70 domain.set_boundary({'left': Bi, 'right': Bo, 'top': Br, 'bottom': Br})
Note: See TracChangeset
for help on using the changeset viewer.