Changeset 8547 for trunk/anuga_work/development/gareth/tests
- Timestamp:
- Aug 31, 2012, 8:38:25 PM (13 years ago)
- Location:
- trunk/anuga_work/development/gareth/tests
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/gareth/tests/channel_floodplain/channel_floodplain1.py
r8446 r8547 14 14 #from anuga import * 15 15 #from balanced_basic import * 16 from balanced_dev import * 16 #from balanced_dev import * 17 from anuga_tsunami import * 17 18 #from balanced_basic.swb2_domain import * 18 19 #from balanced_basic.swb2_domain import Domain -
trunk/anuga_work/development/gareth/tests/channel_floodplain/plotme.py
r8446 r8547 4 4 5 5 # Time-index to plot outputs from 6 index= 606 index=1200 7 7 8 8 #p2 = util.get_output('channel_floodplain1_bal_dev.sww', minimum_allowed_height=0.01) -
trunk/anuga_work/development/gareth/tests/dam_break/dam_break.py
r8353 r8547 15 15 from time import localtime, strftime, gmtime 16 16 from balanced_dev import * 17 #from anuga_tsunami import * 17 18 18 19 -
trunk/anuga_work/development/gareth/tests/dam_break/plotme.py
r8466 r8547 9 9 p2_st=util.get_centroids(p_st) 10 10 11 p_dev = util.get_output('dam_break_20120 627_231618/dam_break.sww', 0.001)11 p_dev = util.get_output('dam_break_20120831_172309/dam_break.sww', 0.001) 12 12 p2_dev=util.get_centroids(p_dev, velocity_extrapolation=True) 13 13 -
trunk/anuga_work/development/gareth/tests/merimbula_steve/run_sw_merimbula.py
r8396 r8547 29 29 #from balanced_basic import * 30 30 from balanced_dev import * 31 #from anuga_tsunami import * 31 32 32 33 from anuga import Reflective_boundary -
trunk/anuga_work/development/gareth/tests/okushiri/run_okushiri.py
r8354 r8547 24 24 import anuga 25 25 import project 26 from balanced_dev import * 26 #from balanced_dev import * 27 from anuga_tsunami import * 27 28 28 29 def main(elevation_in_mesh=False): -
trunk/anuga_work/development/gareth/tests/parabolic/parabolic.py
r8353 r8547 9 9 10 10 from balanced_dev import * 11 #from anuga_tsunami import * 11 12 #from balanced_basic import * 12 13 #from anuga.shallow_water_balanced2.swb2_domain import Domain as Domain … … 21 22 domain.set_datadir('.') # Use current folder 22 23 domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1}) 23 domain.set_minimum_allowed_height(0.0 1)24 domain.set_minimum_allowed_height(0.001) 24 25 # Time stepping 25 26 #domain.set_timestepping_method('euler') # Default -
trunk/anuga_work/development/gareth/tests/runup/runup.py
r8446 r8547 19 19 #from balanced_basic import * 20 20 from balanced_dev import * 21 #from anuga_tsunami import * 21 22 #--------- 22 23 #Setup computational domain … … 45 46 domain.get_quantity('elevation').smooth_vertex_values() # Steve's fix -- without this, substantial artificial velcities are generated everywhere in the domain. With this fix, there are artificial velocities near the coast, but not elsewhere. 46 47 47 domain.set_quantity('friction',0. 00) # Constant friction48 domain.set_quantity('friction',0.10) # Constant friction 48 49 49 50 domain.set_quantity('stage', stagefun) # Constant negative initial stage … … 61 62 # Associate boundary tags with boundary objects 62 63 #---------------------------------------------- 63 domain.set_boundary({'left': Br, 'right': B w, 'top': Br, 'bottom':Br})64 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom':Br}) 64 65 65 66 #------------------------------ -
trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py
r8466 r8547 15 15 #from balanced_basic import * 16 16 from balanced_dev import * 17 #from anuga_tsunami import * 17 18 #--------- 18 19 #Setup computational domain … … 25 26 domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1}) 26 27 #domain.set_store_vertices_uniquely(True) 27 domain.minimum_allowed_height=0.00128 29 28 #------------------ 30 29 # Define topography … … 38 37 39 38 def stagefun(x,y): 40 stge=-0.2*scale_me # -0.1*(x>0.5) -0.2*(x<=0.5)39 stge=-0.2*scale_me # +0.01*(x>0.9) 41 40 #topo=topography(x,y) 42 41 return stge#*(stge>topo) + (topo)*(stge<=topo) … … 44 43 domain.set_quantity('elevation',topography) # Use function for elevation 45 44 domain.get_quantity('elevation').smooth_vertex_values() 46 47 domain.set_quantity('friction',0.00) # Constant friction 45 domain.set_quantity('friction',0.03) # Constant friction 48 46 49 47 #def frict_change(x,y): … … 74 72 # Associate boundary tags with boundary objects 75 73 #---------------------------------------------- 76 domain.set_boundary({'left': Br, 'right': B d, 'top': Br, 'bottom':Br})74 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom':Br}) 77 75 78 76 #------------------------------ … … 80 78 #------------------------------ 81 79 82 for t in domain.evolve(yieldstep=0. 1,finaltime=20.0):80 for t in domain.evolve(yieldstep=0.2,finaltime=20.0): 83 81 print domain.timestepping_statistics() 84 82 xx = domain.quantities['xmomentum'].centroid_values 85 83 yy = domain.quantities['ymomentum'].centroid_values 86 84 dd = domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values 87 dd = (dd)*(dd>1.0e-06)+1.0e-03 88 vv = ( (xx/dd)**2 + (yy/dd)**2 )**0.5 85 dd_raw=1.0*dd 86 dd = (dd)*(dd>1.0e-03)+1.0e-03 87 vv = ( (xx/dd)**2 + (yy/dd)**2)**0.5 89 88 vv = vv*(dd>1.0e-03) 90 89 print 'Peak velocity is: ', vv.max(), vv.argmax() 90 print 'Volume is', sum(dd_raw*domain.areas) 91 92 93 vel_final_inds=(vv>1.0e-01).nonzero() 94 print 'vel_final_inds', vel_final_inds 91 95 92 96 print 'Finished' -
trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_2plot.py
r8466 r8547 17 17 18 18 #------------------ 19 # Select line 19 # Select line along which we plot 20 20 #------------------ 21 21 #v=(y==2.5) 22 v=(p2.y==p2.y[3]) 22 tmp = abs(p2.y-50.) 23 n = tmp.argmin() 24 v=(p2.y==p2.y[n]) 23 25 24 26 #------------------------------- -
trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_sparse.py
r8359 r8547 3 3 """ 4 4 import sys 5 5 import numpy 6 6 #--------------- 7 7 # I am having trouble with my environmental variables -- this is a … … 24 24 from balanced_dev import * 25 25 from balanced_dev import Domain as Domain 26 #from anuga_tsunami import * 27 #from anuga_tsunami import Domain as Domain 26 28 #------------------------------------------------------------------------------ 27 29 # Setup computational domain … … 37 39 #------------------------------------------------------------------------------ 38 40 def topography(x, y): 39 return -x/10. #+abs(y-2.5)/10. # linear bed slope41 return -x/10. + numpy.sin(x/10.) +abs(y-50.)/100. # linear bed slope 40 42 41 43 def stagetopo(x,y): … … 44 46 return stg#*(stg>topo) + topo*(stg<=topo) 45 47 46 line1=[ [ 0.,0.], [0., 100.] ]48 line1=[ [10.,0.], [10., 100.] ] 47 49 Qin=20. 48 50 Inlet_operator(domain, line1,Qin) … … 60 62 61 63 def constant_water(t): 62 return - 9.93690364 return -8.936903 63 65 64 #Bo= anuga.shallow_water.boundaries.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain, constant_water) # Outflow for steady uniform flow with a depth integrated velocity of 0.1 65 Bo = anuga.Transmissive_boundary(domain) 66 Bo= anuga.shallow_water.boundaries.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain, constant_water) # Outflow for steady uniform flow with a depth integrated velocity of 0.1 67 #Bo = anuga.Transmissive_boundary(domain) 68 #Bd = anuga.Dirichlet_boundary([-20., 0., 0.]) 66 69 domain.set_boundary({'left': Br, 'right': Bo, 'top': Br, 'bottom': Br}) 70 67 71 #------------------------------------------------------------------------------ 68 72 # Evolve system through time -
trunk/anuga_work/development/gareth/tests/urban_flow/ideal_urban.py
r8450 r8547 12 12 #from anuga.structures.inlet_operator import Inlet_operator 13 13 14 from balanced_dev import * 15 from balanced_dev import create_domain_from_regions as create_domain_from_regions 14 #from balanced_dev import * 15 #from balanced_dev import create_domain_from_regions as create_domain_from_regions 16 from anuga_tsunami import * 17 from anuga_tsunami import create_domain_from_regions as create_domain_from_regions 16 18 #------------------------------------------------------------------------------ 17 19 # Useful parameters for controlling this case -
trunk/anuga_work/development/gareth/tests/wave/run_wave.py
r8446 r8547 14 14 #from anuga import Domain 15 15 16 from balanced_dev import * 16 #from balanced_dev import * 17 from anuga_tsunami import * 17 18 #from balanced_dev import Domain as Domain 18 19 … … 104 105 105 106 Bw2 = anuga.shallow_water.boundaries.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain, waveform) 106 Bf_in = swb2_boundary_conditions.Characteristic_boundary(domain, waveform)107 #Bf_in = swb2_boundary_conditions.Characteristic_boundary(domain, waveform) 107 108 #Bw3 = swb2_boundary_conditions.Transmissive_momentum_nudge_stage_boundary(domain, waveform) 108 Bf=swb2_boundary_conditions.Characteristic_boundary(domain,waveform2)109 #Bf=swb2_boundary_conditions.Characteristic_boundary(domain,waveform2) 109 110 110 111 111 112 112 113 # Associate boundary tags with boundary objects 113 domain.set_boundary({'left': Bw2, 'right': B f, 'top': Br, 'bottom': Br})114 domain.set_boundary({'left': Bw2, 'right': Bt, 'top': Br, 'bottom': Br}) 114 115 115 116
Note: See TracChangeset
for help on using the changeset viewer.