- Timestamp:
- May 22, 2009, 4:40:11 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/documentation/user_manual/demos/cairns/runcairns.py
r6889 r7064 15 15 # Import necessary modules 16 16 #------------------------------------------------------------------------------ 17 18 17 # Standard modules 19 18 import os … … 37 36 import project # Definition of file names and polygons 38 37 39 40 38 #------------------------------------------------------------------------------ 41 39 # Preparation of topographic data 42 40 # Convert ASC 2 DEM 2 PTS using source data and store result in source data 43 41 #------------------------------------------------------------------------------ 44 45 42 # Create DEM from asc data 46 43 convert_dem_from_ascii2netcdf(project.demname, use_cache=True, verbose=True) … … 49 46 dem2pts(project.demname, use_cache=True, verbose=True) 50 47 51 52 48 #------------------------------------------------------------------------------ 53 49 # Create the triangular mesh and domain based on … … 55 51 # boundary and interior regions as defined in project.py 56 52 #------------------------------------------------------------------------------ 57 58 53 domain = create_domain_from_regions(project.bounding_polygon, 59 54 boundary_tags={'top': [0], … … 67 62 verbose=True) 68 63 69 70 64 # Print some stats about mesh and domain 71 65 print 'Number of triangles = ', len(domain) … … 76 70 # Setup parameters of computational domain 77 71 #------------------------------------------------------------------------------ 78 79 80 72 domain.set_name('cairns_' + project.scenario) # Name of sww file 81 73 domain.set_datadir('.') # Store sww output here 82 74 domain.set_minimum_storable_height(0.01) # Store only depth > 1cm 83 75 84 85 76 #------------------------------------------------------------------------------ 86 77 # Setup initial conditions 87 78 #------------------------------------------------------------------------------ 88 89 79 tide = 0.0 90 80 domain.set_quantity('stage', tide) … … 96 86 alpha=0.1) 97 87 98 99 88 #------------------------------------------------------------------------------ 100 89 # Setup information for slide scenario (to be applied 1 min into simulation 101 90 #------------------------------------------------------------------------------ 102 103 91 if project.scenario == 'slide': 104 92 # Function for submarine slide … … 113 101 verbose=True) 114 102 115 116 103 #------------------------------------------------------------------------------ 117 104 # Setup boundary conditions 118 105 #------------------------------------------------------------------------------ 119 120 106 print 'Available boundary tags', domain.get_boundary_tags() 121 122 107 123 108 Bd = Dirichlet_boundary([tide,0,0]) # Mean water level 124 109 Bs = Transmissive_stage_zero_momentum_boundary(domain) # Neutral boundary 125 126 110 127 111 if project.scenario == 'fixed_wave': … … 129 113 Bw = Time_boundary(domain=domain, 130 114 function=lambda t: [(60<t<3660)*50, 0, 0]) 131 132 115 domain.set_boundary({'ocean_east': Bw, 133 116 'bottom': Bs, … … 141 124 'onshore': Bd, 142 125 'top': Bd}) 143 144 126 145 127 #------------------------------------------------------------------------------ 146 128 # Evolve system through time 147 129 #------------------------------------------------------------------------------ 148 149 130 import time 150 131 t0 = time.time() … … 154 135 155 136 if project.scenario == 'slide': 156 157 137 for t in domain.evolve(yieldstep=10, finaltime=60): 158 138 print domain.timestepping_statistics() … … 171 151 print domain.boundary_statistics(tags='ocean_east') 172 152 173 174 153 if project.scenario == 'fixed_wave': 175 176 154 # Save every two mins leading up to wave approaching land 177 155 for t in domain.evolve(yieldstep=120, finaltime=5000):
Note: See TracChangeset
for help on using the changeset viewer.