Changeset 5190


Ignore:
Timestamp:
Apr 2, 2008, 3:17:30 PM (16 years ago)
Author:
duncan
Message:

near shore work, no new limiters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/near_shore_PMD/run_beach.py

    r5162 r5190  
    3333from anuga.abstract_2d_finite_volumes.util import copy_code_files, \
    3434     file_function
     35from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
     36 
    3537
    3638from anuga.shallow_water.data_manager import start_screen_catcher
     
    7072    return z
    7173
    72 def main(friction=0.01, outputdir_name=None, is_trial_run=False):
    73     basename = 'zz' + str(friction)
     74def main(friction=0.01, outputdir_name=None,
     75         is_structured=False,
     76         is_trial_run=False):
     77
     78    # Structured mesh variables
     79    dx = 5.
     80    dy = dx
     81    L = 2080.
     82    W = dx
     83    outputdir_name += '_dx' + str(dx)
     84   
     85    basename = 'dx_' + str(dx)
    7486    if is_trial_run is True:
    7587        outputdir_name += '_test'
     
    8193        yieldstep = 1.
    8294        finaltime = 1600
    83         finaltime = 100
    8495        maximum_triangle_area = 100
    8596        thinner=True
     
    116127    # this creates the mesh
    117128    #gate_position = 12.0
    118     create_mesh.generate(mesh_filename,
    119                          maximum_triangle_area=maximum_triangle_area,
    120                          thinner=thinner)
    121 
    122     head,tail = path.split(mesh_filename)
    123     copy (mesh_filename,
    124           pro_instance.outputdir + tail )
     129    if is_structured is True:
     130
     131        # Original struc mesh values
     132        # dx = 10.
     133        # dy = dx
     134        # L = 2080.
     135        # W = dx
     136       
     137        # structured mesh
     138        points, vertices, boundary = rectangular_cross(
     139            int(L/dx), int(W/dy), L, W, (-80.0, -W*0.5))
     140
     141        domain = Domain(points, vertices, boundary)
     142    else:
     143        create_mesh.generate(mesh_filename,
     144                             maximum_triangle_area=maximum_triangle_area,
     145                             thinner=thinner)
     146
     147        head,tail = path.split(mesh_filename)
     148        copy (mesh_filename,
     149              pro_instance.outputdir + tail )
     150        domain = Domain(mesh_filename, use_cache = False, verbose = True)
     151        domain = Domain(points, vertices, boundary)
    125152    #-------------------------------------------------------------------------
    126153    # Setup computational domain
    127154    #-------------------------------------------------------------------------
    128     domain = Domain(mesh_filename, use_cache = False, verbose = True)
    129155   
    130156
     
    137163    domain.set_datadir(pro_instance.outputdir)
    138164    domain.set_default_order(2) # Use second order spatial scheme
     165    domain.set_timestepping_method('rk2')
     166    domain.set_default_order(2)
     167    #domain.use_edge_limiter = True
     168    #domain.tight_slope_limiters = True
     169   
     170    #domain.beta_w      = 0.6
     171    #domain.beta_uh     = 0.6
     172    #domain.beta_vh     = 0.6
     173    #domain.beta_h      = 0.0
     174
    139175    domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum'])
    140176    domain.set_minimum_storable_height(0.001)
     
    165201                   lambda t: [1.2*sin(2*t*pi/10)+1.0*sin(2*t*pi/9.5),
    166202                              0.0, 0.0])
    167     domain.set_boundary( {'wall': Br, 'wave': Bwp_velocity} )
     203   
     204    if is_structured is True:
     205        domain.set_boundary( {'top': Br,
     206                              'bottom': Br ,
     207                              'left' : Br ,
     208                              'right' : Bwp } )
     209    else:
     210        domain.set_boundary( {'wall': Br, 'wave': Bwp} )
    168211
    169212
     
    179222    print 'finished'
    180223
    181     points = [[2.8,0.5],  #-1.8m from SWL
    182               [5.1,0.5],  #0.5m from SWL
    183               [6.6,0.5],  #2m from SWL
    184               [6.95,0.5], #2.35m from SWL
    185               [7.6,0.5],  #3m from SWL
    186               [8.2,0.5],  #3.5m from SWL
    187               [9.2,0.5]  #4.5m from SWL
     224    points = [[-2,0.0],  #-1.8m from SWL
     225              [0,0.0],  #0.5m from SWL
     226              [2,0.0],  #2m from SWL
    188227              ]
    189228
     
    193232    #-------------------------------------------------------------------------
    194233
    195     if False:
     234    if True:
    196235        interpolate_sww2csv(pro_instance.outputdir + basename +".sww",
    197236                            points,
    198                             pro_instance.outputdir + "depth_manning_"+str(friction)+".csv",
    199                             pro_instance.outputdir + "velocity_x.csv",
    200                             pro_instance.outputdir + "velocity_y.csv")
     237                            pro_instance.outputdir + "depth_dx_"+str(dx)+".csv",
     238                            pro_instance.outputdir + "velocity_x_dx_"+str(dx)+".csv",
     239                            pro_instance.outputdir + "velocity_y_dx_"+str(dx)+".csv")
    201240 
    202241    return pro_instance
     
    204243#-------------------------------------------------------------
    205244if __name__ == "__main__":
    206     main( is_trial_run = False, friction=0.0,
    207          outputdir_name='Velocity_wave_thinner_100_0_friction_ft1600_2nd_order')
     245    main(
     246        is_trial_run=False,
     247        friction=0.0,
     248        is_structured=True,
     249        outputdir_name='structured_old_limiters')
Note: See TracChangeset for help on using the changeset viewer.