Ignore:
Timestamp:
Jan 19, 2008, 7:26:50 PM (16 years ago)
Author:
steve
Message:

Changed anuga_1d to shallow_water_1d

Location:
anuga_work/development/shallow_water_1d
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • anuga_work/development/shallow_water_1d/analytic_dam.py

    r4946 r4958  
    6161        h = zeros(n,Float)
    6262        uh = zeros(n,Float)
    63         x = C-3*L/4.0
     63        x = C-L/2.0
    6464        #x = zeros(n,Float)
    6565        #for i in range(n):
     
    7979        x2=z*t
    8080        x1=-c1*t
    81         x1_ = -1*L/2.0-x1
    82         x2_ = -1*L/2.0+2*x1
    83         #x3_ = -1*L/2.0-x3
     81   
    8482        #t=50
    8583        #x = (-L/2:L/2)
     
    8785            # Calculate Analytical Solution at time t > 0
    8886            u3 = 2.0/3.0*(sqrt(g*h1)+x[i]/t)
    89             h3 = 4.0/(9.0*g)*(sqrt(g*h1)-x[i]/(2.0*t))*(sqrt(g*h1)-x[i]/(2.0*t))
    90             u3_ = 2.0/3.0*((x[i]+L/2.0)/t-sqrt(g*h1))
    91             h3_ = 1.0/(9.0*g)*((x[i]+L/2.0)/t+2*sqrt(g*h1))*((x[i]+L/2.0)/t+2*sqrt(g*h1))
    92             #if t == 30:
    93             #    x[i] = 500
    94             #    print 'x2',x2
    95             #    print 'x3',x3
    96             #    print 'x1',x1
    97             if ( x[i] <= x2_ ):
    98                 #print 'here x2_=', x2_
    99                 u[i] = 0.0
    100                 h[i] = 0.0
    101                 uh [i] = u[i]*h[i]
    102             #elif ( x[i] <= x3_ ):
    103             #    print 'here x3_=', x3_
    104             #    u[i] = -1*u2
    105             #    h[i] = h2
    106             #    uh[i] = u[i]*h[i]
    107             elif ( x[i] <= x1_ ):
    108                 #print 'here x1_=', x1_
    109                 u[i] = u3_
    110                 h[i] = h3_
    111                 uh[i] = u[i]*h[i]
    112             #else:
    113             #    u[i] = 0.0
    114             #    h[i] = h0
    115             #    uh[i] = u[i]*h[i]
     87            h3 = 4.0/(9.0*g)*(sqrt(g*h1)-x[i]/(2.0*t))*(sqrt(g*h1)-x[i]/(2.0*t))
    11688
    117             #elif ( x[i] <= x1/2.0 ):
    118             #    u[i] = 0.0
    119             #    h[i] = h1
    120             #    uh[i] = u[i]*h[i]
    121             elif ( x[i] <= x1 ):
    122                 #print 'here x1=', x1
     89            if ( x[i] <= x1 ):
    12390                u[i] = 0.0
    12491                h[i] = h1
    12592                uh[i] = u[i]*h[i]
    12693            elif ( x[i] <= x3 ):
    127                 #print 'here x3=', x3
    12894                u[i] = u3
    12995                h[i] = h3
    13096                uh[i] = u[i]*h[i]
    13197            elif ( x[i] < x2 ):
    132                 #print 'here x2=', x2
    13398                u[i] = u2
    13499                h[i] = h2
    135100                uh[i] = u[i]*h[i]
    136101            else:
    137                 #print 'here the last section'
    138102                u[i] = 0.0
    139103                h[i] = h0
Note: See TracChangeset for help on using the changeset viewer.