Changeset 9216
- Timestamp:
- Jun 24, 2014, 10:48:53 AM (10 years ago)
- Location:
- trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/numerical_channel_floodplain.py
r9215 r9216 20 20 alg = args.alg 21 21 22 23 floodplain_length = 800.0 # Model domain length 24 floodplain_width = 14.0 # Model domain width 25 floodplain_slope = 1./300. 26 chan_initial_depth = 0.65 # Initial depth of water in the channel 27 chan_bankfull_depth = 1.0 # Bankfull depth of the channel 28 chan_width = 10.0 # Bankfull width of the channel 29 bankwidth = 2. # Width of the bank regions -- note that these protrude into the channel 30 man_n=0.03 # Manning's n 31 l0 = 1.00 # Length scale associated with triangle side length in channel (min_triangle area = 0.5*l0^2) 22 from project import * 23 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) 32 33 33 34 assert chan_width < floodplain_width, \ … … 181 182 # Evolve system through time 182 183 #------------------------------------------------------------------------------ 183 for t in domain.evolve(yieldstep=10.0, finaltime= 500.0):184 for t in domain.evolve(yieldstep=10.0, finaltime=1000.0): 184 185 if myid == 0 and verbose: print domain.timestepping_statistics() 185 186 -
trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/plot_results.py
r9038 r9216 3 3 import numpy 4 4 5 from project import * 6 7 filename = 'channel_floodplain.sww' 5 8 6 9 # Time-index to plot outputs from 7 p2 = util.get_output( 'channel_floodplain.sww')10 p2 = util.get_output(filename) 8 11 p=util.get_centroids(p2, velocity_extrapolation=True) 9 12 v = (p.x>6.0)*(p.x<8.0) … … 88 91 pyplot.plot(p.x[v1],Analytic_Stage,'o', label='analytical stage') 89 92 pyplot.plot(p.x[v1],p.elev[v1],'o', label='bed elevation') 90 pyplot.legend(loc=10) 93 pyplot.ylim([-4,2]) 94 pyplot.legend(loc=8) 91 95 pyplot.title('Velocity (analytical and numerical) and Stage:' + '\n' +'Downstream channel regions (95 to 105m)' +'\n') 92 96 pyplot.xlabel('Cross-channel distance (m)') … … 117 121 pyplot.plot(p.x[v1],Analytic_Stage,'o', label='analytical stage') 118 122 pyplot.plot(p.x[v1],p.elev[v1],'o', label='bed elevation') 123 pyplot.ylim([-4,2]) 119 124 pyplot.legend(loc=10) 120 125 pyplot.title('Velocity (analytical and numerical) and Stage:' + '\n' +'Central channel regions (495 to 505m)' +'\n') … … 147 152 pyplot.plot(p.x[v1],Analytic_Stage,'o', label='analytical stage') 148 153 pyplot.plot(p.x[v1],p.elev[v1],'o', label='bed elevation') 154 pyplot.ylim([-4,2]) 149 155 pyplot.legend(loc=10) 150 156 pyplot.title('Velocity (analytical and numerical) and Stage:' + '\n' +'Downstream channel regions (695 to 705m)' +'\n') … … 152 158 pyplot.ylabel('Generic scale (m or m/s)') 153 159 pyplot.savefig('fig4downstream_channel.png') 160 161 162 163 164 165 print '#======================================================================' 166 print '# Extract some cross section info' 167 print '#======================================================================' 168 169 from anuga.shallow_water.sww_interrogate import get_flow_through_cross_section 170 171 polyline0 = [ [floodplain_width, 10.0], [0., 10.0]] 172 polyline1 = [[floodplain_width, floodplain_length-300.0], [0., floodplain_length-300.0]] 173 polyline2 = [[floodplain_width, floodplain_length-1.0], [0., floodplain_length-1.0]] 174 175 time,Q0 = get_flow_through_cross_section(filename, polyline0, verbose=True) 176 time,Q1 = get_flow_through_cross_section(filename, polyline1, verbose=True) 177 time,Q2 = get_flow_through_cross_section(filename, polyline2, verbose=True) 178 179 pyplot.figure(figsize=(12.,8.)) 180 pyplot.plot(time, Q0, label='10m') 181 pyplot.plot(time, Q1, label='500m') 182 pyplot.plot(time, Q2, label='799m') 183 pyplot.plot([0,time[-1]], [Qin,Qin], label='Input Q') 184 pyplot.ylim([0,7]) 185 pyplot.legend(loc=10) 186 pyplot.title('Cross sectional flow across transect at 10m, 500m and 799m') 187 pyplot.xlabel('Time (sec)') 188 pyplot.ylabel('Discharge (m^3/sec)') 189 pyplot.savefig('cross_section_10_500_790.png') 190 191 192 193 -
trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/produce_results.py
r9117 r9216 1 #--------------------------------2 # import modules3 #--------------------------------4 from anuga.validation_utilities.fabricate import *5 from anuga.validation_utilities import run_validation_script6 from anuga.validation_utilities import typeset_report7 1 8 # Setup the python scripts which produce the output for this9 # validation test10 def build():11 run_validation_script('numerical_channel_floodplain.py')12 run_validation_script('plot_results.py')13 typeset_report()14 2 15 def clean(): 16 autoclean() 3 import anuga 4 from anuga.validation_utilities import produce_report 17 5 18 main() 6 args = anuga.get_args() 7 8 produce_report('numerical_channel_floodplain.py', args=args) 9 10 -
trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/results.tex
r9155 r9216 27 27 \end{figure} 28 28 29 Table~\ref{tab:trapztab} shows the discharge computed at a number of cross-sections in the channel, at a number of time-steps on the way to near steady-state. By the end of the simulation they should all be essentially the same. Large variations may suggest mass conservation errors (small variations are probably due to the interpolation that occurs in the routine: 30 \begin{equation*} 31 \textrm{compute\_flow\_through\_cross\_section}. 32 \end{equation*} 29 Figure~\ref{fig:hydrographs} show the hydrographs through various cross sections showing the flows limiting to the 30 expected inflow $Q$. 31 32 \begin{figure} 33 \begin{center} 34 \includegraphics[width=\textwidth]{cross_section_10_500_790.png} 35 \caption{Hydrographs over a number of cross-sections.} 36 \label{fig:hydrographs} 37 \end{center} 38 \end{figure} 39 40 %Table~\ref{tab:trapztab} shows the discharge computed at a number of cross-sections in the channel, at a number of time-steps on the way to near steady-state. By the end of the simulation they should all be essentially the same. Large variations may suggest mass conservation errors (small variations are probably due to the interpolation that occurs in the routine: 41 %\begin{equation*} 42 %\textrm{compute\_flow\_through\_cross\_section}. 43 %\end{equation*} 33 44 34 45 35 \DTLloaddb{dischargeout}{../analytical_exact/trapezoidal_channel/discharge_outputs.txt}46 %\DTLloaddb{dischargeout}{../analytical_exact/trapezoidal_channel/discharge_outputs.txt} 36 47 %\DTLloaddb{dischargeout}{discharge_outputs.txt} 37 \begin{table}38 \caption{Discharge through cross-sections at a number of $x$-position, at different instants in time}39 \label{tab:trapztab}40 \DTLdisplaydb{dischargeout}41 \end{table}48 %\begin{table} 49 %\caption{Discharge through cross-sections at a number of $x$-position, at different instants in time} 50 %\label{tab:trapztab} 51 %\DTLdisplaydb{dischargeout} 52 %\end{table} 42 53 43 54 \endinput
Note: See TracChangeset
for help on using the changeset viewer.