Changeset 7680


Ignore:
Timestamp:
Apr 12, 2010, 4:18:53 PM (10 years ago)
Author:
fountain
Message:

updates to mandurah storm surge model

Location:
branches/anuga_1_1/anuga_work/production/mandurah_storm_surge_2009
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/anuga_1_1/anuga_work/production/mandurah_storm_surge_2009/gems_comparison/project_GEMS.py

    r7677 r7680  
    9999# Format for points easting,northing (no header)                   
    100100interior_regions_data = [['intermediate.csv', 2500],
    101                                                 ['area_of_interest.csv', 100],
    102                         ['canals_nth_2.csv', 100],  # Canal regions used to force mesh to fit canals
    103                         ['canals_nth_3.csv', 100],   
    104                         ['canals_nth_4.csv', 100],
    105                         ['canals_nth_5.csv', 100],
    106                         ['canals_nth_6.csv', 100],
    107                         ['canals_nth_7.csv', 100],
    108                         ['canals_nth_8.csv', 100],
    109                         ['canals_nth_9.csv', 100],
    110                         ['canals_nth_10.csv', 100],
    111                         ['canals_nth_11.csv', 100],
    112                         ['canals_nth_12.csv', 100],
    113                         ['canals_sth_1.csv', 100],
    114                         ['canals_sth_2.csv', 100],
    115                         ['canals_sth_3.csv', 100],
    116                         ['canals_sth_4.csv', 100],
    117                         ['canals_sth_5.csv', 100],
    118                         ['canals_sth_6.csv', 100]]
     101                                                ['area_of_interest.csv', 200],
     102                        ['canals_nth_2.csv', 200],  # Canal regions used to force mesh to fit canals
     103                        ['canals_nth_3.csv', 200],   
     104                        ['canals_nth_4.csv', 200],
     105                        ['canals_nth_5.csv', 200],
     106                        ['canals_nth_6.csv', 200],
     107                        ['canals_nth_7.csv', 200],
     108                        ['canals_nth_8.csv', 200],
     109                        ['canals_nth_9.csv', 200],
     110                        ['canals_nth_10.csv', 200],
     111                        ['canals_nth_11.csv', 200],
     112                        ['canals_nth_12.csv', 200],
     113                        ['canals_sth_1.csv', 200],
     114                        ['canals_sth_2.csv', 200],
     115                        ['canals_sth_3.csv', 200],
     116                        ['canals_sth_4.csv', 200],
     117                        ['canals_sth_5.csv', 200],
     118                        ['canals_sth_6.csv', 200]]
    119119                       
    120120# LAND - used to set the initial stage/water to be offcoast only
  • branches/anuga_1_1/anuga_work/production/mandurah_storm_surge_2009/process_gems_grids.py

    r7677 r7680  
    2222state = 'western_australia'
    2323scenario_folder = 'mandurah_storm_surge_scenario_2009'
    24 event = 'Man_1_TCAlby'
     24event = 'Man1_TC_Alby'
     25
     26print "Processing event: ", event
    2527
    2628ENV_INUNDATIONHOME = 'INUNDATIONHOME'
     
    3739#-----------------------
    3840elevation_file_name = os.path.join(event_folder, 'topog_flip.asc')  # Name of the vertically flipped elevation grid
     41
     42print "Elevation file name: ", elevation_file_name
     43
    3944grid_file_names = glob.glob(os.path.join(event_folder, '*.gz'))
    4045grid_file_names.sort()
    4146number_of_timesteps = len(grid_file_names)
    42 grid_size = 0.0005  # cellsize from the GEMSURGE output grids
     47grid_size = 20  # cellsize from the GEMSURGE output grids
    4348start_time = 0      # all times in seconds
    44 end_time = 88200    # all times in seconds
    45 timestep = 1800     # all times in seconds
     49end_time = 61200    # end_time = start_time + timestep*number of grid_file_names. all times in seconds
     50timestep = 720     # all times in seconds
    4651refzone = 50        # UTM zone of model
    47 x_origin = 115.550 #364221.03   # xllcorner from GEMSURGE output grids
    48 y_origin = -32.790 #6371062.71  # yllcorner from GEMSURGE output grids
     52x_origin = 368600 #364221.03   # xllcorner from GEMSURGE output grids
     53y_origin = 6304600 #6371062.71  # yllcorner from GEMSURGE output grids
    4954event_sts = os.path.join(event_folder, event)
    5055
     
    120125assert stage.size == number_of_timesteps * elevation.size
    121126
     127d = numpy.empty(elevation.size, dtype='d')
    122128depth = numpy.empty(stage.size, dtype='d')
    123129number_of_points = ncols * nrows
     
    126132    j = number_of_points * i
    127133    k = j + number_of_points
    128     depth[j:k] = stage[j:k] - elevation     # Check GEMS elevations below sea level are negative
    129 
     134    d = stage[j:k] - elevation     # Check GEMS elevations below sea level are negative
     135    depth[j:k] = [0 if x<-9900 else x for x in d]
     136   
     137    # depth[j:k] = [x if x>=0 and elevation>0 else 0 for x in d] # This is to correcto for GEMS data which assumes stage=0 onshore when dry but should = elevation
     138    # for q in xrange(number_of_points):
     139        # if elevation[q] >= 0 and stage[j+q]==0:
     140            # depth[j+q] = 0
     141   
    130142momentum = depth * speed
    131143
     
    142154        assert mx > 0 and my > 0
    143155    if t > 90.0 and t < 180.0:
    144         mx = momentum[i]*math.sin(math.radians(180 - t))
    145         my = momentum[i]*math.cos(math.radians(180 - t))
     156        mx = momentum[i]*math.sin(math.radians(t))
     157        my = momentum[i]*math.cos(math.radians(t))
    146158        assert mx > 0 and my < 0
    147159    if t > 180.0 and t < 270.0:
    148         mx = momentum[i]*math.cos(math.radians(270 - t))
    149         my = momentum[i]*math.sin(math.radians(270 - t))
     160        mx = momentum[i]*math.cos(math.radians(t))
     161        my = momentum[i]*math.sin(math.radians(t))
    150162        assert mx < 0 and my < 0
    151163    if t > 270.0 and t < 360.0:
    152         mx = momentum[i]*math.sin(math.radians(360 - t))
    153         my = momentum[i]*math.cos(math.radians(360 - t))
     164        mx = momentum[i]*math.sin(math.radians(t))
     165        my = momentum[i]*math.cos(math.radians(t))
    154166        assert mx < 0 and my > 0
    155167    if t == 0.0 or t == 360.0:
    156168        mx = 0
    157169        my = momentum[i]
    158         assert my > 0
     170        assert my >= 0
    159171    if t == 90.0:
    160172        mx = momentum[i]
    161173        my = 0
    162         assert mx > 0
     174        assert mx >= 0
    163175    if t == 180.0:
    164176        mx = 0
    165         my = momentum[i]
    166         assert my < 0
     177        my = -momentum[i]
     178        assert my <= 0
    167179    if t == 270.0:
    168         mx = momentum[i]
     180        mx = -momentum[i]
    169181        my = 0
    170         assert mx < 0
     182        assert mx <= 0
    171183       
    172184    xmomentum[i] = mx
    173185    ymomentum[i] = my
    174186
    175     assert mx[i]^2 + my[i]^2 == momentum[i]
     187    assert math.sqrt(mx**2 + my**2) - momentum[i] < 1.e-06
    176188   
    177189x_origin_int = int(10000*x_origin)
  • branches/anuga_1_1/anuga_work/production/mandurah_storm_surge_2009/project.py

    r7677 r7680  
    104104# Format for points easting,northing (no header)                   
    105105interior_regions_data = [['intermediate.csv', 2500],
    106                                                 ['area_of_interest.csv', 100],
    107                         ['canals_nth_2.csv', 100],  # Canal regions used to force mesh to fit canals
    108                         ['canals_nth_3.csv', 100],   
    109                         ['canals_nth_4.csv', 100],
    110                         ['canals_nth_5.csv', 100],
    111                         ['canals_nth_6.csv', 100],
    112                         ['canals_nth_7.csv', 100],
    113                         ['canals_nth_8.csv', 100],
    114                         ['canals_nth_9.csv', 100],
    115                         ['canals_nth_10.csv', 100],
    116                         ['canals_nth_11.csv', 100],
    117                         ['canals_nth_12.csv', 100],
    118                         ['canals_sth_1.csv', 100],
    119                         ['canals_sth_2.csv', 100],
    120                         ['canals_sth_3.csv', 100],
    121                         ['canals_sth_4.csv', 100],
    122                         ['canals_sth_5.csv', 100],
    123                         ['canals_sth_6.csv', 100]]
     106                                                ['area_of_interest.csv', 200],
     107                        ['canals_nth_2.csv', 200],  # Canal regions used to force mesh to fit canals
     108                        ['canals_nth_3.csv', 200],   
     109                        ['canals_nth_4.csv', 200],
     110                        ['canals_nth_5.csv', 200],
     111                        ['canals_nth_6.csv', 200],
     112                        ['canals_nth_7.csv', 200],
     113                        ['canals_nth_8.csv', 200],
     114                        ['canals_nth_9.csv', 200],
     115                        ['canals_nth_10.csv', 200],
     116                        ['canals_nth_11.csv', 200],
     117                        ['canals_nth_12.csv', 200],
     118                        ['canals_sth_1.csv', 200],
     119                        ['canals_sth_2.csv', 200],
     120                        ['canals_sth_3.csv', 200],
     121                        ['canals_sth_4.csv', 200],
     122                        ['canals_sth_5.csv', 200],
     123                        ['canals_sth_6.csv', 200]]
    124124                       
    125125# LAND - used to set the initial stage/water to be offcoast only
Note: See TracChangeset for help on using the changeset viewer.