Changeset 9217
- Timestamp:
- Jun 24, 2014, 11:51:04 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/numerical_channel_floodplain.py
r9216 r9217 10 10 import anuga 11 11 import numpy 12 from anuga import Inlet_operator13 12 from anuga import myid, finalize, distribute 14 13 … … 20 19 alg = args.alg 21 20 22 from project import * 21 #-------------------------------- 22 # See project file for definitions of these 23 # variables 24 #-------------------------------- 25 from project import \ 26 floodplain_length, floodplain_width, floodplain_slope,\ 27 chan_initial_depth, chan_bankfull_depth, chan_width, bankwidth, \ 28 man_n, l0 23 29 24 # floodplain_length = 800.0 # Model domain length 25 # floodplain_width = 14.0 # Model domain width 26 # floodplain_slope = 1./300. 27 # chan_initial_depth = 0.65 # Initial depth of water in the channel 28 # chan_bankfull_depth = 1.0 # Bankfull depth of the channel 29 # chan_width = 10.0 # Bankfull width of the channel 30 # bankwidth = 2. # Width of the bank regions -- note that these protrude into the channel 31 # man_n=0.03 # Manning's n 32 # l0 = 1.00 # Length scale associated with triangle side length in channel (min_triangle area = 0.5*l0^2) 30 #l0 = 2.0 33 31 34 32 assert chan_width < floodplain_width, \ … … 135 133 Qin = 0.5*(floodplain_slope*(chan_width*chan_initial_depth)**2.*man_n**(-2.)\ 136 134 *chan_initial_depth**(4./3.) )**0.5 137 Inlet_operator(domain, line1, Qin)135 anuga.Inlet_operator(domain, line1, Qin) 138 136 139 137 if myid == 0 and verbose : print 'Discharge in = ', Qin … … 152 150 # or incorrect more generally if there are numerical problems. But, in the central regions of 153 151 # the channel, this shouldn't prevent us reaching steady, uniform flow. 154 Bout_tmss = anuga. shallow_water.boundaries.Transmissive_momentum_set_stage_boundary(domain, function = outflow_stage_boundary)152 Bout_tmss = anuga.Transmissive_momentum_set_stage_boundary(domain, function = outflow_stage_boundary) 155 153 156 154 domain.set_boundary({'left': Br, … … 162 160 'chan_out': Bout_tmss, 163 161 'chan_in': Br}) 164 165 # Set up file to record computations of discharge at several points.166 #discharge_outfile=open('discharge_outputs.txt', 'w')167 #discharge_outfile.write('Time (s)'+","+ 'Discharge@10' + ","+ 'Discharge@700'+","+ 'Discharge@1000' + "\n")168 162 169 163 … … 185 179 if myid == 0 and verbose: print domain.timestepping_statistics() 186 180 187 ## xx=domain.quantities['ymomentum'].centroid_values188 ## dd=(domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values)189 ## dd=dd*(dd>0.)190 191 ## tmp = xx/(dd+1.0e-06)*(dd>0.0)192 ## print tmp.max(), tmp.argmax(), tmp.min(), tmp.argmin()193 194 ## # Compute flow through cross-section -- check that the inflow boundary condition is doing its job195 ## # This also provides another useful steady-state check196 ## if( numpy.floor(t/100.) == t/100. ):197 ## print '#### COMPUTING FLOW THROUGH CROSS-SECTIONS########'198 ## s0 = domain.get_flow_through_cross_section([[0., 10.0], [floodplain_width, 10.0]])199 ## s1 = domain.get_flow_through_cross_section([[0., floodplain_length-300.0], [floodplain_width, floodplain_length-300.0]])200 ## s2 = domain.get_flow_through_cross_section([[0., floodplain_length-1.0], [floodplain_width, floodplain_length-1.0]])201 202 ## print 'Cross sectional flows: ',s0, s1, s2203 ## print '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$'204 ## discharge_outfile.write(str(t) + "," +str(s0) + ","+ str(s1) +"," + str(s2) + "\n")205 206 ## discharge_outfile.close()207 208 181 domain.sww_merge(delete_old=True) 209 182
Note: See TracChangeset
for help on using the changeset viewer.