Changeset 9056
- Timestamp:
- Mar 3, 2014, 9:58:02 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/config.py
r8974 r9056 126 126 #flow_algorithm = '2_0' # 2nd order TVD scheme and more aggressive piecewise linear spatial reconstruction 127 127 #flow_algorithm = '2.5' # 3rd order TVD scheme and more aggressive piecewise linear spatial reconstruction 128 128 #flow_algorithm = 'tsunami' # 2nd order space and time, well balanced inc at wet-dry fronts, porosity-type alg 129 #flow_algorithm = 'DE1' # 2nd order space and time, discontinuous elevation, well balanced + better shallow flows than 'tsunami' 129 130 130 131 -
trunk/anuga_core/source/anuga_validation_tests/analytical_exact/rundown_mild_slope_coarse/numerical_rundown_channel_coarse.py
r9038 r9056 41 41 42 42 def init_stage(x,y): 43 stg= -x/10.+0. 01 # Constant depth: 1cm.43 stg= -x/10.+0.10 # Constant depth: 10 cm. 44 44 return stg 45 45 #line0=[ [0.,0.], [0., 100.] ] … … 79 79 # Evolve system through time 80 80 #------------------------------------------------------------------------------ 81 for t in domain.evolve(yieldstep=10.0, finaltime= 800.0):81 for t in domain.evolve(yieldstep=10.0, finaltime=2000.0): 82 82 print domain.timestepping_statistics() 83 83 print (domain.areas*(domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values)).sum() -
trunk/anuga_core/source/anuga_validation_tests/analytical_exact/rundown_mild_slope_coarse/plot_results.py
r9038 r9056 31 31 32 32 ll=p2.vel.shape[0]-1 33 33 34 #------------------------------- 34 35 # Define variables of case study … … 55 56 line.set_label('numerical') 56 57 pyplot.plot( (0,100),(dana,dana), 'r',label='analytical' ) 58 pyplot.yscale('log') 57 59 pyplot.legend() 58 60 #pyplot.plot(x[v],elev[v],'green') … … 84 86 pyplot.title('Final Xvelocity around the line x=50.') 85 87 pyplot.legend(loc='best') 88 pyplot.ylim((0,1.5*uana)) 86 89 pyplot.savefig('x_velocity.png') 87 90 -
trunk/anuga_core/source/anuga_validation_tests/case_studies/patong/project.py
r8922 r9056 35 35 finaltime = 15000 # final time for simulation 36 36 37 nameFlag='xxNameFlagxx' 38 37 39 use_buildings = False # FIXME: 6/6/2013 -- Code needs to be edited to support 'True' 38 40 setup = 'basic' # This can be one of three values … … 53 55 #------------------------------------------------------------------------------ 54 56 55 output_comment = [setup, tide, event_number, 'final']57 output_comment = [setup, tide, event_number, nameFlag] 56 58 57 59 #------------------------------------------------------------------------------ -
trunk/anuga_core/source/anuga_validation_tests/case_studies/patong/run_model.py
r8944 r9056 118 118 domain.set_datadir(project.output_run) 119 119 domain.set_flow_algorithm('tsunami') 120 domain.minimum_allowed_height=0.001120 #domain.set_flow_algorithm('DE1') 121 121 122 122 #------------------------------------------------------------------------------- -
trunk/anuga_core/source/anuga_validation_tests/saved_parameters.tex
r9038 r9056 3 3 \newcommand{\majorR}{\UScore{1.3.0-beta}} 4 4 \newcommand{\minorR}{\UScore{9003}} 5 \newcommand{\timeR}{{ Thu Dec 5 15:39:13 2013}}5 \newcommand{\timeR}{{Sun Feb 16 20:16:29 2014}} -
trunk/anuga_work/development/gareth/experimental/bal_and/swb2_domain.py
r9039 r9056 73 73 74 74 self.beta_w=1.0 75 self.beta_w_dry=0. 475 self.beta_w_dry=0.0 76 76 self.beta_uh=1.0 77 77 self.beta_uh_dry=0.0 -
trunk/anuga_work/development/gareth/experimental/bal_and/swb2_domain_ext.c
r9039 r9056 242 242 if(i==0) edgeflux[i] += (s_max*s_min)*(max(q_right_rotated[i],ze) - max(q_left_rotated[i],ze)); 243 243 //if(i==0) edgeflux[i] += (s_max*s_min)*(hre - hle); 244 if(i==1) edgeflux[i] += (s_max*s_min)*(uh_right - uh_left); 245 if(i==2) edgeflux[i] += (s_max*s_min)*(vh_right - vh_left); 244 if((i==1)) edgeflux[i] += (s_max*s_min)*(uh_right - uh_left); 245 //if((i==1)) edgeflux[i] += (s_max*s_min)*(uh_right/(h_right+1.0e-08)*hre - uh_left/(h_left+1.0e-08)*hle); 246 if((i==2)) edgeflux[i] += (s_max*s_min)*(vh_right - vh_left); 247 //if((i==2)) edgeflux[i] += (s_max*s_min)*(vh_right/(h_right+1.0e-08)*hre - vh_left/(h_left+1.0e-08)*hle); 246 248 247 249 edgeflux[i] *= inverse_denominator; … … 538 540 for(k=0; k<number_of_elements; k++){ 539 541 hc = max(stage_centroid_values[k] - bed_centroid_values[k],0.); 540 stage_explicit_update[k]=0.;541 xmom_explicit_update[k]=0.;542 ymom_explicit_update[k]=0.;542 //stage_explicit_update[k]=0.; 543 //xmom_explicit_update[k]=0.; 544 //ymom_explicit_update[k]=0.; 543 545 544 546 for(i=0;i<3;i++){ … … 751 753 double dx1, dx2, dy1, dy2, dxv0, dxv1, dxv2, dyv0, dyv1, dyv2, dq0, dq1, dq2, area2, inv_area2, dpth,momnorm; 752 754 double dqv[3], qmin, qmax, hmin, hmax, bedmax,bedmin, stagemin; 753 double hc, h0, h1, h2, beta_tmp, hfactor, xtmp, ytmp, weight, tmp ;755 double hc, h0, h1, h2, beta_tmp, hfactor, xtmp, ytmp, weight, tmp, v0, v1, v2, vmax,vmin, vc; 754 756 double dk, dv0, dv1, dv2, de[3], demin, dcmax, r0scale, vel_norm, l1, l2, a_tmp, b_tmp, c_tmp,d_tmp; 755 757 … … 845 847 // condition) set its momentum to zero too. Aim is to prevent local 'pits' 846 848 // with a non-zero water surface gradient building up momentum over time 847 for (k=0; k<number_of_elements;k++){848 849 k3=k*3;850 k0 = surrogate_neighbours[k3];851 k1 = surrogate_neighbours[k3 + 1];852 k2 = surrogate_neighbours[k3 + 2];853 854 if((height_centroid_values[k0] < minimum_allowed_height | k0==k) &855 (height_centroid_values[k1] < minimum_allowed_height | k1==k) &856 (height_centroid_values[k2] < minimum_allowed_height | k2==k)){857 xmom_centroid_store[k] = 0.;858 xmom_centroid_values[k] = 0.;859 ymom_centroid_store[k] = 0.;860 ymom_centroid_values[k] = 0.;861 862 }863 }849 //for (k=0; k<number_of_elements;k++){ 850 // 851 // k3=k*3; 852 // k0 = surrogate_neighbours[k3]; 853 // k1 = surrogate_neighbours[k3 + 1]; 854 // k2 = surrogate_neighbours[k3 + 2]; 855 // 856 // if((height_centroid_values[k0] < minimum_allowed_height | k0==k) & 857 // (height_centroid_values[k1] < minimum_allowed_height | k1==k) & 858 // (height_centroid_values[k2] < minimum_allowed_height | k2==k)){ 859 // xmom_centroid_store[k] = 0.; 860 // xmom_centroid_values[k] = 0.; 861 // ymom_centroid_store[k] = 0.; 862 // ymom_centroid_values[k] = 0.; 863 864 // } 865 //} 864 866 865 867 // Begin extrapolation routine … … 1052 1054 hmin = min(min(h0, min(h1, h2)), hc); 1053 1055 hmax = max(max(h0, max(h1, h2)), hc); 1056 1057 //vc = sqrt(xmom_centroid_values[k]*xmom_centroid_values[k]+ 1058 // ymom_centroid_values[k]*ymom_centroid_values[k]); 1059 //v0 = sqrt(xmom_centroid_values[k0]*xmom_centroid_values[k0]+ 1060 // ymom_centroid_values[k0]*ymom_centroid_values[k0]); 1061 //v1 = sqrt(xmom_centroid_values[k1]*xmom_centroid_values[k1]+ 1062 // ymom_centroid_values[k1]*ymom_centroid_values[k1]); 1063 //v2 = sqrt(xmom_centroid_values[k2]*xmom_centroid_values[k2]+ 1064 // ymom_centroid_values[k2]*ymom_centroid_values[k2]); 1065 //vmax=max(max(v0*h0,max(v1*h1,v2*h2)),vc*hc); 1066 //vmin=min(min(v0*h0,min(v1*h1,v2*h2)),vc*hc); 1054 1067 1055 1068 // Look for strong changes in cell depth as an indicator of near-wet-dry … … 1075 1088 // Set hfactor to 0 smoothly as hmin --> minumum_allowed_height 1076 1089 hfactor=min( 1.2*max(hmin-minimum_allowed_height,0.)/(max(hmin,0.)+1.*minimum_allowed_height), hfactor); 1090 1091 //hfactor=min(1.5*max(vmin,0.)/(max(vmax,0.)+1.0e-06), hfactor); 1077 1092 //hfactor=min( 1.2*max(hc-minimum_allowed_height,0.)/(max(hc,0.)+1.*minimum_allowed_height), hfactor); 1078 1093 … … 1252 1267 1253 1268 // Limit the gradient 1254 limit_gradient(dqv, qmin, qmax, beta_tmp);1269 limit_gradient(dqv, qmin, qmax, beta_tmp); 1255 1270 1256 1271 for (i=0;i<3;i++) -
trunk/anuga_work/development/gareth/tests/channel_floodplain/channel_floodplain1.py
r9053 r9056 88 88 domain.set_name('channel_floodplain1') # Output name 89 89 #domain.set_store_vertices_uniquely(True) 90 domain.set_flow_algorithm('DE1') 90 91 #domain.use_edge_limiter=False 91 92 #domain.extrapolate_velocity_second_order=False -
trunk/anuga_work/development/gareth/tests/channel_floodplain/plotme.py
r9022 r9056 1 1 #import util 2 from bal_and import plot_utils as util 2 #from bal_and import plot_utils as util 3 from anuga.utilities import plot_utils as util 3 4 from matplotlib import pyplot as pyplot 4 5 #import pylab … … 7 8 #index=40 8 9 index=570 10 #index=225 9 11 10 12 #p2 = util.get_output('channel_floodplain1_bal_dev.sww', minimum_allowed_height=0.01) … … 13 15 14 16 #p2 = util.get_output('channel_floodplain1_bal_dev_lowvisc.sww', 0.01) 15 p2 = util.get_output('channel_floodplain1.sww', 0.0 1)17 p2 = util.get_output('channel_floodplain1.sww', 0.001) 16 18 p=util.get_centroids(p2, velocity_extrapolation=True) 17 19 -
trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py
r9053 r9056 28 28 #domain.set_store_centroids(True) 29 29 #domain.set_timestepping_method('euler') 30 domain.set_flow_algorithm('DE1') 30 #domain.set_flow_algorithm('DE1') 31 domain.set_flow_algorithm('tsunami') 31 32 domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 32 33 'ymomentum': 2, 'elevation': 2}) 33 domain.minimum_storable_height=1.0e-0334 #domain.minimum_storable_height=1.0e-03 34 35 domain.set_store_vertices_uniquely() 35 36 #------------------ -
trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoidplot.py
r9022 r9056 5 5 #--------------- 6 6 #import util 7 from bal_and import plot_utils as util 7 #from bal_and import plot_utils as util 8 from anuga.utilities import plot_utils as util 8 9 from matplotlib import pyplot as pyplot 9 10 import numpy -
trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_2plot.py
r9031 r9056 9 9 import scipy 10 10 from matplotlib import pyplot as pyplot 11 #from anuga.utilities import plot_utils as util12 from bal_and import plot_utils as util11 from anuga.utilities import plot_utils as util 12 #from bal_and import plot_utils as util 13 13 #-------------- 14 14 # Get variables … … 61 61 pyplot.ylabel('depth (m)') 62 62 63 pyplot.title('Flow depth at 400s-- there should be a central region with steady uniform flow ' )63 pyplot.title('Flow depth at end of simulation -- there should be a central region with steady uniform flow ' ) 64 64 pyplot.savefig('final_depth_v2.png') 65 65 … … 83 83 v=(p2.x==p2.x[tmp]) 84 84 85 ll=p2.vel.shape[0]-1 85 86 #-------------------------------------------------- 86 87 # Check if y velocity is zero everywhere (it should be) 87 88 #-------------------------------------------------- 88 89 pyplot.clf() 89 pyplot.plot(p2.y[v],p2.yvel[ 100,v],'o', label='Numerical')90 pyplot.plot(p2.y[v],p2.yvel[ll,v],'o', label='Numerical') 90 91 pyplot.plot((0,100),(0.0, 0.0),label='Analytical') 91 92 pyplot.xlabel('Distance along the line x==50 (across the slope) (m)') … … 97 98 98 99 pyplot.clf() 99 pyplot.plot(p2.y[v],p2.xvel[ 100,v], 'o', label='Numerical')100 pyplot.plot(p2.y[v],p2.xvel[ll,v], 'o', label='Numerical') 100 101 pyplot.plot((0,100),(uana,uana),label='Analytical') 101 102 #pyplot.ylim([1.0,3.0]) -
trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_sparse.py
r9051 r9056 37 37 #------------------------------------------------------------------------------ 38 38 def topography(x, y): 39 return -x/10. + 1.*(numpy.sin(x/10.) +abs(y-50.)/10.) -0.*(x>80.) # linear bed slope39 return -x/10. #+ 1.*(numpy.sin(x/10.) +abs(y-50.)/10.) -0.*(x>80.) # linear bed slope 40 40 41 41 def stagetopo(x,y): -
trunk/anuga_work/development/gareth/tests/wave_runup/plotme.py
r8867 r9056 66 66 for i in range(len(model_shore_x)): 67 67 # Compute index of shoreline 68 vtmp = p2.stage[i,:]>p2.elev+shoreline_depth_thresh1 68 #vtmp = p2.stage[i,:]>p2.elev+shoreline_depth_thresh1 69 #model_shore_x[i]=p2.x[vtmp].min() 69 70 70 model_shore_x[i]=p2.x[vtmp].min() 71 vtmp = p2.stage[i,:]<p2.elev+shoreline_depth_thresh1 72 model_shore_x[i]=p2.x[vtmp].max() 73 vtmp2=(p2.x>model_shore_x[i]) 74 model_shore_x[i]=p2.x[vtmp2].min() 71 75 #v_ind=(p2.stage[i,vtmp]-p2.elev[vtmp]).argmin() 72 76 # Store x and xvel … … 76 80 # Extract shoreline velocity. It is tricky, to avoid getting 77 81 # zero velocity points -- might be a better way to do it? 78 vtmp2= (p2.stage[i,:]>p2.elev+shoreline_depth_thresh1)*\ 79 (p2.stage[i,:]<p2.elev+shoreline_depth_thresh2) 80 mloc=abs(p2.xvel[i,vtmp2]).argmax() 82 #vtmp2= (p2.stage[i,:]>p2.elev+shoreline_depth_thresh1)*\ 83 # (p2.stage[i,:]<p2.elev+shoreline_depth_thresh2) 84 #mloc=abs(p2.xvel[i,vtmp2]).argmax() 85 81 86 #print abs(p2.xvel[i,vtmp2]).max(), mloc 82 model_shore_u[i]=p2.xvel[i,vtmp2][mloc]87 #model_shore_u[i]=p2.xvel[i,vtmp2][mloc] 83 88 #vtmp2 = (p2.stage[i,:]>p2.elev+0.01) 84 89 #mloc= (vtmp2*(p2.stage[i,:]-p2.elev)).argmin() 85 90 #model_shore_u[i] = p2.xvel[i,mloc] 91 92 vtmp2=vtmp 93 mloc=model_shore_x[i] 94 model_shore_u[i] = p2.xvel[i,p2.x==model_shore_x[i]].max() 86 95 87 96 pyplot.plot(p2.time, model_shore_x-200.,'-o') -
trunk/anuga_work/development/gareth/tests/wave_runup/runup.py
r9038 r9056 10 10 11 11 from math import sin, pi, exp 12 from bal_and import *13 #from anuga import Domain as Domain12 #from bal_and import * 13 from anuga import Domain as Domain 14 14 15 15 #from anuga_tsunami import * … … 32 32 domain.set_datadir('.') # Use current folder 33 33 #domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1}) 34 #domain.set_flow_algorithm('DE1')34 domain.set_flow_algorithm('DE1') 35 35 #------------------ 36 36 # Define topography
Note: See TracChangeset
for help on using the changeset viewer.