Changeset 7804 for anuga_work
- Timestamp:
- Jun 7, 2010, 4:19:31 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/classroom/ripcurrent.py
r7589 r7804 16 16 # Import necessary modules 17 17 #------------------------------------------------------------------------------ 18 from anuga.interface import create_domain_from_regions 19 from anuga.shallow_water.shallow_water_domain import Dirichlet_boundary 20 from anuga.shallow_water.shallow_water_domain import Reflective_boundary 21 from anuga.shallow_water.shallow_water_domain import Time_boundary 22 from anuga.shallow_water.data_manager import get_mesh_and_quantities_from_file 18 import anuga 23 19 from pylab import figure, plot, axis, quiver, quiverkey, show, title, axhline 24 20 from pylab import cos, sin, pi … … 41 37 halfchannelwidth = 5 42 38 bank_slope = 0.1 43 simulation_length = 139 simulation_length = 60 44 40 timestep = 1 45 41 … … 50 46 length = 120 51 47 width = 170 52 seafloor_resolution = 60.0 # Resolution: Max area of triangles in the mesh48 seafloor_resolution = 20.0 # Resolution: Max area of triangles in the mesh 53 49 feature_resolution = 1.0 54 50 beach_resolution = 10.0 55 51 56 52 sea_boundary_polygon = [[0,0],[length,0],[length,width],[0,width]] 57 feature_boundary_polygon = [[0,100],[length,100],[length,150],[0,150]] 53 feature_boundary_polygon = [[19,99],[length/2+1,99],[length/2+1,151],[0,151]] 54 hole_boundary_polygon = [[20,100],[length/2,100],[length/2,150],[20,150]] 58 55 beach_interior_polygon = [[0,150],[length,150],[length,width],[0,width]] 59 56 … … 64 61 [beach_interior_polygon, beach_resolution]] 65 62 66 domain = create_domain_from_regions(sea_boundary_polygon,63 domain = anuga.create_domain_from_regions(sea_boundary_polygon, 67 64 boundary_tags={'bottom': [0], 68 65 'right' : [1], … … 72 69 mesh_filename=meshname, 73 70 interior_regions=feature_regions, 71 interior_holes=[hole_boundary_polygon], 74 72 use_cache=True, 75 73 verbose=True) … … 149 147 # Setup boundary conditions 150 148 #------------------------------------------------------------------------------ 151 Bi = Dirichlet_boundary([0.4, 0, 0]) # Inflow152 Br = Reflective_boundary(domain) # Solid reflective wall153 Bo = Dirichlet_boundary([-5, 0, 0]) # Outflow149 Bi = anuga.Dirichlet_boundary([0.4, 0, 0]) # Inflow 150 Br = anuga.Reflective_boundary(domain) # Solid reflective wall 151 Bo = anuga.Dirichlet_boundary([-5, 0, 0]) # Outflow 154 152 155 153 def wave(t): … … 158 156 159 157 A = 0.4 # Amplitude of wave [m] (wave height) 160 T = 5# Wave period [s]158 T = 1 # Wave period [s] 161 159 162 160 if t < 30000000000: … … 165 163 return [0.0, 0, 0] 166 164 167 Bt = Time_boundary(domain, f=wave)168 169 170 domain.set_boundary({'left': Br, 'right': Br, 'top': Bo, 'bottom': Bt })165 Bt = anuga.Time_boundary(domain, f=wave) 166 167 168 domain.set_boundary({'left': Br, 'right': Br, 'top': Bo, 'bottom': Bt, 'exterior': Br}) 171 169 172 170
Note: See TracChangeset
for help on using the changeset viewer.