Changeset 2395


Ignore:
Timestamp:
Feb 14, 2006, 1:43:12 PM (18 years ago)
Author:
nicholas
Message:

Updated compare_sww.py. Increased distance of rear boundary and changed to dirichlet

Location:
development/momentum_sink
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • development/momentum_sink/compare_sww.py

    r2379 r2395  
    55import project
    66from pyvolution.util import file_function
     7import Numeric
     8#from friction_block #import test
     9
     10#print "test", test
     11#import sys
     12#sys.exit()
    713
    814
    915#swwfile = project.outputname + '.sww'
    10 swwfile = project.outputdir + sep  + 'friction_12330.sww'
    11 gauge_locations = [[10,10],[20,20]]
     16#swwfile = project.outputdir + sep  + 'FrictionBlock_0.01_3.sww'
     17swwfile = project.outputdir + sep  + 'Buildings_3662.sww'
     18gauge_depth = Numeric.arrayrange(0, 700, 20)
     19gauge_breadth = 100
     20gauge_locations = []
    1221
    13 quantities = ['stage','elevation']
     22for GD in gauge_depth:
     23    gauge_location = [GD,gauge_breadth]
     24    gauge_locations.append(gauge_location)
     25
     26quantities = ['stage','elevation','xmomentum']
    1427gauges = file_function(swwfile,
    1528                  quantities = quantities,
     
    1831                  use_cache = True)
    1932
    20 times = [0,1,2,3,4]
     33times = [150,500]
    2134
    2235for gauge, _ in enumerate(gauge_locations):
  • development/momentum_sink/create_buildings.py

    r2379 r2395  
    1818
    1919    # Boundary of problem
    20     WidtH = 500 # width of boudary in metres
     20    WidtH = 200 # width of boudary in metres
    2121    #W = WidtH/8
    2222    #L = W
    23     outer_polygon = [[0,0],[1.5*WidtH,0],[1.5*WidtH,WidtH],[0,WidtH]]
     23    outer_polygon = [[0,0],[5*WidtH,0],[5*WidtH,WidtH],[0,WidtH]]
    2424    print outer_polygon
    2525    m.add_region_from_polygon(outer_polygon, tags={'wall':[0,1,2], 'wave':[3]})
    2626
    2727    # inner polygons => building boundaries
    28     depth = 18 # depth of building side to oncoming wave
     28    depth = 20 # depth of building side to oncoming wave
    2929    wh = depth/2
    30     breadth = 18 # breadth of building
     30    breadth = 20 # breadth of building
    3131    lh = breadth/2
    3232     
     
    4646
    4747    for D in Depths:
    48         Breadths = Breadths + BL/2
     48        #Breadths = Breadths + BL/2 #Used to offset buildings
    4949        for B in Breadths:
    5050            polygon = [[D-wh,B-lh],[D+wh,B-lh],[D+wh,B+lh],[D-wh,B+lh]]
  • development/momentum_sink/friction_block.py

    r2379 r2395  
    66from coordinate_transforms.geo_reference import Geo_reference
    77
    8 
     8#test = 300
    99def create_mesh(maximum_triangle_area,
    1010                mesh_file=None,
     
    1616    # create a mesh instance of class Mesh
    1717    m = Mesh()
    18 
     18   
     19    #print "test", test 
    1920    # Boundary of problem
    2021    WidtH = 200 # width of boudary in metres
     
    2829    #Boundary
    2930    dict = {}
    30     dict['points'] = [[0,0],[0.2*WidtH,0],[1.2*WidtH,0],[3.5*WidtH,0],[3.5*WidtH,WidtH] \
     31    dict['points'] = [[0,0],[0.2*WidtH,0],[1.2*WidtH,0],[5*WidtH,0],[5*WidtH,WidtH] \
    3132                      ,[1.2*WidtH,WidtH],[0.2*WidtH,WidtH],[0,WidtH]]
    3233   
     
    3738                            'wall',                           
    3839                            'wall',
    39                             'wall',
     40                            'back',
    4041                            'wall',
    4142                            'wall',
     
    5051    m.generate_mesh(maximum_triangle_area=maximum_triangle_area)
    5152    triangle_count = m.get_triangle_count()
     53 
     54
    5255   
    5356    if mesh_file is None:   
    54         return m, triangle_count
     57        return m, triangle_count, Width
    5558    else:
    5659        if triangles_in_name is True:
  • development/momentum_sink/run_buildings.py

    r2379 r2395  
    6565Br = Reflective_boundary(domain)
    6666Bt = Transmissive_boundary(domain)
    67 Bd = Dirichlet_boundary([10,0,0])
     67Bdw = Dirichlet_boundary([36,0,0])
     68Bdb = Dirichlet_boundary([0,0,0])
    6869Bw = Time_boundary(domain=domain,
    6970                   f=lambda t: [(60<t<660)*4, 0, 0])
    7071
    71 domain.set_boundary( {'wall': Br,'wave': Bd, 'back': Bt, 'exterior':Bd} )
     72domain.set_boundary( {'wall': Br,'wave': Bdw, 'back': Bdb, 'exterior':Bdw} )
    7273
    7374#Evolve
    7475t0 = time.time()
    7576
    76 for t in domain.evolve(yieldstep = 1, finaltime = 20):
     77for t in domain.evolve(yieldstep = 10, finaltime = 1000):
    7778    domain.write_time()     
    7879
  • development/momentum_sink/run_friction.py

    r2379 r2395  
    2626t0 = time.time()
    2727
     28#meshname, triagle_count =create_mesh(100,mesh_file=meshname,triangles_in_name=True)
     29
    2830meshname, triagle_count = cache(create_mesh,(100),
    2931                                {'mesh_file':meshname,
     
    5052domain.set_datadir(project_friction.outputdir)
    5153domain.store = True
    52 domain.quantities_to_be_stored = ['stage']
     54domain.quantities_to_be_stored = ['stage','xmomentum','ymomentum']
    5355
    5456print 'Number of triangles = ', len(domain)
     
    5860domain.set_quantity('friction', 0.01)
    5961domain.set_quantity('stage', 0)
    60 domain.set_region(Set_region('mound', 'friction', 0.8)) #, location='unique vertices'))
     62domain.set_region(Set_region('mound', 'friction', 3)) #, location='unique vertices'))
    6163#Setup Boundary Conditions
    6264print domain.get_boundary_tags()
     
    6668Br = Reflective_boundary(domain)
    6769Bt = Transmissive_boundary(domain)
    68 Bd = Dirichlet_boundary([36,0,0])
     70Bdw = Dirichlet_boundary([36,0,0])
     71Bdb = Dirichlet_boundary([0,0,0])
    6972Bw = Time_boundary(domain=domain,
    7073                   f=lambda t: [(60<t<660)*4, 0, 0])
    7174
    72 domain.set_boundary( {'wall': Br,'wave': Bd, 'back': Bt, 'exterior':Bd} )
     75domain.set_boundary( {'wall': Br,'wave': Bdw, 'back': Bdb, 'exterior':Bdw} )
    7376
    7477#Evolve
    7578t0 = time.time()
    7679
    77 for t in domain.evolve(yieldstep = 1, finaltime = 80):
     80for t in domain.evolve(yieldstep = 4, finaltime = 400):
    7881    domain.write_time()     
    7982
  • development/momentum_sink/run_rotate.py

    r2379 r2395  
    7474t0 = time.time()
    7575
    76 for t in domain.evolve(yieldstep = 1, finaltime = 20):
     76for t in domain.evolve(yieldstep = 1, finaltime = 60):
    7777    domain.write_time()     
    7878
Note: See TracChangeset for help on using the changeset viewer.