Ignore:
Timestamp:
Apr 3, 2007, 4:22:40 PM (18 years ago)
Author:
duncan
Message:

checking in a scenario

Location:
anuga_work/development/friction_UA_flume_2006
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/friction_UA_flume_2006/calc_norm.py

    r4189 r4351  
    6767        outputdir_name += '_test'
    6868    if pro_instance is None:
    69         pro_instance = project.Project(['data','flumes','dam_2006'],
     69        pro_instance = project.Project(['data','flumes','dam_2007'],
    7070                                       outputdir_name=outputdir_name)
    7171   
     
    8585   
    8686    #print "flume_results['time']", flume_results['time']
    87     import sys; sys.exit()
    8887    #Get a list of the files
    8988    files = os.listdir(pro_instance.outputdir)
     
    144143        'ensemble_average_h_smooth.csv',
    145144        #'ensemble_average_h_rough.csv',
    146         is_trial_run = True,   # adds _test to outputdir_name
    147         outputdir_name='friction_UA',
     145        is_trial_run = False,   # adds _test to outputdir_name
     146        outputdir_name='friction_UA_new_meshII',
    148147        max_time=None)
    149148
  • anuga_work/development/friction_UA_flume_2006/create_mesh.py

    r4047 r4351  
    77
    88
    9 def generate(mesh_filename, gate_position, is_coarse = False):
     9def generate(mesh_filename, is_coarse = False):
    1010    """
    1111    Generate mesh for University of Aberbeen dam break flume.
     
    1616    #Basic geometry
    1717   
    18     xright  = gate_position
     18    xright  = 19.0 #  web site says a 20 m long flume
     19                   #(http://www.eng.abdn.ac.uk/envhrg/facilities/swashrig.hti)
     20                   # Therefore 19 +1 (for reservoir)= 20
    1921    ybottom = 0
    2022    ytop    = 0.45
    2123    xdam = 0.0
    22     xleft = gate_position  - 13.0
     24    xleft = -1.0
     25    xslope = 4.0 # note, get in gen meshparrallel run dam as well!
    2326
    2427    #Outline
     
    3235    point_dam_bottom = [xdam, ybottom]   
    3336
     37    # slope seperation (middle)
     38    point_slope_top = [xslope, ytop]
     39    point_slope_bottom = [xslope, ybottom]   
     40
    3441    m = Mesh()
    3542
     
    3845              point_nw,
    3946              point_dam_top,
     47              point_slope_top,
    4048              point_ne,
    41               point_se,
     49              point_se,
     50              point_slope_bottom,
    4251              point_dam_bottom
    4352              ]
    4453   
    4554    segments = [[0,1], [1,2], [2,3],
    46                         [3,4 ],[4,5], [5,0],  #The outer border
    47                         [2,5]]         #dam Separator
     55                [3,4 ],[4,5], [5,6],[6,7],[7,0],  #The outer border
     56                [2,7],    #dam Separator
     57                [3,6]]        # slope separator
    4858   
    49     segment_tags = {'wall':[0,1,2,4,5],'edge':[3]} # '':[6]
     59    segment_tags = {'wall':[0,1,2,3,5,6,7],'edge':[4]} # '':[6]
    5060       
    5161    m.add_points_and_segments(points, segments, segment_tags)
    5262   
    5363    dam = m.add_region(-0.0000001,(ytop - ybottom)/2)
    54     # this is the location of the region.
     64    # this is the location of the reservoir region.
    5565    dam.setTag("dam")
     66   
     67    slope = m.add_region(xslope + 0.0000001,(ytop - ybottom)/2)
     68    # this is the location of the slope region.
     69    slope.setTag("slope")
    5670   
    5771    if is_coarse:
     
    6579#-------------------------------------------------------------
    6680if __name__ == "__main__":
    67     generate("aa.tsh", 0.75, is_course = True)
     81    generate("aa.tsh", is_coarse = True)
  • anuga_work/development/friction_UA_flume_2006/parallel_run_dam.py

    r4328 r4351  
    4747import create_mesh
    4848
     49def elevation_function(x,y):
     50    from Numeric import zeros, size, Float
     51    slope = 4 # note, get in gen mesh as well!
     52   
     53    z = zeros(size(x), Float)
     54    for i in range(len(x)):
     55        if x[i] < slope:
     56            z[i] = 0.0
     57        else:
     58            z[i] = (x[i]-slope)*0.1
     59    return z
    4960
    5061def main(friction, outputdir_name=None, is_trial_run=False):
     
    7687        # which checks if I dir is created, and if it isn't
    7788        #creates it.
    78         for i in range(500):
     89        for i in range(5000):
    7990            pass       
    80         pro_instance = project.Project(['data','flumes','dam_2006'],
     91        pro_instance = project.Project(['data','flumes','dam_2007'],
    8192                                       outputdir_name=outputdir_name)
    8293           
     
    97108    #-------------------------------------------------------------------------
    98109   
    99     gate_position = 12.0
     110    #gate_position = 12.0
    100111    create_mesh.generate(mesh_filename,
    101                          gate_position,
    102112                         is_coarse=is_trial_run) # this creates the mesh
    103113
     
    126136    #-------------------------------------------------------------------------
    127137
    128     domain.set_quantity('stage', 0.0)
     138    domain.set_quantity('stage', 0.06) # initial
    129139    domain.set_quantity('friction', friction)
    130     domain.set_quantity('elevation',0.0)
    131 
    132     domain.set_quantity('elevation', filename = 'elevation.xya',
    133                         alpha = 10.0,verbose = True, use_cache = True)
     140    domain.set_quantity('elevation', elevation_function)
     141
    134142   
    135143    print 'Available boundary tags', domain.get_boundary_tags()
     
    190198                 0.016, 0.017, 0.018,
    191199                 0.019, 0.02,
    192                  0.0225, 0.025, 0.03, 0.035, 0.04]
     200                 0.0225, 0.025, 0.03, 0.035, 0.04] # 17 processes
     201    #frictions = [0.0]
    193202    for i, friction in enumerate(frictions):
    194203        if i%size == rank:
    195204            print "I am processor %d of %d on node %s" %(rank, size, node)
    196             main(friction, is_trial_run = False, outputdir_name='friction_UA_still_water')
     205            main(friction, is_trial_run = True, outputdir_name='friction_UA_new_meshII')
  • anuga_work/development/friction_UA_flume_2006/run_dam.py

    r4328 r4351  
    99
    1010"""
     11print "create mesh and parallel run dam have been updated.  This has not."
     12import sys; sys.exit()
    1113#----------------------------------------------------------------------------
    1214# Import necessary modules
Note: See TracChangeset for help on using the changeset viewer.