Changeset 2417


Ignore:
Timestamp:
Feb 16, 2006, 3:41:21 PM (19 years ago)
Author:
nicholas
Message:

Creation of looped friction to auto generate multiple friction blocks. CCS.py created as modified copy of PCS.py ( plots cross section at various times of buildings and friction blocks)

Location:
development/momentum_sink
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • development/momentum_sink/PCS.py

    r2415 r2417  
    77import project
    88from pyvolution.util import file_function
    9 #from pyvolution.coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn
    10 #from coordinate_transforms.redfearn import degminsec2decimal_degrees, redfearn
     9from create_buildings import porosity, WidtH
     10# from run_friction import fric
    1111from pylab import *
    12 #from compare_sww import gauge_locations
    1312
    14    
     13fric = 1   
    1514#swwfile = project.newoutputname + '.sww'
    1615#swwfile = project.outputname
    17 swwfile_B = project.outputdir + sep  + 'Buildings_3790.sww'
    18 swwfile_F = project.outputdir + sep  + 'Buildings_3662.sww'
    19 #swwfile_F = project.outputdir + sep  + 'friction_3135.sww'
    2016
    21 gauge_depth = Numeric.arrayrange(0, 700, 10)
     17#swwfile_B = project.outputdir + sep  + 'Buildings_3790.sww'
     18#swwfile_B = project.outputdir + sep  + 'Buildings_3662.sww'
     19swwfile_B = project.outputdir + sep  + 'friction_n=10_3135.sww'
     20swwfile_F = project.outputdir + sep  + 'friction_n=20_3135.sww'
     21
     22gauge_depth = Numeric.arrayrange(0, 2.5*WidtH, 5)
    2223gauge_breadth = 100
    2324gauge_locations = []
     
    5556    velocity = []
    5657    for i, GL in enumerate(gauge_depth):
     58
     59        # mines data from specified time values in sww file
    5760        wB = f_B(t, point_id = i)[0]
    5861        zB = f_B(t, point_id = i)[1]
     
    8285
    8386    ion()
    84     hold(False)
     87    hold(True)
     88    subplot(211)
     89   
    8590    plot(gauge_depth, stages_B, '-b',gauge_depth,stages_F,'-r')
    86     title('Time_%d_ vs water depth' %t)
     91    title('Time_%d_ vs water depth (n=%f, BP=%f)' %(t, fric, porosity))
    8792    xlabel('gauge length(m)')
    8893    ylabel('water depths (m)')
    89     savefig('Comp_Time%d_B_vs_F' %t)
    90     #plot(gauge_depth, diff, 'g')
    91     #title('differences')
    92     # raw_input('Next')
     94    #savefig('Comp_Time%d_B_vs_F' %t)
     95    hold(False)
     96#savefig('Final_comp_n=%s' %fric)
     97subplot(212)
     98subplots_adjust(hspace = 0.4)
     99plot(gauge_depth, diff, 'g')
     100title('Final Differences in water levels')
     101xlabel('gauge length(m)')
     102ylabel('water differences (m)')
     103savefig('Final_Water_diff_n=%s' %fric)
    93104print "finished"
    94105
  • development/momentum_sink/create_buildings.py

    r2415 r2417  
    77
    88
     9WidtH = 200 # width of boudary in metres
     10depth = 20 # depth of building side to oncoming wave
     11breadth = 20 # breadth of building
     12print "building footprint"
     13print depth * breadth , "m^2"
     14block = 625
     15BL = block**0.5
     16
     17porosity = breadth/BL
     18print porosity, " Building porosity"
    919
    1020def create_mesh(maximum_triangle_area,
     
    1828    m = Mesh()
    1929    # Boundary of problem
    20     WidtH = 200 # width of boudary in metres
     30   
    2131    #W = WidtH/8
    2232    #L = W
     
    2636
    2737    # inner polygons => building boundaries
    28     depth = 4 # depth of building side to oncoming wave
     38   
    2939    wh = depth/2
    30     breadth = 4 # breadth of building
     40   
    3141    lh = breadth/2
    3242         
    33     print "building footprint"
    34     print depth * breadth , "m^2"
    35     block = 625
    36     BL = block**0.5
    3743    ForDep = (0.2*WidtH) + (BL/2)
    3844    RearDep = 1.2*WidtH
    39     porosity = breadth/BL
    40     print porosity, " Building porosity"
    4145       
    4246    Breadths = Numeric.arrayrange( (BL/2), WidtH, (BL))
  • development/momentum_sink/project_friction.py

    r2379 r2417  
    1212
    1313scenario_dir_name = 'momentum_sink_2005'
    14 basename = 'friction'
     14basename = 'friction_n='
    1515
    1616if sys.platform == 'win32':
  • development/momentum_sink/run_friction.py

    r2415 r2417  
    44#           #name does not have the extension
    55
     6
     7# set friction value for zone
     8fric=10
     9
     10# fwojhrt
    611import time
    712
     
    6065domain.set_quantity('friction', 0.01)
    6166domain.set_quantity('stage', 0)
    62 domain.set_region(Set_region('mound', 'friction', 10)) #, location='unique vertices'))
     67domain.set_region(Set_region('mound', 'friction', fric)) #, location='unique vertices'))
    6368#Setup Boundary Conditions
    6469print domain.get_boundary_tags()
Note: See TracChangeset for help on using the changeset viewer.