Changeset 5095


Ignore:
Timestamp:
Mar 3, 2008, 9:30:31 AM (17 years ago)
Author:
duncan
Message:

Running different scenarios

Location:
anuga_work/development/near_shore_PMD
Files:
2 edited

Legend:

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

    r5093 r5095  
    88
    99
    10 def generate(mesh_filename, maximum_triangle_area=300000):
     10def generate(mesh_filename, maximum_triangle_area=300000, thinner=False):
    1111    """
    1212    """
     
    1414    xleft   = -100  # Beach
    1515    xright  = 10000  # wave generated here
    16     ytop    = 15000
    17     ybottom = -15000
     16    if thinner:
     17        ytop    = 1000
     18        ybottom = -1000
     19    else:
     20        ytop    = 2000
     21        ybottom = -2000
     22       
    1823
    1924    point_sw = [xleft, ybottom]
     
    2934    # local refinement
    3035    xleft   = -80
    31     xright  = 500
    32     ytop    = 1000
    33     ybottom = -1000
     36    xright  = 2000
     37    if thinner:
     38        ytop    = 900
     39        ybottom = -900
     40    else:
     41        ytop    = 1000
     42        ybottom = -1000
    3443
    3544    point_sw = [xleft, ybottom]
     
    4352                        point_sw]
    4453
    45     interior_regions = [[polygon_2, maximum_triangle_area/10.]]
     54    interior_regions = [[polygon_2, maximum_triangle_area/2.]]
    4655   
    4756    m = create_mesh_from_regions(bounding_polygon,
     
    5766#-------------------------------------------------------------
    5867if __name__ == "__main__":
    59     generate("aa.tsh")
     68    generate("aa.tsh", thinner=True)
  • anuga_work/development/near_shore_PMD/run_beach.py

    r5093 r5095  
    2323from os import path, sep
    2424from os.path import dirname  #, basename
    25 
     25from math import sin, pi
    2626
    2727# Related major packages
     
    3131                            Transmissive_Momentum_Set_Stage_boundary
    3232from anuga.fit_interpolate.interpolate import interpolate_sww2csv
    33 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, \
    34      copy_code_files, file_function
     33from anuga.abstract_2d_finite_volumes.util import copy_code_files, \
     34     file_function
     35
     36from anuga.shallow_water.data_manager import start_screen_catcher
     37
    3538from anuga.abstract_2d_finite_volumes.generic_boundary_conditions\
    3639     import File_boundary_time
     
    5962            #>>> 0.01888*(1000**0.8)
    6063            #4.7424415826900885
     64
     65            #>>> -0.01888*10000**0.8
     66            #-29.922783473665834
    6167    return z
    6268
     
    6571    if is_trial_run is True:
    6672        outputdir_name += '_test'
    67         yieldstep = 0.1
    68         finaltime = 15.
    69         maximum_triangle_area=300000
     73        yieldstep = 10
     74        finaltime = 1200.
     75        maximum_triangle_area=3000
     76        thinner=True
    7077    else:
    71         yieldstep = 0.02
    72         finaltime = 15.1
    73         maximum_triangle_area=30000
     78        yieldstep = 5.
     79        finaltime = 1200
     80        maximum_triangle_area=50
     81        thinner=True
    7482       
    7583       
    7684    pro_instance = project.Project(['data','near_shore_PMD'],
    77                                    outputdir_name=outputdir_name,
    78                                    home='.')
     85                                   outputdir_name=outputdir_name)
    7986    print "The output dir is", pro_instance.outputdir
    8087    copy_code_files(pro_instance.outputdir,__file__,
    8188                    dirname(project.__file__) \
    8289                    + sep + project.__name__+'.py')
    83     copy (pro_instance.codedir + 'run_dam.py',
    84           pro_instance.outputdir + 'run_dam.py')
     90    copy (pro_instance.codedir + 'run_beach.py',
     91          pro_instance.outputdir + 'run_beach.py')
    8592    copy (pro_instance.codedir + 'create_mesh.py',
    8693          pro_instance.outputdir + 'create_mesh.py')
     
    95102    # creates copy of code in output dir
    96103    if is_trial_run is False:
    97         start_screen_catcher(pro_instance.outputdir, rank, pypar.size())
     104        start_screen_catcher(pro_instance.outputdir) #, rank, pypar.size())
    98105
    99106    print 'USER:    ', pro_instance.user
     
    105112    #gate_position = 12.0
    106113    create_mesh.generate(mesh_filename,
    107                          maximum_triangle_area=maximum_triangle_area)
     114                         maximum_triangle_area=maximum_triangle_area,
     115                         thinner=thinner)
    108116
    109117    head,tail = path.split(mesh_filename)
     
    142150    #Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function)
    143151    Br = Reflective_boundary(domain)
    144     Bd = Dirichlet_boundary([1000.,0,0])
    145     domain.set_boundary( {'wall': Br, 'wave': Bd} )
     152    Bd = Dirichlet_boundary([10.,0,0])
     153    Bwp = Transmissive_Momentum_Set_Stage_boundary(domain,
     154                   lambda t: [(1.2*sin(2*t*pi/10)), 0.0, 0.0])
     155    Bws = Transmissive_Momentum_Set_Stage_boundary(domain,
     156                   lambda t: [1.2*sin(2*t*pi/10)+1.0*sin(2*t*pi/9.5),
     157                              0.0, 0.0])
     158    domain.set_boundary( {'wall': Br, 'wave': Bws} )
    146159
    147160    #-------------------------------------------------------------------------
     
    180193#-------------------------------------------------------------
    181194if __name__ == "__main__":
    182     main( is_trial_run = True,
    183          outputdir_name='Hinwood_low_stage_low_velocity_draft')
     195    main( is_trial_run = False,
     196         outputdir_name='Primary_wave_thin_50')
Note: See TracChangeset for help on using the changeset viewer.