Ignore:
Timestamp:
Mar 2, 2010, 2:31:30 PM (13 years ago)
Author:
fountain
Message:

updates to mandurah and bunbury storm surge models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/bunbury_storm_surge_2009/run_model.py

    r7613 r7647  
    159159                     'ocean': Bf})
    160160
    161 #-----------------------------------------------------------------------------
    162 #  Setup dynamic topography
    163 #-----------------------------------------------------------------------------
    164 from project import floodgate_height, floodgate_thickness,floodgate_LHS_x,floodgate_LHS_y,floodgate_RHS_x,floodgate_RHS_y,floodgate_start,floodgate_duration
    165 
    166 floodgate_end = floodgate_start + floodgate_duration #the time in seconds at which the floodgates are fully closed
    167 
    168 def floodgate(x,y):
    169     z = 0*x
    170     N = len(x)
    171     for i in range(N):
    172         ymin = ((floodgate_RHS_y - floodgate_LHS_y)/(floodgate_RHS_x - floodgate_LHS_x))*(x[i]-floodgate_LHS_x)+ floodgate_LHS_y - 0.5*floodgate_thickness
    173         ymax = ((floodgate_RHS_y - floodgate_LHS_y)/(floodgate_RHS_x - floodgate_LHS_x))*(x[i]-floodgate_LHS_x)+ floodgate_LHS_y + 0.5*floodgate_thickness
    174         xmin = floodgate_LHS_x
    175         xmax = floodgate_RHS_x
    176         if ymin < y[i] < ymax and xmin < x[i] < xmax:
    177             z[i] += (floodgate_height/((floodgate_duration)/project.yieldstep))
    178 
    179     return z
    180    
    181161#-------------------------------------------------------------------------------
    182162# Evolve system through time
    183163#-------------------------------------------------------------------------------
    184 
    185 raising_floodgates = False
    186 lowering_floodgates = False
    187164
    188165t0 = time.time()
     
    193170    print domain.boundary_statistics(tags='ocean')
    194171
    195 #raise floodgate at a given time interval (to make floodgate lower again repeat this code below
    196 #for a later time interval and change rising to false and falling to true
    197     if floodgate_start < t < floodgate_end:
    198         rising = True
    199         falling = False
    200 
    201     if rising:
    202         domain.add_quantity('elevation',floodgate)
    203 
    204     if falling:
    205         domain.add_quantity('elevation', lambda x,y: -1*floodgate(x,y))
    206172
    207173print 'Simulation took %.2f seconds' % (time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.