Ignore:
Timestamp:
Oct 11, 2006, 3:58:53 PM (18 years ago)
Author:
ole
Message:

Updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/documentation/user_manual/examples/channel_3.py

    r3747 r3753  
    11"""Simple water flow example using ANUGA
    22
    3 Water flowing down a channel
     3Water flowing down a channel with more complex topography
    44"""
    55
     
    2020width = 5.
    2121dx = dy = 1           # Resolution: Length of subdivisions on both axes
     22#dx = dy = .1           # Resolution: Length of subdivisions on both axes
    2223
    23 points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy), len1=length, len2=width)
     24points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),
     25                                               len1=length, len2=width)
    2426domain = Domain(points, vertices, boundary)   
    2527domain.set_name('channel_3')                  # Output name
     
    3032#------------------------------------------------------------------------------
    3133def topography(x,y):
    32     z = -x/10                             # linear bed slope
     34    """Complex topography defined by a function of vectors x and y
     35    """
     36   
     37    z = -x/10                               
    3338
    3439    N = len(x)
     
    5055
    5156
    52 domain.set_quantity('elevation', topography)            # Use function for elevation
    53 domain.set_quantity('friction', 0.01)                   # Constant friction
    54 domain.set_quantity('stage', expression='elevation')    # Dry
     57domain.set_quantity('elevation', topography)  # Use function for elevation
     58domain.set_quantity('friction', 0.01)         # Constant friction
     59domain.set_quantity('stage',
     60                    expression='elevation')   # Dry initial condition
    5561
    5662
     
    5864# Setup boundary conditions
    5965#------------------------------------------------------------------------------
    60 Bi = Dirichlet_boundary([0.4, 0, 0])                            # Inflow
    61 Br = Reflective_boundary(domain)                                # Solid reflective wall
    62 Bo = Dirichlet_boundary([-5, 0, 0])                             # Outflow
     66Bi = Dirichlet_boundary([0.4, 0, 0])          # Inflow
     67Br = Reflective_boundary(domain)              # Solid reflective wall
     68Bo = Dirichlet_boundary([-5, 0, 0])           # Outflow
    6369
    6470domain.set_boundary({'left': Bi, 'right': Bo, 'top': Br, 'bottom': Br})
Note: See TracChangeset for help on using the changeset viewer.