Changeset 3845


Ignore:
Timestamp:
Oct 24, 2006, 12:54:50 PM (16 years ago)
Author:
ole
Message:

Work on Okushiri

Location:
anuga_validation/okushiri_2005
Files:
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • anuga_validation/okushiri_2005/create_okushiri.py

    r3786 r3845  
    7474    #xya2pts(project.bathymetry_filename, verbose = True,
    7575    #        z_func = lambda z: -z)
    76 
    77 
    78 
    7976
    8077
  • anuga_validation/okushiri_2005/extract_timeseries.py

    r3636 r3845  
    1 """Read in tms file, interpolate at specified locations (ch 5,7,9) and compare
     1"""Verify that simulation produced by ANUGA compares to published
     2validation timeseries ch5, ch7 and ch9 as well as the boundary timeseries.
     3
     4RMS norm is printed and plots are produced.
    25"""
    36
    4 import sys
    5 from os import sep
     7
     8
    69from anuga.caching import cache
    710
    8 sys.path.append('..'+sep+'..'+sep)
     11
    912
    1013
  • anuga_validation/okushiri_2005/project.py

    r2229 r3845  
    1 """Common filenames for LWRU benchmark project 2
     1"""Common filenames for Okushiri Island validation
    22"""
    33
     
    66mesh_filename = 'Benchmark_2.msh'
    77
     8output_filename = 'okushiri.sww'
    89
    910
     11
  • anuga_validation/okushiri_2005/run_okushiri.py

    r3811 r3845  
    11"""Validation of the AnuGA implementation of the shallow water wave equation.
    22
    3 This script sets up LWRU2 benchmark with initial condition stated
     3This script sets up Okushiri Island benchmark as published at the
    44
    5 See also
     5THE THIRD INTERNATIONAL WORKSHOP ON LONG-WAVE RUNUP MODELS
     6June 17-18 2004
     7Wrigley Marine Science Center
     8Catalina Island, California
     9http://www.cee.cornell.edu/longwave/
    610
     11
     12The validation data was downloaded and made available in this directory
     13for convenience but the original data is available at
    714http://www.cee.cornell.edu/longwave/index.cfm?page=benchmark&problem=2
     15where a detailed description of the problem is also available.
    816
    9 Depth at western boundary is d = 13.5 cm
     17
     18Run create_okushiri.py to process the boundary condition and build a the
     19mesh before running this script.
     20
    1021"""
    1122
    1223# Module imports
    13 from Numeric import array, zeros, Float, allclose
    14 
    1524from anuga.shallow_water import Domain
    1625from anuga.shallow_water import Reflective_boundary
     
    2231
    2332#-------------------------
    24 # Create Domain
     33# Create Domain from mesh
    2534#-------------------------
    26 
    27 use_variable_mesh = True #Use large variable mesh generated by create_mesh.py
    28 #use_variable_mesh = False #Use small structured mesh for speed
    29 
    30 if use_variable_mesh is True:
    31     print 'Creating domain from', project.mesh_filename
    32 
    33     domain = Domain(project.mesh_filename, use_cache=True, verbose=True)
    34 else:
    35     print 'Creating regular from regular mesh'
    36     N = 150
    37     points, vertices, boundary = rectangular_cross(N, N/5*3,
    38                                                    len1=5.448, len2=3.402)
    39     domain = Domain(points, vertices, boundary)
    40 
    41 domain.set_name('okushiri_as2005_with_mxspd=0.1')
    42 domain.set_default_order(2)
    43 domain.set_minimum_storable_height(0.001)
    44 #domain.set_maximum_allowed_speed(0) # The default in August 2005
    45 domain.set_maximum_allowed_speed(0.1) # Allow a little runoff (0.1 is OK)
    46 
    47 
    48 # Set old (pre Sep 2006) defaults for limiters
    49 domain.beta_w      = 0.9
    50 domain.beta_w_dry  = 0.9
    51 domain.beta_uh     = 0.9
    52 domain.beta_uh_dry = 0.9
    53 domain.beta_vh     = 0.9
    54 domain.beta_vh_dry = 0.9
    55 
    56 domain.check_integrity()
    57 print domain.statistics()
     35domain = Domain(project.mesh_filename, use_cache=True, verbose=True)
    5836
    5937
     
    6442domain.set_quantity('stage', 0.0)
    6543domain.set_quantity('elevation',
    66                     filename=project.bathymetry_filename[:-4] + '.pts',
    67                     alpha=0.02,
    68                     verbose=True,
    69                     use_cache=True)
     44                    filename = project.bathymetry_filename[:-4] + '.pts',
     45                    alpha = 0.02,                   
     46                    verbose = True,
     47                    use_cache = True)
     48
     49
     50#-------------------------
     51# Domain parameters
     52#-------------------------
     53domain.set_name(project.output_filename)
     54domain.set_default_order(2)
     55domain.set_minimum_storable_height(0.001)
     56domain.set_maximum_allowed_speed(0.1) # Allow a little runoff (0.1 is OK)
     57
     58# Set old (pre Sep 2006) defaults for limiters
     59#domain.beta_w      = 0.9
     60#domain.beta_w_dry  = 0.9
     61#domain.beta_uh     = 0.9
     62#domain.beta_uh_dry = 0.9
     63#domain.beta_vh     = 0.9
     64#domain.beta_vh_dry = 0.9
     65
     66#domain.check_integrity()
     67#print domain.statistics()
     68
     69
    7070
    7171#-------------------------
    7272# Boundary Conditions
    7373#-------------------------
     74
     75# Create boundary function from timeseries provided in file
     76function = file_function(project.boundary_filename[:-4] + '.tms',
     77                         domain, verbose=True)
     78
     79# Create and assign boundary objects
     80Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function)
    7481Br = Reflective_boundary(domain)
    75 
    76 function = file_function(project.boundary_filename[:-4] + '.tms',
    77                          domain,
    78                          verbose=True)
    79 
    80 Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function)
    81 
    82 if use_variable_mesh is True:
    83     domain.set_boundary({'wave': Bts, 'wall': Br})
    84 else:
    85     domain.set_boundary({'left': Bts, 'right': Br, 'bottom': Br, 'top': Br})
     82domain.set_boundary({'wave': Bts, 'wall': Br})
    8683
    8784
     
    9289t0 = time.time()
    9390
    94 w_max = 0
    9591for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5):
    9692    domain.write_time()
    9793
    98     w = domain.get_maximum_inundation_elevation()
    99     x, y = domain.get_maximum_inundation_location()
    100     print '  Coastline elevation = %.2f at (x,y)=(%.2f, %.2f)' %(w, x, y)
    101     print
    102    
    103     if w > w_max:
    104         w_max = w
    105         x_max = x
    106         y_max = y
    107 
    108 
    109 print '**********************************************'
    110 print 'Max coastline elevation = %.2f at (%.2f, %.2f)' %(w_max, x_max, y_max)
    111 print '**********************************************'
    112    
    113    
    114 
    11594print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.