Changeset 5720


Ignore:
Timestamp:
Sep 1, 2008, 2:25:29 PM (16 years ago)
Author:
Leharne
Message:

Updates to okushiri convergence study

Location:
anuga_work/development/convergence_okushiri_2008
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/convergence_okushiri_2008/README.txt

    r5366 r5720  
    66the Third International Conference on Long Wave Runup:
    77http://www.cee.cornell.edu/longwave/index.cfm?page=benchmark&problem=2.
    8 Once this up-scaling has been completed and verified, then the files will be used for conducting
    9 a convergence study in ANUGA. This component is still in development.
     8
     9The "up-scaled" files are then used for conducting a convergence study
     10in ANUGA.
    1011
    1112Data files available in this directory are
     
    4041  together with the experimental data provided. Numerical similarity
    4142  measures will also be computed.
    42  
     43 
     44get_timeseries.py
     45  This script extracts timeseries from the sww file and writes them to individual
     46  csv files for each gauge location.
     47
     48export_results.py
     49  This script extracts a number of variables from the sww file (for eg stage,
     50  depth, momentum) in three regions at three different but fixed regular grid
     51  resolutions (at either discrete time indices or maximised over the whole
     52  simulation).
    4353
    4454Methodology for true-scale transformation:
  • anuga_work/development/convergence_okushiri_2008/export_results.py

    r5604 r5720  
    11import project_truescale, os
    22import sys
     3import time
    34from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    45from anuga.shallow_water.data_manager import sww2dem
     6from anuga.geospatial_data.geospatial_data import *
    57from os import sep
    68
     
    1517res_dir9 = '20080715_015727_run_1-32_contour_polygons_lfountai'
    1618res_dir10 = '20080721_015521_run_1-64_contour_polygons_lfountai'
    17 res_dirs = [#res_dir1, res_dir2, res_dir3, res_dir4, res_dir5, res_dir6, res_dir7, res_dir8,
    18             res_dir9, res_dir10]
     19res_dirs = [res_dir1, #res_dir2, res_dir3, res_dir4, res_dir5, res_dir6, res_dir7, res_dir8,res_dir9,
     20            res_dir10]
     21#timesteps = [200, 250, 300, 350, 400, 450]
     22timesteps = [327] #this is time of maximum inundation
     23
    1924
    2025for res_dir in res_dirs:
    2126   
    22     #timestep = 0
    23     directory = project_truescale.output_dir+res_dir+sep
    24     name = directory+'okushiri_truescale'
     27    for timestep in timesteps:
     28               
     29        directory = project_truescale.output_dir+res_dir+sep
     30        name = directory+'okushiri_truescale'
    2531
    26     is_parallel = False
    27     #is_parallel = True
     32        is_parallel = False
     33        #is_parallel = True
    2834
    29     if is_parallel == True: nodes = 10
    30     print 'output directory:', directory
     35        if is_parallel == True: nodes = 10
     36        print 'output directory:', directory
    3137
    32     area = ['Deep', 'Mid', 'Shallow']
     38        area = ['Deep', 'Mid', 'Shallow']
     39           
     40        for which_area in area:
     41            if which_area == 'Deep':
     42                cellsize = 50
     43                easting_min = project_truescale.xminDeep
     44                easting_max = project_truescale.xmaxDeep
     45                northing_min = project_truescale.yminDeep
     46                northing_max = project_truescale.ymaxDeep
    3347
    34     for which_area in area:
    35         if which_area == 'Deep':
    36             cellsize = 50
    37             easting_min = project_truescale.xminDeep
    38             easting_max = project_truescale.xmaxDeep
    39             northing_min = project_truescale.yminDeep
    40             northing_max = project_truescale.ymaxDeep
     48            if which_area == 'Mid':
     49                cellsize = 25
     50                easting_min = project_truescale.xminMid
     51                easting_max = project_truescale.xmaxMid
     52                northing_min = project_truescale.yminMid
     53                northing_max = project_truescale.ymaxMid
    4154
    42         if which_area == 'Mid':
    43             cellsize = 25
    44             easting_min = project_truescale.xminMid
    45             easting_max = project_truescale.xmaxMid
    46             northing_min = project_truescale.yminMid
    47             northing_max = project_truescale.ymaxMid
     55            if which_area == 'Shallow':
     56                cellsize = 10
     57                easting_min = project_truescale.xminShallow
     58                easting_max = project_truescale.xmaxShallow
     59                northing_min = project_truescale.yminShallow
     60                northing_max = project_truescale.ymaxShallow
    4861
    49         if which_area == 'Shallow':
    50             cellsize = 10
    51             easting_min = project_truescale.xminShallow
    52             easting_max = project_truescale.xmaxShallow
    53             northing_min = project_truescale.yminShallow
    54             northing_max = project_truescale.ymaxShallow
     62    ##    which_area='all'
     63    ##    easting_min=0
     64    ##    easting_max=2179.2
     65    ##    northing_min=0
     66    ##    northing_max=1360.8
     67    ##    cellsize=10
     68       
     69           
     70            var = [2]
     71               
     72            for which_var in var:
     73                if which_var == 0:  # Stage
     74                    outname = directory + which_area + '_stage_' + str(timestep)
     75                    quantityname = 'stage'
     76
     77                if which_var == 1:  # Absolute Momentum
     78                    outname = directory + which_area + '_momentum_' + str(timestep)
     79                    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
     80
     81                if which_var == 2:  # Depth
     82                    outname = directory + which_area + '_depth_' + str(timestep)
     83                    quantityname = 'stage-elevation' 
     84
     85                if which_var == 3:  # Speed
     86                    outname = directory + which_area + '_speed_' + str(timestep)
     87                    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
     88
     89                if which_var == 4:  # Elevation
     90                    outname = directory + which_area + '_elevation_' + str(timestep)
     91                    quantityname = 'elevation' 
     92
     93    ##            if is_parallel == True:
     94    ##            #    print 'is_parallel',is_parallel
     95    ##                for i in range(0,nodes):
     96    ##                    namei = name + '_P%d_%d' %(i,nodes)
     97    ##                    outnamei = outname + '_P%d_%d' %(i,nodes)
     98    ##                    print 'start sww2dem for sww file %d' %(i)
     99    ##                    sww2dem(namei, basename_out = outnamei,
     100    ##                                quantity = quantityname,
     101    ##                                timestep = timestep,
     102    ##                                cellsize = cellsize,     
     103    ##                                easting_min = project_grad.e_min_area,
     104    ##                                easting_max = project_grad.e_max_area,
     105    ##                                northing_min = project_grad.n_min_area,
     106    ##                                northing_max = project_grad.n_max_area,       
     107    ##                                reduction = max,
     108    ##                                verbose = True,
     109    ##                                format = 'asc')
     110    ##            else:
     111
     112               
     113                print 'start sww2dem', which_area
     114                sww2dem(name, basename_out = outname,
     115                            quantity = quantityname,
     116                            timestep = timestep,
     117                            cellsize = cellsize,     
     118                            easting_min = easting_min,
     119                            easting_max = easting_max,
     120                            northing_min = northing_min,
     121                            northing_max = northing_max,       
     122                            reduction = max,
     123                            verbose = True,
     124                            format = 'ers')
    55125
    56126
    57        # var = [2,3,4] # depth and speed
    58     #var = [2] # depth
    59         var = [0,4]
    60 
    61         for which_var in var:
    62             if which_var == 0:  # Stage
    63                 outname = directory + which_area + '_stage'
    64                 quantityname = 'stage'
    65 
    66             if which_var == 1:  # Absolute Momentum
    67                 outname = directory + which_area + '_momentum'
    68                 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
    69 
    70             if which_var == 2:  # Depth
    71                 outname = directory + which_area + '_depth'
    72                 quantityname = 'stage-elevation' 
    73 
    74             if which_var == 3:  # Speed
    75                 outname = directory + which_area + '_speed'
    76                 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
    77 
    78             if which_var == 4:  # Elevation
    79                 outname = directory + which_area + '_elevation'
    80                 quantityname = 'elevation' 
    81 
    82 ##            if is_parallel == True:
    83 ##            #    print 'is_parallel',is_parallel
    84 ##                for i in range(0,nodes):
    85 ##                    namei = name + '_P%d_%d' %(i,nodes)
    86 ##                    outnamei = outname + '_P%d_%d' %(i,nodes)
    87 ##                    print 'start sww2dem for sww file %d' %(i)
    88 ##                    sww2dem(namei, basename_out = outnamei,
    89 ##                                quantity = quantityname,
    90 ##                                timestep = timestep,
    91 ##                                cellsize = cellsize,     
    92 ##                                easting_min = project_grad.e_min_area,
    93 ##                                easting_max = project_grad.e_max_area,
    94 ##                                northing_min = project_grad.n_min_area,
    95 ##                                northing_max = project_grad.n_max_area,       
    96 ##                                reduction = max,
    97 ##                                verbose = True,
    98 ##                                format = 'asc')
    99 ##            else:
    100             print 'start sww2dem', which_area
    101             sww2dem(name, basename_out = outname,
    102                         quantity = quantityname,
    103                         #timestep = timestep,
    104                         cellsize = cellsize,     
    105                         easting_min = easting_min,
    106                         easting_max = easting_max,
    107                         northing_min = northing_min,
    108                         northing_max = northing_max,       
    109                         reduction = max,
    110                         verbose = True,
    111                         format = 'ers')
    112 
     127##convert_dem_from_ascii2netcdf(outname, use_cache=True, verbose=True)
     128##dem2pts(outname, use_cache=True, verbose=True)
     129##G = Geospatial_data(file_name = outname + '.pts')
     130##G.export_points_file('test' + '.txt')
  • anuga_work/development/convergence_okushiri_2008/get_timeseries.py

    r5411 r5720  
    1616
    1717#timestamp='20080617_001810_run_leharne'
    18 timestamp='20080617_041810_run_original_no_int_polygons_lfountai'
     18#timestamp='20080617_041810_run_original_no_int_polygons_lfountai'
     19#timestamp='20080617_040837_run_half_lfountai'
     20#timestamp='20080617_041356_run_double_lfountai'
     21#timestamp='20080708_064714_run_original_contour_polygons_lfountai'
     22#timestamp='20080708_064815_run_half_contour_polygons_lfountai'
     23#timestamp='20080708_064841_run_double_contour_polygons_lfountai'
     24#timestamp='20080714_231759_run_quarter_contour_polygons_lfountai'
     25#timestamp='20080714_234934_run_eighth_contour_polygons_lfountai'
     26#timestamp='20080714_235634_run_sixteenth_contour_polygons_lfountai'
     27#timestamp='20080715_015727_run_1-32_contour_polygons_lfountai'
     28#timestamp='20080715_023223_run_quadruple_contour_polygons_lfountai'
     29#timestamp='20080721_015521_run_1-64_contour_polygons_lfountai'
     30#timestamp='20080725_051221_run_octuple_contour_polygons_lfountai'
     31timestamp='20080725_022934_run_1.5_contour_polygons_lfountai'
     32
     33
    1934filename=project_truescale.output_dir+timestamp+sep+project_truescale.output_filename
    2035
  • anuga_work/development/convergence_okushiri_2008/project_truescale.py

    r5604 r5720  
    1 """Common filenames for truescale Okushiri Island convergence study
    2 Formats are given as ANUGA native netCDF where applicable.
     1"""Common filenames and run parameters for truescale Okushiri Island
     2convergence study. Formats are given as ANUGA native netCDF where applicable.
    33
    44"""
     
    200200
    201201xminDeep = 0
    202 xmaxDeep = 1000
     202xmaxDeep = 950
    203203yminDeep = 0
    204 ymaxDeep = 1360.8
     204ymaxDeep = 1400
    205205
    206206xminMid = 1000
    207207xmaxMid = 1700
    208208yminMid = 0
    209 ymaxMid = 1360.8
    210 
    211 xminShallow = 1700
    212 xmaxShallow = 2179.2
     209ymaxMid = 1400
     210
     211xminShallow = 1725
     212xmaxShallow = 2175
    213213yminShallow = 0
    214 ymaxShallow = 1360.8
    215 
    216 
    217 
    218 
    219 
     214ymaxShallow = 1400
     215
     216
     217
     218
     219
  • anuga_work/development/convergence_okushiri_2008/run_okushiri_truescale.py

    r5442 r5720  
    1313
    1414This version up-scales the original 1:400 scale wave-tank experiment, to
    15 "true-scale" with mesh defined using interior polygons.
     15"true-scale" with mesh defined using interior polygons. The resolution is then
     16varied by a factor of 2 to investigate convergence behaviour (refer to script
     17project_truescale.py for details).
    1618
    1719The original validation data is available at
     
    6163                         boundary_tags={'wall': [0, 1, 3],'wave': [2]},
    6264                         maximum_triangle_area=project_truescale.res_poly_all,
    63                          #interior_regions=project_truescale.interior_regions,
     65                         interior_regions=project_truescale.interior_regions, # comment out when not using interior polygon definitions
    6466                         filename=project_truescale.mesh_name+'.msh',
    6567                         verbose=True)
     
    7476
    7577# Write vertex coordinates to file
    76 filename=project.vertex_filename
     78filename=project_truescale.vertex_filename
    7779fid=open(filename,'w')
    7880fid.write('x (m), y (m)\n')
Note: See TracChangeset for help on using the changeset viewer.