Changeset 8797
- Timestamp:
- Apr 1, 2013, 10:50:14 AM (12 years ago)
- Location:
- trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/subcritical_over_bump
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/subcritical_over_bump/analytical_subcritical.py
r8620 r8797 12 12 from scipy.optimize import fsolve 13 13 from pylab import plot, ylim, show 14 from anuga import g 14 15 15 16 qA = 4.42 # This is the imposed momentum 16 17 hx = 2.0 # This is the water height downstream 17 g = 9.81 # Accelleration due to gravity18 18 19 19 def analytic_sol(x): -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/subcritical_over_bump/numerical_subcritical.py
r8620 r8797 97 97 98 98 #------------------------------------------------------------------------------ 99 # Produce a documentation of parameters 100 #------------------------------------------------------------------------------ 101 parameter_file=open('parameters.tex', 'w') 102 parameter_file.write('\\begin{verbatim}\n') 103 from pprint import pprint 104 pprint(domain.get_algorithm_parameters(),parameter_file,indent=4) 105 parameter_file.write('\\end{verbatim}\n') 106 parameter_file.close() 107 108 #------------------------------------------------------------------------------ 99 109 # Evolve system through time 100 110 #------------------------------------------------------------------------------ -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/subcritical_over_bump/plot_results.py
r8620 r8797 18 18 #Plot the stages############################################################## 19 19 pyplot.clf() 20 pyplot.ion()21 20 pyplot.plot(p2_st.x[v2], p2_st.stage[300,v2], 'b.-', label='numerical stage') # 0*T/6 22 21 pyplot.plot(p2_st.x[v2], h+z,'r-', label='analytical stage') … … 32 31 #Plot the momentums########################################################## 33 32 pyplot.clf() 34 pyplot.ion()35 33 pyplot.plot(p2_st.x[v2], p2_st.xmom[300,v2], 'b.-', label='numerical') # 0*T/6 36 34 pyplot.plot(p2_st.x[v2], 4.42*ones(len(p2_st.x[v2])),'r-', label='analytical') … … 46 44 #Plot the velocities######################################################### 47 45 pyplot.clf() 48 pyplot.ion()49 46 pyplot.plot(p2_st.x[v2], p2_st.xvel[300,v2], 'b.-', label='numerical') # 0*T/6 50 47 pyplot.plot(p2_st.x[v2], 4.42/h,'r-', label='analytical') -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/subcritical_over_bump/produce_results.py
r8739 r8797 11 11 run_validation_script('numerical_subcritical.py') 12 12 run_validation_script('plot_results.py') 13 run('python', 'produce_report.py') 13 14 14 15 def clean(): -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/subcritical_over_bump/results.tex
r8620 r8797 1 1 2 \section{ Flow over a bump: subcritical flow}2 \section{Subcritical flow over a bump without a shock} 3 3 4 This is a subcritical flow over a bump. No shock occurs. 4 This is a subcritical flow over a bump. This test is adapted from Goutal and Maurel~\cite{GM1997}. No shock occurs in this scenario. 5 6 Consider a one dimensional domain $[0,25]$ with topography 7 \begin{equation} 8 z(x)= \left\{ \begin{array}{ll} 9 0.2-0.05\left(x-10\right)^2& ~\textrm{if}\quad 8 \leq x \leq 12\,,\\ 10 0 & ~\textrm{otherwise}\,,\\ 11 \end{array} \right. 12 \end{equation} 13 together with Dirichlet boundary conditions. 14 Physically, the boundary conditions mean that there is a source of flow upstream at the point $x=0^{-}$ and at the same time there exists a sink of flow downstream at the point $x=25^{+}$\,. 15 16 17 The analytical height is found by solving the Bernoulli equation. The simplified Bernoulli equation is the following cubic equation 18 \begin{equation} 19 h^3 + \left(z - \frac{q^2}{2 g H^2} - H \right) h^2 + \frac{q^2}{2 g} = 0\,, 20 \end{equation} 21 where $H$ is the upstream height and $q=uh$ is the discharge or $x$-momentum. When the height $h$ has been found, the velocity is computed as $u=q/h$\,. 5 22 6 23 \subsection{Results} 24 For our test we consider the initial condition 25 \begin{equation} 26 u(x,y,0)=v(x,y,0)=0\,, \quad 27 w(x,y,0)= 0.2\,, 28 \end{equation} 29 and the Dirichlet boundary conditions at $x=0^{-}$ and $25^{+}$ to be $[w,hu,hv]=[2, 4.42, 0]$\,. 30 Representatives of the simulation results are given in the following three figures. Even though we have small discrepancy in the numerical and analytical momenta, these numerical an analytical solutions should agree quite well. 7 31 8 9 We should see excellent agreement between the analytical and numerical solutions. 10 11 \begin{figure}[h] 32 \begin{figure} 12 33 \begin{center} 13 34 \includegraphics[width=0.9\textwidth]{stage_plot.png} … … 17 38 18 39 19 \begin{figure} [h]40 \begin{figure} 20 41 \begin{center} 21 42 \includegraphics[width=0.9\textwidth]{xmom_plot.png} … … 25 46 26 47 27 \begin{figure} [h]48 \begin{figure} 28 49 \begin{center} 29 50 \includegraphics[width=0.9\textwidth]{xvel_plot.png}
Note: See TracChangeset
for help on using the changeset viewer.