Ignore:
Timestamp:
May 12, 2013, 8:11:11 PM (12 years ago)
Author:
davies
Message:

Updates to balanced_dev

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py

    r8772 r8865  
    2424domain=Domain(points,vertices,boundary)    # Create Domain
    2525domain.set_name('runup_sinusoid_v2')                         # Output to file runup.sww
    26 
     26#domain.set_timestepping_method('euler')
    2727#------------------
    2828# Define topography
    2929#------------------
    3030scale_me=1.0
     31boundary_ws=-0.1
     32init_ws=-0.2
     33bumpiness=10. # Higher = shorter wavelength oscillations in topography
    3134#domain.minimum_allowed_height=domain.minimum_allowed_height*scale_me # Seems needed to make the algorithms behave
    3235
    3336def topography(x,y):
    34         return (-x/2.0 +0.05*numpy.sin((x+y)*50.0))*scale_me
     37        return (-x/2.0 +0.05*numpy.sin((x+y)*bumpiness))*scale_me
    3538
    3639def stagefun(x,y):
    37     stge=-0.2*scale_me #+0.1*(x>0.9)
     40    stge=init_ws*scale_me# +0.1*(x>0.9)*scale_me
    3841    #topo=topography(x,y)
    3942    return stge#*(stge>topo) + (topo)*(stge<=topo)
     
    4144domain.set_quantity('elevation',topography)     # Use function for elevation
    4245domain.get_quantity('elevation').smooth_vertex_values()
    43 domain.set_quantity('friction',0.03)             # Constant friction
     46domain.set_quantity('friction',0.00)             # Constant friction
    4447
    4548#def frict_change(x,y):
     
    6467Bd=anuga.Dirichlet_boundary([-0.1*scale_me,0.,0.])       # Constant boundary values -- not used in this example
    6568def waveform(t):
    66     return -0.1 #(0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1
     69    return boundary_ws*scale_me
     70    #return -0.2*scale_me #-0.1 #(0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1
    6771Bt2=anuga.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain,waveform)
    6872#Bw=anuga.Time_boundary(domain=domain,
     
    7882#------------------------------
    7983
    80 for t in domain.evolve(yieldstep=0.200,finaltime=40.00):
     84for t in domain.evolve(yieldstep=0.2,finaltime=120.00):
    8185    print domain.timestepping_statistics()
    82     print domain.boundary_flux_integral
     86    #print domain.boundary_flux_integral
    8387    xx = domain.quantities['xmomentum'].centroid_values
    8488    yy = domain.quantities['ymomentum'].centroid_values
     
    8892    vv = ( (xx/dd)**2 + (yy/dd)**2)**0.5
    8993    vv = vv*(dd>1.0e-03)
    90     print 'Peak velocity is: ', vv.max(), vv.argmax()
     94    print 'Peak velocity is: ', vv.max(), vv.argmax(), dd[vv.argmax()]
    9195    print 'Volume is', sum(dd_raw*domain.areas)   
    92     print 'Volume less flux int', sum(dd_raw*domain.areas) - domain.boundary_flux_integral
     96    #print 'Volume less flux int', sum(dd_raw*domain.areas) - domain.boundary_flux_integral
    9397
    9498
Note: See TracChangeset for help on using the changeset viewer.