Changeset 1491


Ignore:
Timestamp:
Jun 1, 2005, 4:04:38 PM (20 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

    r1444 r1491  
    348348c
    349349c ---- Try for a flat subinterval
    350 c
    351       do i=md,nx+md+2
    352          hmax = dmax1(h_l(i),h_r(i))
    353          dz  = (z2(i) - z2(i-1))
    354 
    355          if (h_l(i) .lt. 0.01d0*h_r(i) ) then
    356            h_r(i)  = sqrt(abs(2.0d0*dz*h(i)))
    357          endif
    358 
    359          if (h_r(i) .lt. 0.01d0*h_l(i) ) then         
    360            h_l(i)  = sqrt(abs(2.0d0*dz*h(i)))       
    361          endif         
    362       enddo
     350cc
     351c      do i=md,nx+md+2
     352c         hmax = dmax1(h_l(i),h_r(i))
     353c         dz  = (z2(i) - z2(i-1))
     354c
     355c         if (h_l(i) .lt. 0.01d0*h_r(i) ) then
     356c           h_r(i)  = sqrt(abs(2.0d0*dz*h(i)))
     357c         endif
     358c
     359c         if (h_r(i) .lt. 0.01d0*h_l(i) ) then         
     360c           h_l(i)  = sqrt(abs(2.0d0*dz*h(i)))       
     361c         endif         
     362c      enddo
    363363           
    364364      return
  • inundation/ga/storm_surge/Hobart/Landslide_Tadmor.for

    r1452 r1491  
    33c
    44c     Stiff source term solution using the second order
    5 c     central scheme of Tadmor and the modifications
     5c     central scheme of Landslide and the modifications
    66c     suggested by Liotta, Romano and Russo, SIAM
    77c     J. Numer. Anal. 38(4), 1337-1356, 2000.
    88c     This is the Randau scheme.
    99c
    10 c     Solving Sampson's parabolic canal problem
    1110c============================================================
    1211      implicit none
     
    1615
    1716      integer nx, nxx, io, i, isteps
    18       real*8 toll,cfl,theta,g,h0,dx,dtmax,Tout,Tfinal,tc,a,tau,B,t0,
    19      .       p,s,zeta_0,zeta_1,zeta,u0
    20 
    21       open(1,file='Stepflow5.out')
    22       open(2,file='Stepflow5.t')
    23       open(3,file='Stepflow5.h')
    24       open(4,file='Stepflow5.uh')
    25       open(5,file='Stepflow5.n')
    26       open(8,file='Stepflow5.c')
     17      real*8 toll,cfl,theta,g,dx,dtmax,Tout,Tfinal,tc,a,tau,B,t0,
     18     .       p,s,zeta_0,zeta_1,zeta,u0,version,hl,hr
     19
     20      open(11,file='data.w')
     21      open(12,file='data.t')
     22      open(13,file='data.h')
     23      open(14,file='data.uh')
     24      open(15,file='data.n')
     25      open(16,file='data.x')
     26
     27      open(1,file='MacDonald.bed')
    2728c
    2829c Parameters
    29 c     
    30       nx = 501
     30c   
     31      version = 1.0   
     32      nx = 101
    3133      nxx = nx+2*md
    3234      if (nx.gt.nxmax) write(*,*)'nx too large'
    3335      toll = 1.d-6
    34       cfl = 0.5d0
     36      cfl = 0.2d0
    3537      theta = 1.0d0
    3638      g = 9.81d0
    37       h0=10.0d0
     39      hl=10.0d0
     40      hr = 0.d0
    3841      dx = 10000.d0/dble(nx-1)
    3942      dtmax  = 0.5d0
    40       Tout   = 20.0d0
    41       Tfinal = 10000.0d0
    42       a = 3000.d0
    43       tau = 0.001d0
    44       B = 5.d0
     43      Tout   = 1.0d0
     44      Tfinal = 1500.0d0
     45
    4546      t0 = 0.d0
    4647
     
    4849c Setup Terrain
    4950c
    50       do io = 1,2
    51          do i = 1,nxx
    52             x(i,io) = dble(i-md-1)*dx+(io-1)*dx/2.0
    53          enddo
    54          call bed(x(1,io),z(1,io),dz(1,io),nxx)
     51c ---- Non-uniform terrain from MacDonald
     52      io = 1
     53      do i = 1,nxx
     54        read(1,*)x(i,io),z(i,io)
     55        z(i,io) = z(i,io)*5.d0
     56      end do
     57      do i = 2,nxx-1
     58        dz(i,io) = (z(i+1,io) - z(i-1,io))/2.d0/dx
     59      end do
     60      dz(1,io) = dz(2,io)
     61      dz(nxx,io) = dz(nxx-1,io)
     62
     63      io = 2
     64      do i = 1,nxx
     65         x(i,io) = x(i,io-1)
     66         z(i,io) = z(i,io-1)
     67         dz(i,io) = dz(i,io-1)
    5568      end do
    5669     
     
    5871c Initial Conditions
    5972c
    60       p = dsqrt(8.d0*g*h0/a/a)
    61       s = dsqrt(p*p-tau*tau)/2.d0
    62       u0 = B*exp(-tau*t0/2.d0)*sin(s*t0)
    63       zeta_0 = a*a*B*B*exp(-tau*t0)/(8.d0*g*g*h0)
    64      .         *(-s*tau*cos(s*t0)+(tau*tau/4.d0-s*s)*cos(2.d0*s*t0))
    65      .         -B*B*exp(-tau*t0)/4.d0/g
    66       zeta_1 = -exp(-tau*t0/2.d0)/g*(B*s*cos(s*t0)
    67      .         +tau*B/2.d0*sin(s*t0))
    68       do i = 1,nxx
    69         u(i,1)  = 20.d0 - h0*(1.d0 - (x(i,1) - 5000.d0)**2/a/a)
    70         zeta = zeta_0 + (x(i,1) - 5000.d0)*zeta_1 + 20.d0
    71         if(zeta.lt.u(i,1))then
    72           u(i,1) = 0.d0
     73c ---- Rectangular pulse initial condition
     74      do i = md+1, nx+md
     75        if (x(i,io).lt.100.d0.or.x(i,io).gt.200.d0) then
     76          u(i,1) = hr
    7377        else
    74           u(i,1) = zeta - u(i,1)
    75         end if
    76         u(i,2) = 0.d0
    77       end do
     78          u(i,1) = hl
     79        endif
     80        u(i,2) = 0.0d0
     81      end do 
    7882
    7983c
    8084c Setup for Time looping
    8185c         
    82       isteps = 0
     86
    8387      tc = 0.0d0
    8488      call dump_solution(u,z,nx,tc,isteps)
     
    8791c
    8892      call momentum_mass(nx,dx,cfl,g,theta,Tfinal,
    89      . u,dtmax,h0,toll,z,dz,Tout)
     93     .           u,dtmax,toll,z,dz,Tout,isteps)
     94
     95      write(15,*)isteps,nxx,version
     96      do i=1,nxx
     97         write(16,*) x(i,1)
     98      enddo
     99
     100
    90101c
    91102c Close down
     
    104115c The evolver
    105116c===============================================================
    106       subroutine momentum_mass(nx,dx,cfl,g,theta,tf,u,dtmax,h0,toll,
    107      .                         z,dz,Tout)
     117      subroutine momentum_mass(nx,dx,cfl,g,theta,tf,u,dtmax,toll,
     118     .                         z,dz,Tout,isteps)
    108119c
    109120c INPUT   nx # of cells in x-direction
     
    129140     
    130141      integer nx, nxx, io, i, isteps
    131       real*8 toll,cfl,theta,g,h0,dx,dt,Tout,Tfinal,tc
     142      real*8 toll,cfl,theta,g,dx,dt,Tout,Tfinal,tc
    132143     
    133144      integer istop,iout,nt,ii,oi,i2,m
     
    173184c see (2.1) and (4.3)
    174185c         
    175           call swflux(f,u,1,nxx,em_x,g,toll)
    176          
    177           call print_twoarray(f,nxx,'flux')
    178           call print_twoarray(u,nxx,'h and uh')         
     186          call swflux(f,u,1,nxx,em_x,g,toll)
    179187c
    180188c Compute numerical derivatives 'ux', 'fx'.
     
    187195          call derivative(f(1,2),fx(1,2),nxx,theta)   
    188196
    189           call print_twoarray(df,nxx,'df')
    190           call print_twoarray(ux,nxx,'ux')   
    191197c
    192198c Compute time step size according to the input CFL #
     
    194200          if(ii.eq.1) then
    195201            dt = dmin1(cfl*dx/em_x,dtmax,Tout)
    196 c            write(*,*)em_x, dt
    197202            if( ( tc + 2.d0*dt ) .ge. Tnext ) then
    198203              dt = 0.5d0*(Tnext - tc )
     
    204209            endif
    205210          end if
    206 c          write(*,*)'dt = ',dt
    207 c          write(*,*)'Tnext = ',Tnext
     211
    208212          dtcdx2 = dt/dx/2.d0
    209213          dtcdx3 = dt/dx/3.d0
     
    226230          call swflux(f,u2,3,nxx-2,em_x,g,toll)
    227231
    228           call print_twoarray(f,nxx,'flux half')
    229232c
    230233c Compute the values of 'u' at the next time level. see (2.16).
     
    246249          end do
    247250
    248           call print_twoarray(u,nxx,'u after h update')
    249251c
    250252c Momentum equation
     
    267269c
    268270c Friction term
    269             u(i,m) = u(i,m)*exp(-0.001d0*dt)
    270           end do
    271           call print_twoarray(u,nxx,'u after uh update')         
     271c            u(i,m) = u(i,m)*exp(-0.001d0*dt)
     272          end do
    272273c
    273274          tc = tc + dt
     
    282283c
    283284 1001 write(*,*)isteps
    284       write(5,*)isteps,nx
     285
    285286      return
    286287 
    287288      end
    288289
    289 c===========================================================
    290 c Setup Terrain with parabolic canal
    291 c===========================================================
    292       subroutine bed(x,z,dz,n)
    293 
    294       implicit none
    295       integer md, nxmax,nxd,mn
    296       parameter (md=3, nxmax=1601, nxd=nxmax+2*md, mn=2)
    297       integer n
    298       real*8 z(n),dz(n),x(n)
    299      
    300       integer i
    301       real*8 h0, a
    302 
    303       h0 = 10.d0
    304       a = 3000.d0
    305 
    306       do i=1,n
    307          z(i)  = 20.d0 - h0*(1.d0 - (x(i) - 5000.d0)**2/a/a)
    308          dz(i) = 2.d0*h0*(x(i) - 5000.d0)/a/a
    309       enddo
    310       return
    311       end
    312290c===========================================================
    313291c Shallow Water Flux
     
    393371      real*8 u(nxd,mn),z(nxd,2)
    394372
    395       write(2,*)tc
     373      write(12,*)tc
    396374      io = 1
     375      i = 2
    397376      isteps = isteps + 1
    398377      write(*,*)isteps, tc
    399       do ii = 1,2
    400         do i = md + 1, nx + md
    401            write(3,200)u(i,1)
    402            write(4,200)u(i,2)
    403            write(1,200)z(i,io) + u(i,1)
     378
     379      do i = 1, nx + 2*md
     380         write(13,200)u(i,1)
     381         write(14,200)u(i,2)
     382         write(11,200)z(i,io) + u(i,1)
    404383  200 format(e20.8)
    405         end do
    406       end do
    407 
    408       iflag = 0
    409       do i = md + 1,nx + md
    410         if(u(i,1).gt.1.d-04.and.iflag.eq.0)then
    411 c          write(8,200)u(i,1)
    412           write(8,200)i*20.d0
    413           iflag = 1
    414         end if
    415       end do
     384      end do
     385
    416386      return
    417387      end
    418 c===========================================================
    419 c Output Routine
    420 c===========================================================
    421       subroutine print_twoarray(u,nxx,msg)
    422       implicit real*8 (a-h)
    423       implicit real*8 (o-z)
    424       parameter (md=3, nxmax=1601, nxd=nxmax+2*md, mn=2)
    425       real*8 u(nxd,mn)
    426       character*(*) msg
    427       return
    428       write(*,*)msg
    429 
    430       do i = 1,nxx
    431          write(*,*)u(i,1),u(i,2)
    432       end do     
    433       return
    434       end
  • inundation/ga/storm_surge/Hobart/run_hobart_buildings.py

    r1471 r1491  
    4747
    4848# Colours for Hobart
    49 domain.visualiser.stage_color = (0.0,0.38,0.1)
     49domain.visualiser.stage_color    = (0.0,0.38,0.1)
    5050domain.visualiser.friction_color = (0.1,0.99,0.1)
    51 domain.visualiser.other_color = (0.99,0.4,0.1)
     51domain.visualiser.other_color    = (0.99,0.4,0.1)
    5252
    5353
Note: See TracChangeset for help on using the changeset viewer.