Changeset 8204


Ignore:
Timestamp:
Sep 1, 2011, 7:28:58 PM (14 years ago)
Author:
steve
Message:

Getting the 1d tsunami model working

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/test_gauge.py

    r8164 r8204  
    464464        """
    465465        This is testing the sww2csv_gauges function, by creating a multiple
    466         sww file and then exporting the gauges and checking the results.
     466        sww files and then exporting the gauges and checking the results.
    467467        """
    468468        timestep=2.0
  • trunk/anuga_validation/validation_tests/circular_dam_break.py

    r8199 r8204  
    103103#------------------------------------------------------------------------------
    104104
    105 for t in domain.evolve(yieldstep = 0.1, finaltime = 6.0):
     105for t in domain.evolve(yieldstep = 0.1, finaltime = 20.0):
    106106    #print domain.timestepping_statistics(track_speeds=True)
    107107    print domain.timestepping_statistics()
  • trunk/anuga_work/development/2010-projects/anuga_1d/channel/channel_flow_2_padarn.py

    r7884 r8204  
    11import os
    22from math import sqrt, pow, pi
    3 from channel_domain import *
    4 from Numeric import allclose, array, zeros, ones, Float, take, sqrt
    5 from config import g, epsilon
     3
     4import numpy as np
     5
     6from anuga_1d.channel.channel_domain import *
     7from anuga_1d.config import g, epsilon
     8from anuga_1d.base.generic_mesh import uniform_mesh
    69
    710
     
    1922
    2023def bed(x):
    21     y = zeros(len(x),Float)
     24    y = np.zeros(len(x),np.float)
    2225    for i in range(len(x)):
    2326        if x[i]<525 and x[i]>475:
     
    4649print "Evaluating domain with %d cells" %N
    4750cell_len = L/N # Origin = 0.0
    48 points = zeros(N+1,Float)
     51points = np.zeros(N+1,np.float)
    4952
    5053# Define the centroid points
     
    6265
    6366# Set boundry type, order, timestepping method and limiter
    64 domain.set_boundary({'exterior': Dirichlet_boundary([14,20,0,1.4,20/14,9])})
     67#domain.set_boundary({'exterior': Dirichlet_boundary([14,20,0,1.4,20/14,9])})
     68domain.set_boundary({'exterior': Reflective_boundary(domain)})
    6569domain.order = 2
    6670domain.set_timestepping_method('rk2')
     
    7276t0 = time.time()
    7377
     78finaltime= 0.0
     79
     80#===================================================================
     81# Time loop
     82#===================================================================
    7483for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
    7584    domain.write_time()
     
    8493VelocityQ = domain.quantities['velocity'].vertex_values
    8594x = X.flat
    86 z = domain.quantities['elevation'].vertex_values.flat
    87 stage=HeightQ.flat+z
     95z = domain.quantities['elevation'].vertex_values
     96stage=HeightQ+z
     97stage = stage.flat
     98z = z.flat
    8899
    89100from pylab import plot,title,xlabel,ylabel,legend,savefig,show,hold,subplot
  • trunk/anuga_work/development/2010-projects/anuga_1d/sww/run_dry_dam.py

    r8073 r8204  
    8181k = 0
    8282
    83 N = 10000
     83N = 2000
    8484print "Evaluating domain with %d cells" %N
    8585domain = Domain(*uniform_mesh(N,x_1=L))
  • trunk/anuga_work/development/2010-projects/anuga_1d/sww/sww_domain.py

    r8194 r8204  
    235235       
    236236    #Calculate height (and fix negatives)better be non-negative!
     237    w_C[:] = numpy.maximum(w_C, z_C)
    237238    h_C[:] = w_C - z_C
     239
     240
    238241    u_C[:]  = uh_C/(h_C + h0/h_C)
    239242
     
    282285    #print 'any' ,numpy.any( h_V[:,1] < 0.0)
    283286
    284     h00 = 1e-12
     287    #h00 = 1e-12
    285288    #print h00
    286289
    287     h_V[:,:] = numpy.where (h_V <= h00, 0.0, h_V)
    288     u_V[:,:] = numpy.where (h_V <= h00, 0.0, u_V)
     290    #h_V[:,:] = numpy.where (h_V <= h00, 0.0, h_V)
     291    #u_V[:,:] = numpy.where (h_V <= h00, 0.0, u_V)
    289292
    290293#    # protect from edge values going negative
Note: See TracChangeset for help on using the changeset viewer.