Changeset 5085 for anuga_work/debug


Ignore:
Timestamp:
Feb 27, 2008, 10:12:20 AM (17 years ago)
Author:
ole
Message:

Further simplification of run_dam debugging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/debug/bad_time_step/run_dam.py

    r5084 r5085  
    11"""
     2Script for debugging potential problem with the boundary
     3condition: transmissive_momentum_set_stage
    24
    3 Script for running a breaking wave simulation of Jon Hinwoods wave tank.
    4 Note: this is based on the frinction_ua_flume_2006 structure.
     5When the wave reflects back towards the boundary excessive values
     6for momentum are generated leading to degenerate timesteps.
    57
    6 
    7 Duncan Gray, GA - 2007
     8Ole Nielsen and Duncan Gray, GA - 2008
    89"""
    910
     
    2324
    2425from anuga.abstract_2d_finite_volumes.util import file_function
    25 #from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
     26from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross
    2627from anuga.pmesh.mesh_interface import create_mesh_from_regions
    2728
     
    4950#-------------------------------------------------------------------------
    5051friction=0.01
    51 maximum_triangle_area=0.01
    52 #maximum_triangle_area=0.1 #OK
    5352
    5453basename = 'debug_boundary'
    55 mesh_filename = basename + '.msh'
    5654
    5755boundary_file = 'boundary.tms'
     
    6462#-------------------------------------------------------------------------
    6563
    66 # Original unstructured mesh ()
    67 #create_mesh.generate(mesh_filename,
    68 #                     maximum_triangle_area=maximum_triangle_area)
    69 
    70 
    71 # Simple mesh with same dimensions
    72 
    7364xright  = 19.0
    7465ybottom = 0
    7566ytop    = 0.45
    7667xleft = 0.0
    77 #xslope = 4.0
    7868
    79 #Outline
    80 point_sw = [xleft, ybottom]
    81 point_se = [xright, ybottom]
    82 point_nw = [xleft, ytop]   
    83 point_ne = [xright, ytop]
    84 
    85 
    86 create_mesh_from_regions([point_sw,
    87                           point_se,
    88                           point_ne,
    89                           point_nw],
    90                          {'wall': [0,1,2], 'wave': [3]},
    91                          maximum_triangle_area=maximum_triangle_area,
    92                          filename=mesh_filename)
    93 
    94 
    95 #TODO
    96 #points, elements, boundary = rectangular_cross(m, n, len1=1.0, len2=1.0, origin = (0.0, 0.0)):
     69#Very simple mesh
     70points, elements, boundary = rectangular_cross(200, 5,
     71                                               len1=xright,
     72                                               len2=ytop,
     73                                               origin = (0.0, 0.0))
    9774
    9875
     
    10178# Setup computational domain
    10279#-------------------------------------------------------------------------
    103 domain = Domain(mesh_filename, use_cache = False, verbose = True)
     80#domain = Domain(mesh_filename, use_cache = False, verbose = True)
     81domain = Domain(points, elements, boundary, verbose = True)
    10482print domain.statistics()
    10583
     
    125103Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function)
    126104Br = Reflective_boundary(domain)
    127 domain.set_boundary( {'wall': Br, 'wave': Bts} )
     105domain.set_boundary( {'top': Br, 'right': Br, 'bottom':Br, 'left': Bts} )
    128106
    129107
     
    134112for t in domain.evolve(0.1, 15):
    135113    print domain.timestepping_statistics(track_speeds=False)
    136     print domain.boundary_statistics(tags=['wave'])
     114    print domain.boundary_statistics(tags=['left'])
    137115   
    138116print 'finished'
Note: See TracChangeset for help on using the changeset viewer.