Changeset 1587


Ignore:
Timestamp:
Jul 7, 2005, 3:47:06 PM (19 years ago)
Author:
steve
Message:
 
Location:
inundation/ga/storm_surge
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/Hobart/Landslide_1D.for

    r1491 r1587  
    3939c     
    4040      nx = 101
    41       dtmax  = 1.0d0
     41      dtmax  = 0.5d0
    4242      Tout   = 1.0d0
    43       tf = 200.0d0
     43      tf = 1500.0d0
    4444      length = 1000.0d0
    4545
     
    4949     
    5050      limith = 1
    51       dx = 10.d0
     51     
     52      dx = 10000.d0/dble(nx-1)
    5253      K = 0.0d0           
    5354
    5455      if (nx.gt.nxmax) write(*,*)'nx too large'
    5556      toll = 1.0d-10
    56       cfl = 0.01d0
     57      cfl = 0.2d0
    5758      theta = 1.2d0
    5859      version = 10
     
    310311         w1 = h1 + z(i)
    311312         w2 = h2 + z(i+1)
    312          
     313 
     314         d1h = h1 - h0
     315         d2h = h2 - h1
    313316         d1w = w1 - w0
    314317         d2w = w2 - w1
     
    316319               
    317320c ------- W = H+Z           
    318          h_x = xmin( d1w, d2w) - dz
     321c         h_x = xmin( d1w, d2w) - dz
     322         h_x = xmic(theta, d1h, d2h)
    319323         
    320324c ------- Return the left and right values of h in an interval
     
    323327         
    324328c ------- Test for h_l or h_r negative
    325          hmin = dmin1(h0,h1,h2)
    326          if ( h_l(i) .le. hmin ) then
    327             h_l(i) = hmin
    328             h_r(i) = h(i) + (h(i) - h_l(i))
    329          elseif ( h_r(i) .le. hmin ) then
    330             h_r(i) = hmin
    331             h_l(i) = h(i) + (h(i) - h_r(i))
    332          endif
     329c$$$         hmin = dmin1(h0,h1,h2)
     330c$$$         if ( h_l(i) .le. hmin ) then
     331c$$$            h_l(i) = hmin
     332c$$$            h_r(i) = h(i) + (h(i) - h_l(i))
     333c$$$         elseif ( h_r(i) .le. hmin ) then
     334c$$$            h_r(i) = hmin
     335c$$$            h_l(i) = h(i) + (h(i) - h_r(i))
     336c$$$         endif
    333337      enddo
    334338c
    335339c ---- Enforce a minimum height
    336340c
    337       do i=md,nx+md+2
    338          hmax = dmax1(h_l(i),h_r(i))
    339          if (hmax .lt. 1.0d-3 ) then
    340            h_r(i)  = 0.0d0
    341            uh_r(i) = 0.0d0
    342            h_l(i)  = 0.0d0
    343            uh_l(i) = 0.0d0
    344            h(i)    = 0.0d0
    345            uh(i)   = 0.0d0
    346          endif
    347       enddo
     341c$$$      do i=md,nx+md+2
     342c$$$         hmax = dmax1(h_l(i),h_r(i))
     343c$$$         if (hmax .lt. 1.0d-3 ) then
     344c$$$c           h_r(i)  = 0.0d0
     345c$$$           uh_r(i) = 0.0d0
     346c$$$c           h_l(i)  = 0.0d0
     347c$$$           uh_l(i) = 0.0d0
     348c$$$c           h(i)    = 0.0d0
     349c$$$           uh(i)   = 0.0d0
     350c$$$         endif
     351c$$$      enddo
    348352c
    349353c ---- Try for a flat subinterval
     
    410414          d2 = u(i+1) - u(i)
    411415          u_x = xmic( theta, d1, d2 )
     416c          u_x = xmin( d1, d2 )
    412417          u_l(i) = u(i) - 0.5d0*u_x
    413418          u_r(i) = u(i) + 0.5d0*u_x         
  • inundation/ga/storm_surge/Hobart/Landslide_Tadmor.for

    r1491 r1587  
    3737      theta = 1.0d0
    3838      g = 9.81d0
    39       hl=10.0d0
     39      hl= 5.0d0
    4040      hr = 0.d0
    4141      dx = 10000.d0/dble(nx-1)
  • inundation/ga/storm_surge/pyvolution/general_mesh.py

    r1565 r1587  
    8585        self.number_of_elements = N = self.triangles.shape[0]
    8686
    87         self.xy_extent = [ min(self.coordinates[:,0]), min(self.coordinates[:,1]) ,
    88                            max(self.coordinates[:,0]), max(self.coordinates[:,1]) ]
     87        xy_extent = [ min(self.coordinates[:,0]), min(self.coordinates[:,1]) ,
     88                      max(self.coordinates[:,0]), max(self.coordinates[:,1]) ]
     89
     90        self.xy_extent = array(xy_extent, Float)
    8991
    9092
  • inundation/ga/storm_surge/pyvolution/mesh_factory.py

    r1558 r1587  
    517517
    518518    return points, elements, boundary
     519
     520
     521def contracting_channel_cross(m, n, W_upstream = 1., W_downstream = 0.75,
     522                              L_1 = 5.0, L_2 = 2.0, L_3 = 10, origin = (0.0, 0.0)):
     523    """Setup a contracting channel grid of triangles
     524    with m segments in the x-direction and n segments in the y-direction
     525
     526    """
     527
     528    from Numeric import array
     529    import math
     530
     531    from config import epsilon
     532
     533
     534    lenx = L_1 + L_2 + L_3
     535    leny = W_upstream
     536    deltax = lenx/float(m)
     537    deltay = leny/float(n)
     538
     539    x1 = 0
     540    y1 = 0
     541    x2 = L_1
     542    y2 = 0
     543    x3 = L_1 + L_2
     544    y3 = (W_upstream - W_downstream)/2
     545    x4 = L_1 + L_2 + L_3
     546    y4 = y3
     547    x5 = x4
     548    y5 = y4 + W_downstream
     549    x6 = L_1 + L_2
     550    y6 = y5
     551    x7 = L_1
     552    y7 = W_upstream
     553    x8 = 0
     554    y8 = W_upstream
     555    a1 = 0
     556    a2 = (W_upstream - W_downstream)/(2*L_2)
     557    a3 = 1
     558    a4 = (W_downstream - W_upstream)/(L_2*W_upstream)
     559
     560    # Dictionary of vertex objects
     561    vertices = {}
     562    points = []
     563
     564    for i in range(m+1):
     565        x = deltax*i
     566        for j in range(n+1):
     567            y = deltay*j
     568            if x > L_1 and x <= (L_1 + L_2):
     569                y = a1 + a2*(x - L_1) + a3*y + a4*(x - L_1)*y
     570            elif x > L_1 + L_2:
     571                y = (W_upstream - W_downstream)/2 + deltay*j*W_downstream/W_upstream
     572
     573            vertices[i,j] = len(points)
     574            points.append([x + origin[0], y + origin[1]])
     575
     576    # Construct 4 triangles per element
     577    elements = []
     578    boundary = {}
     579    for i in range(m):
     580        for j in range(n):
     581            v1 = vertices[i,j+1]
     582            v2 = vertices[i,j]
     583            v3 = vertices[i+1,j+1]
     584            v4 = vertices[i+1,j]
     585            x = (points[v1][0]+points[v2][0]+points[v3][0]+points[v4][0])*0.25
     586            y = (points[v1][1]+points[v2][1]+points[v3][1]+points[v4][1])*0.25
     587            v5 = len(points)
     588            points.append([x + origin[0], y + origin[1]])
     589
     590            #Create left triangle
     591            if i == 0:
     592                boundary[(len(elements), 1)] = 'left'
     593            elements.append([v2,v5,v1])
     594
     595            #Create bottom triangle
     596            if j == 0:
     597                boundary[(len(elements), 1)] = 'bottom'
     598            elements.append([v4,v5,v2])
     599
     600            #Create right triangle
     601            if i == m-1:
     602                boundary[(len(elements), 1)] = 'right'
     603            elements.append([v3,v5,v4])
     604
     605            #Create top triangle
     606            if j == n-1:
     607                boundary[(len(elements), 1)] = 'top'
     608            elements.append([v1,v5,v3])
     609
     610
     611    return points, elements, boundary
Note: See TracChangeset for help on using the changeset viewer.