Changeset 522 for inundation
- Timestamp:
- Nov 11, 2004, 4:19:47 PM (20 years ago)
- Location:
- inundation/ga/storm_surge
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/shallow_water.py
r519 r522 43 43 44 44 #Stored output 45 self.store =False45 self.store = False 46 46 self.format = 'sww' 47 47 self.smooth = True … … 144 144 """Specialisation of basic evolve method from parent class 145 145 """ 146 147 #Call check integrity here rather than from user scripts 148 self.check_integrity() 146 149 147 150 #Initialise real time viz if requested -
inundation/ga/storm_surge/pyvolution/wind_example.py
r519 r522 1 1 """Example of shallow water wave equation. 2 2 3 Flat bed with wind stress 4 3 Flat bed with constant wind stress 5 4 """ 6 5 7 6 ###################### 8 7 # Module imports 9 #10 8 from mesh_factory import rectangular 11 from shallow_water import Domain, Reflective_boundary, Dirichlet_boundary,\ 12 Transmissive_boundary, Constant_height, Wind_stress 13 from Numeric import array 9 from shallow_water import Domain, Reflective_boundary, Constant_height, Wind_stress 14 10 15 #Create basic mesh 16 N = 80 17 len1 = 100 18 len2 = 100 19 points, vertices, boundary = rectangular(N, N, len1, len2) 11 #Create basic mesh (100m x 100m) 12 N = 80 13 len = 100 14 points, vertices, boundary = rectangular(N, N, len, len) 20 15 21 16 #Create shallow water domain 22 17 domain = Domain(points, vertices, boundary) 23 domain.smooth = True 24 domain.visualise = False 25 domain.store = True 26 domain.default_order=2 18 domain.default_order = 2 27 19 domain.set_name('wind_laminar') 28 20 29 21 #Set initial conditions 22 domain.set_quantity('elevation', 0.0) 23 domain.set_quantity('level', 1.0) 24 domain.set_quantity('friction', 0.0) 30 25 31 depth = 1 32 33 def x_slope(x, y): 34 return 0*x/10 35 36 domain.set_quantity('elevation', x_slope) 37 domain.set_quantity('level', Constant_height(x_slope, depth)) 38 39 #Set driving forces 40 manning = 0.0 41 domain.set_quantity('friction', manning) 42 43 44 #Constant windfield implemented using functions 45 domain.forcing_terms.append(Wind_stress(9000, 120)) 46 26 #Constant (quite extreme :-) windfield: 9000 m/s, bearing 120 degrees 27 domain.forcing_terms.append( Wind_stress(s=9000, phi=120) ) 47 28 48 29 ###################### 49 30 # Boundary conditions 50 31 Br = Reflective_boundary(domain) 51 Bd = Dirichlet_boundary([depth, 0, 0])52 53 32 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 54 #domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Bd})55 #domain.set_boundary({'left': Br, 'right': Bd, 'top': Bd, 'bottom': Bd})56 domain.check_integrity()57 58 33 59 34 ###################### -
inundation/ga/storm_surge/pyvolution/wind_example_rot.py
r519 r522 1 1 """Example of shallow water wave equation. 2 2 3 Flat bed with wind stress3 Flat bed with rotational wind stress 4 4 5 5 """ … … 9 9 # 10 10 from mesh_factory import rectangular 11 from shallow_water import Domain, Reflective_boundary, Dirichlet_boundary,\ 12 Transmissive_boundary, Constant_height, Wind_stress 13 from Numeric import array 11 from shallow_water import Domain, Reflective_boundary, Wind_stress 14 12 15 13 #Create basic mesh 16 14 N = 80 17 len1 = 100 18 len2 = 100 19 points, vertices, boundary = rectangular(N, N, len1, len2) 15 len = 100 16 points, vertices, boundary = rectangular(N, N, len, len) 20 17 21 18 #Create shallow water domain … … 28 25 29 26 #Set initial conditions 27 domain.set_quantity('elevation', 0.0) 28 domain.set_quantity('level', 2.0) 29 domain.set_quantity('friction', 0.0) 30 30 31 depth = 232 33 def x_slope(x, y):34 return 0*x/1035 36 domain.set_quantity('elevation', x_slope)37 domain.set_quantity('level', Constant_height(x_slope, depth))38 39 #Set driving forces40 manning = 0.041 domain.set_quantity('friction', manning)42 43 44 45 #Constant windfield implemented using functions46 #domain.forcing_terms.append(Wind_stress(5000, 30))47 48 #Constant windfield implemented using (lambda) functions49 #domain.forcing_terms.append(Wind_stress(lambda x,y,t: 5000, lambda x,y,t: 30))50 31 51 32 #Variable windfield implemented using functions … … 97 78 domain.forcing_terms.append(Wind_stress(speed, phi)) 98 79 80 99 81 #Add lateral wind gusts bearing 25 deg 100 82 def gust(x,y,t): … … 114 96 # Boundary conditions 115 97 Br = Reflective_boundary(domain) 116 Bd = Dirichlet_boundary([depth, 0, 0])117 118 98 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 119 #domain.set_boundary({'left': Bd, 'right': Bd, 'top': Bd, 'bottom': Bd})120 #domain.set_boundary({'left': Br, 'right': Bd, 'top': Bd, 'bottom': Bd})121 domain.check_integrity()122 123 99 124 100 ###################### -
inundation/ga/storm_surge/validation/run_merimbula.py
r520 r522 24 24 25 25 domain.default_order = 1 26 domain.store = True #Store for visualisation purposes27 domain.format = 'sww' #Native netcdf visualisation format28 26 domain.filename = filename 29 27
Note: See TracChangeset
for help on using the changeset viewer.