Changeset 8206


Ignore:
Timestamp:
Sep 2, 2011, 7:57:03 PM (13 years ago)
Author:
steve
Message:

Added in the well balancing of the swb_domain by combining all the pressure terms

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/shallow_water_balanced/swb_domain.py

    r8203 r8206  
    6868        self.set_centroid_transmissive_bc(True)
    6969        self.set_CFL(1.0)
    70         self.set_beta(1.0)
    71         self.quantities['height'].set_beta(1.0)
     70        self.set_beta(1.5)
     71        self.quantities['height'].set_beta(1.5)
    7272
    7373        #--------------------------------------------
  • trunk/anuga_work/development/2010-projects/anuga_1d/base/quantity.py

    r7884 r8206  
    11621162if __name__ == "__main__":
    11631163    #from domain import Domain
    1164     from generic_domain import Generic_domain as Domain
     1164   
     1165    from anuga_1d.base.generic_domain import Generic_domain as Domain
    11651166
    11661167
     
    11721173        g.xlabel('x')
    11731174        g.ylabel('y')
     1175        g.show()
    11741176
    11751177
     
    11771179        import pylab as g
    11781180        g.plot(x.flat,y.flat)
     1181        g.show()
    11791182
    11801183
     
    11841187
    11851188       
    1186    
     1189    import pylab as g
     1190
    11871191    points1 = [0.0, 1.0, 2.0, 3.0]
    11881192    vertex_values = [[1.0,2.0],[4.0,5.0],[-1.0,2.0]]
     
    12661270        Qc = Q2.vertex_values
    12671271        linePlot(Xc,Qc)
     1272        g.show()
    12681273        raw_input('press return')
    12691274
  • trunk/anuga_work/development/2010-projects/anuga_1d/base/test_quantity_1d.py

    r7930 r8206  
    560560        limit_minmod_kurganov_ext(quantity)
    561561
     562        assert allclose(quantity.vertex_values, [[ -2.4,   2.4],
     563                                                 [  4.2,   7.8],
     564                                                 [ 10.8,  11.2],
     565                                                 [ 11.4,  14.6]])
    562566
    563567        #print quantity.vertex_values
     
    607611
    608612
    609         print quantity.vertex_values
     613        #print quantity.vertex_values
    610614
    611615        assert allclose(quantity.vertex_values, [[ -2.4,          2.4       ],
     
    620624        limit_vanalbada_ext(quantity)
    621625
    622         print quantity.vertex_values
     626        #print quantity.vertex_values
    623627
    624628
  • trunk/anuga_work/development/2010-projects/anuga_1d/compile_all.py

    r8191 r8206  
    1717
    1818
    19 os.chdir('..')
    20 os.chdir('sww-sudi')
    21 execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    22 
    23 os.chdir('..')
    24 os.chdir('avalanche-sudi')
    25 execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
     19#os.chdir('..')
     20#os.chdir('sww-sudi')
     21#execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
     22#
     23#os.chdir('..')
     24#os.chdir('avalanche-sudi')
     25#execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
    2626
    2727os.chdir('..')
  • trunk/anuga_work/development/2010-projects/anuga_1d/sww/run_dry_dam.py

    r8204 r8206  
    1212
    1313h1 = 10.0
    14 h0 = 0.1
     14h0 = 0.0
    1515
    1616def analytical_sol(C,t):
     
    9494domain.set_CFL(1.0)
    9595domain.set_limiter("minmod_kurganov")
     96domain.set_beta(1.5)
    9697#domain.h0=0.0001
    9798
     
    136137
    137138pylab.plot(X.flat,VelocityV.flat)
    138 plot2.set_ylim([-15,15])
     139plot2.set_ylim([-20,20])
    139140
    140141pylab.xlabel('Position')
  • trunk/anuga_work/development/2010-projects/anuga_1d/sww/run_tsunami_model.py

    r8205 r8206  
    99
    1010
    11 print "Jakir Test"
     11print "Tsunami Test"
    1212
    13 depth = -200
     13depth1 = -100
     14depth2 = -5
     15cliff = 0
     16shelf_width = 10000
     17
    1418def sea_floor(x):
    1519    y = np.zeros_like(x)
    1620    for i in range(len(x)):
    17         if x[i]<500:
    18             y[i]= depth
    19         else :
    20             y[i]= depth + 0.5*(x[i] - 500)
     21        if x[i]<cliff:
     22            y[i]= depth1
     23        elif x[i]<cliff+shelf_width :
     24            y[i]=  depth1 + (depth2-depth1)*(x[i] - cliff)/shelf_width
     25        else:
     26            y[i] = depth2
    2127    return y
    22  
     28
     29tsunami_centre = -200000
     30tsunami_radius = 100000
     31tsunami_height = 2.0
    2332def stage(x):
    2433    y = np.zeros_like(x)
    2534    for i in range(len(x)):
    26         if x[i]>100 and x[i]<200:
    27             y[i]= 2.0
     35        if x[i]>tsunami_centre-tsunami_radius and x[i]<tsunami_centre+tsunami_radius:
     36            y[i]= tsunami_height
    2837    return y
    2938
     
    3241
    3342# Set final time and yield time for simulation
    34 finaltime = 10.0
     43finaltime = 60*10
    3544yieldstep = finaltime
    3645
    3746# Length of channel (m)
    38 L = 1000.0   
     47L = 100000.0
    3948# Define the number of cells
    40 #N = 20
    41 #print "Evaluating domain with %d cells" %N
    42 #domain = Domain(*uniform_mesh(N, x_0 = -2.0*L, x_1 = 2.0*L))
     49N = 1000
    4350
    4451
    45 
    46 
    47 
    48 # Define the number of cells
    49 number_of_cells = [20]
    50 
    51 # Define cells for finite volume and their size
    52 N = int(number_of_cells[0])
    53 
    54 
    55 points0, boundary0 = uniform_mesh(N, x_0 = 0.0, x_1 = L)
    56 
    57 
    58 print "Evaluating domain with %d cells" %N
    59 cell_len = L/N # Origin = 0.0
    60 points = np.zeros(N+1,np.float)
    61 
    62 # Define the centroid points
    63 for j in range(N+1):
    64     points[j] = j*cell_len
    65 
    66 
    67 print points0-points
     52#points = points - L
    6853
    6954# Create domain with centroid points as defined above
    70 domain = Domain(points0)
     55domain = Domain(*uniform_mesh(N, x_0 = -10.0*L, x_1 = 3*L))
    7156
    72 
    73 
     57#print uniform_mesh(N, x_0 = -L, x_1 = 2*L)
     58#print domain.boundary
    7459
    7560
     
    8267#domain.set_boundary({'exterior': Dirichlet_boundary([14,20,0,1.4,20/14,9])})
    8368Br = Reflective_boundary(domain)
    84 #domain.set_boundary({'left': Br, 'right' : Br })
    85 domain.set_boundary({'exterior': Br})
     69domain.set_boundary({'left': Br, 'right' : Br })
     70#domain.set_boundary({'exterior': Br})
    8671
    8772#domain.set_boundary({'exterior': Transmissive_boundary(domain)})
     
    8974domain.set_timestepping_method('rk2')
    9075domain.set_CFL(1.0)
    91 domain.set_limiter("vanleer")
     76domain.set_limiter("minmod_kurganov")
    9277#domain.h0=0.0001
    9378
     
    9580t0 = time.time()
    9681
    97 finaltime= 0.0
     82finaltime= 60*60*8
    9883
    9984#===================================================================
  • trunk/anuga_work/development/2010-projects/anuga_1d/sww/sww_domain.py

    r8204 r8206  
    9292        self.__doc__ = 'sww_domain'
    9393
     94        self.set_spatial_order(2)
     95        self.set_timestepping_method('rk2')
     96        self.set_CFL(1.0)
     97        self.set_limiter("minmod_kurganov")
     98        self.set_beta(1.5)
     99
    94100
    95101    def set_quantities_to_be_stored(self, q):
     
    239245
    240246
    241     u_C[:]  = uh_C/(h_C + h0/h_C)
     247    u_C[:]  = uh_C/(h_C + h0/(h_C + h0))
    242248
    243249    #print 'domain.order', domain.order
     
    299305#
    300306#
    301     #stage_V[:,:] = bed_V + h_V
     307    stage_V[:,:] = bed_V + h_V
    302308    #bed_V[:,:] = stage_V - h_V
    303309    xmom_V[:,:] = u_V * h_V
Note: See TracChangeset for help on using the changeset viewer.