Ignore:
Timestamp:
Jun 23, 2008, 1:01:17 PM (16 years ago)
Author:
Leharne
Message:

Updates to okushiri convergence study

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/convergence_okushiri_2008/run_okushiri_truescale.py

    r5396 r5411  
    1 """Validation of the AnuGA implementation of the shallow water wave equation.
     1"""Anuga convergence study using a true-scale version of the Okushiri
     2Island tsunami wavetank experiment
    23
    3 This script sets up a modified version of the Okushiri Island benchmark
     4This script runs a modified version of the Okushiri Island benchmark
    45
    56as published at
     
    1213
    1314This version up-scales the original 1:400 scale wave-tank experiment, to
    14 "true-scale".
     15"true-scale" with mesh defined using interior polygons.
    1516
    16 The original validation data was downloaded and made available in this directory
    17 for convenience but the original data is available at
     17The original validation data is available at
    1818http://www.cee.cornell.edu/longwave/index.cfm?page=benchmark&problem=2
    1919where a detailed description of the problem is also available.
    2020
    21 
    22 Run create_okushiri_truescale.py to process the boundary condition and build a the
    23 mesh before running this script.
     21Run create_okushiri_truescale.py to convert bathymetry and input boundary
     22condition into NetCDF format.
    2423
    2524"""
     25#----------------------------------------
     26# Import necessary modules
     27#----------------------------------------
    2628
    27 # Module imports
     29# Standard modules
     30from os import sep,umask
     31from os.path import dirname, basename
     32from os import mkdir, access, F_OK
     33from shutil import copy
     34import time
     35import sys
     36
     37# Related major packages
    2838from anuga.shallow_water import Domain
    2939from anuga.shallow_water import Reflective_boundary
    3040from anuga.shallow_water import Transmissive_Momentum_Set_Stage_boundary
    3141from anuga.abstract_2d_finite_volumes.util import file_function
    32 
    33 import project_truescale
     42from anuga.shallow_water.data_manager import copy_code_files, start_screen_catcher
     43from anuga.pmesh.mesh_interface import create_mesh_from_regions
    3444
    3545
    36 #-------------------------
     46import project_truescale # Definition of filenames and interior polygons
     47
     48copy_code_files(project_truescale.output_run_time_dir,'run_okushiri_truescale.py',
     49                'project_truescale.py' )
     50myid = 0
     51numprocs = 1
     52start_screen_catcher(project_truescale.output_run_time_dir, myid, numprocs)
     53
     54#--------------------------------------------------------------------------
     55# Create the triangular mesh based on overall bounding polygon with a
     56# tagged boundary and interior regions defined in project_truescale.py
     57# along with resolutions (maximal area of per triangle) for each polygon
     58#--------------------------------------------------------------------------
     59
     60create_mesh_from_regions(project_truescale.poly_all,
     61                         boundary_tags={'wall': [0, 1, 3],'wave': [2]},
     62                         maximum_triangle_area=project_truescale.res_poly_all,
     63                         #interior_regions=project_truescale.interior_regions,
     64                         filename=project_truescale.mesh_name+'.msh',
     65                         verbose=True)
     66
     67#------------------------------
    3768# Create Domain from mesh
    38 #-------------------------
    39 domain = Domain(project_truescale.mesh_filename, use_cache=True, verbose=True)
     69#------------------------------
     70domain = Domain(project_truescale.mesh_name+'.msh', use_cache=True, verbose=True)
    4071print domain.statistics()
    4172
     
    4374
    4475# Write vertex coordinates to file
    45 filename='okushiri_mesh_vertex_coordinates_truescale.txt'
     76filename=project.vertex_filename
    4677fid=open(filename,'w')
    4778fid.write('x (m), y (m)\n')
     
    6899#-------------------------
    69100domain.set_name(project_truescale.output_filename)  # Name of output sww file
    70 domain.set_datadir(project_truescale.output_dir)
     101domain.set_datadir(project_truescale.output_run_time_dir) # Name of output directory
    71102domain.set_default_order(2)               # Apply second order scheme
    72103domain.set_all_limiters(0.9)              # Max second order scheme (old lim)
    73 domain.set_minimum_storable_height(0.4)   # Don't store h < 0.4m
     104domain.set_minimum_storable_height(0.1)   # Don't store h < 0.1m
    74105domain.tight_slope_limiters = 1
    75106domain.beta_h = 0.0
    76107
    77 #Timings on AMD64-242 (beta_h=0)
    78 #  tight_slope_limiters = 0:
    79 #    3035s - 3110s
    80 #  tight_slope_limiters = 1:
    81 #    3000s - 3008s
    82 #
    83 # beta_h>0: In the order of 3200s
    84108
    85109#-------------------------
     
    109133t0 = time.time()
    110134
    111 for t in domain.evolve(yieldstep = 1, finaltime = 450):
     135for t in domain.evolve(yieldstep=project_truescale.yieldstep, finaltime = 450):
    112136    print domain.timestepping_statistics(track_speeds=False,
    113137                                         triangle_id=triangle_id)
Note: See TracChangeset for help on using the changeset viewer.