Changeset 3916


Ignore:
Timestamp:
Nov 3, 2006, 5:16:40 PM (16 years ago)
Author:
ole
Message:

Second stab at automatic validation using okushiri data

Location:
anuga_validation/automated_validation_tests/okushiri_tank_validation
Files:
2 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/automated_validation_tests/okushiri_tank_validation/create_okushiri.py

    r3825 r3916  
    88from anuga.pmesh.mesh_interface import create_mesh_from_regions
    99from anuga.coordinate_transforms.geo_reference import Geo_reference
     10from anuga.geospatial_data import Geospatial_data
    1011
    1112import project
     
    1314
    1415def prepare_timeboundary(filename):
    15     """Converting benchmark 2 time series to NetCDF tms file.
     16    """Convert benchmark 2 time series to NetCDF tms file.
    1617    This is a 'throw-away' code taylor made for files like
    1718    'Benchmark_2_input.txt' from the LWRU2 benchmark
    1819    """
    1920
    20     print 'Preparing time boundary from %s' %filename
     21    from Scientific.IO.NetCDF import NetCDFFile
    2122    from Numeric import array
    2223
    23     fid = open(filename)
    2424
    25     #Skip first line
     25    print 'Creating', filename
     26
     27    # Read the ascii (.txt) version of this file
     28    fid = open(filename[:-4] + '.txt')
     29
     30    # Skip first line
    2631    line = fid.readline()
    2732
    28     #Read remaining lines
     33    # Read remaining lines
    2934    lines = fid.readlines()
    3035    fid.close()
     
    4247
    4348
    44     #Create tms file
    45     from Scientific.IO.NetCDF import NetCDFFile
     49    # Create tms NetCDF file
    4650
    47     outfile = filename[:-4] + '.tms'
    48     print 'Writing to', outfile
    49     fid = NetCDFFile(outfile, 'w')
    50 
     51    fid = NetCDFFile(filename, 'w')
    5152    fid.institution = 'Geoscience Australia'
    5253    fid.description = 'Input wave for Benchmark 2'
     
    7172if __name__ == "__main__":
    7273
     74
    7375    # Prepare time boundary
    7476    prepare_timeboundary(project.boundary_filename)
     
    8284    #--------------------------------------------------------------------------
    8385
    84     base_resolution = 10
    8586
    86     # Basic geometry
     87    base_resolution = 1 # Use this to coarsen or refine entire mesh.
     88
     89    # Basic geometry and bounding polygon
    8790    xleft   = 0
    8891    xright  = 5.448
     
    9093    ytop    = 3.402
    9194
    92     # Outline
    9395    point_sw = [xleft, ybottom]
    9496    point_se = [xright, ybottom]
     
    9698    point_ne = [xright, ytop]
    9799
    98     # Midway points (left)
    99     point_mtop = [xleft + (xright-xleft)/3+1, ytop]
    100     point_mbottom = [xleft + (xright-xleft)/3+1, ybottom]
     100    bounding_polygon = [point_se,
     101                        point_ne,
     102                        point_nw,
     103                        point_sw]
     104   
    101105
    102     #Localised refined area for gulleys
     106    # Localised refined area for gulleys
    103107    xl = 4.8
    104108    xr = 5.3
     
    109113    p2 = [xr, yt]
    110114    p3 = [xl, yt]
     115   
    111116    gulleys = [p0, p1, p2, p3]
     117   
    112118
    113     #Island area
     119
     120    # Island area and drawdown region
    114121    island_0 = [xleft + 2*(xright-xleft)/3+1.2, ytop-0.5]
    115122    island_1 = [xleft + 2*(xright-xleft)/3+0.5, ybottom + 2*(ytop-ybottom)/3]
    116     island_2 = [xleft + (xright-xleft)/2+0.3, ybottom + 2*(ytop-ybottom)/3-0.3]
    117     island_3 = [xleft + (xright-xleft)/2+0.3, ybottom + (ytop-ybottom)/3+0.3]
     123    island_2 = [xleft + (xright-xleft)/2+0.4, ybottom + 2*(ytop-ybottom)/3-0.3]
     124    island_3 = [xleft + (xright-xleft)/2+0.4, ybottom + (ytop-ybottom)/3+0.3]
    118125    island_4 = [xleft + 2*(xright-xleft)/3+0.4, ybottom + (ytop-ybottom)/3-0.3]
    119     island_5 = [xleft + 2*(xright-xleft)/3+1.2, ybottom+0.2]
    120     island_6 = [xl-.01, yb]  #OK
    121     island_7 = [xl-.01, yt]  #OK     
    122 
     126    island_5 = [xleft + 2*(xright-xleft)/3+1.2, ybottom+0.8]
     127    island_6 = [xl-.01, yb]  # Keep right edge just off the gulleys
     128    island_7 = [xl-.01, yt]
     129 
    123130    island = [island_0, island_1, island_2,
    124131              island_3, island_4, island_5,
     
    126133
    127134
    128    
    129135
    130     bounding_polygon = [point_se,
    131                         point_ne,
    132                         point_mtop,
    133                         point_nw,
    134                         point_sw,
    135                         point_mbottom]
    136    
     136    # Region spanning half right hand side of domain just inside boundary
     137    rhs_nw = [xleft + (xright-xleft)/3+1, ytop-1.4]
     138    rhs_sw = [xleft + (xright-xleft)/3+1, ybottom+0.5]
     139    rhs_se = [xright-0.1, ybottom+0.2]
     140    rhs_ne = [xright-0.1, ytop-0.2]       
    137141
    138     interior_regions = [[gulleys, 0.00002*base_resolution],
    139                         [island, 0.00007*base_resolution]]
    140    
    141 
     142    rhs_region = [rhs_nw, rhs_ne, rhs_se, rhs_sw]
    142143
    143144   
    144 
    145     print 'start create mesh from regions'
     145    # Interior regions and creation of mesh
     146    interior_regions = [[rhs_region, 0.0005],
     147                        [island, 0.0003*base_resolution],
     148                        [gulleys, 0.00003*base_resolution]]   
    146149
    147150    meshname = project.mesh_filename + '.msh'
    148151    m = create_mesh_from_regions(bounding_polygon,
    149                                  boundary_tags={'wall': [0, 1, 2, 4, 5],
    150                                                 'wave': [3]},
     152                                 boundary_tags={'wall': [0, 1, 3],
     153                                                'wave': [2]},     
    151154                                 maximum_triangle_area=0.1*base_resolution,
    152155                                 interior_regions=interior_regions,
    153156                                 filename=project.mesh_filename,
    154                                  use_cache=True,
     157                                 use_cache=False,
    155158                                 verbose=True)
    156159
  • anuga_validation/automated_validation_tests/okushiri_tank_validation/project.py

    r3708 r3916  
    1 """Common filenames for LWRU benchmark project 2
     1"""Common filenames for Okushiri Island validation
     2Formats are given as ANUGA native netCDF where applicable.
     3
    24"""
    35
    4 boundary_filename = 'Benchmark_2_input.txt'
    5 bathymetry_filename = 'Benchmark_2_Bathymetry.txt'
     6# Given boundary wave
     7boundary_filename = 'Benchmark_2_input.tms'
     8
     9# Observed timeseries
     10validation_filename = 'output_ch5-7-9.txt'
     11
     12# Digital Elevation Model
     13bathymetry_filename = 'Benchmark_2_Bathymetry.pts'
     14
     15# Triangular mesh
    616mesh_filename = 'Benchmark_2.msh'
     17
     18# Model output
     19output_filename = 'okushiri_auta_validation.sww'
    720
    821
Note: See TracChangeset for help on using the changeset viewer.