Changeset 8788
- Timestamp:
- Mar 28, 2013, 10:47:22 PM (12 years ago)
- Location:
- trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/parabolic_basin
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/parabolic_basin/analytical_parabolic_basin.py
r8602 r8788 4 4 """ 5 5 from numpy import zeros,sqrt,sin,cos 6 from anuga import g 6 7 7 def analytic_cannal(x,t, D0=4., L=10., A=2., g= 9.81):8 def analytic_cannal(x,t, D0=4., L=10., A=2., g=g): 8 9 omega = sqrt(2*D0*g)/L 9 10 N = len(x) -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/parabolic_basin/numerical_parabolic_basin.py
r8602 r8788 101 101 102 102 103 #------------------------------------------------------------------------------ 104 # Produce a documentation of parameters 105 #------------------------------------------------------------------------------ 106 parameter_file=open('parameters.tex', 'w') 107 parameter_file.write('\\begin{verbatim}\n') 108 from pprint import pprint 109 pprint(domain.get_algorithm_parameters(),parameter_file,indent=4) 110 parameter_file.write('\\end{verbatim}\n') 111 parameter_file.close() 112 113 103 114 #------------------------------ 104 115 #Evolve the system through time -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/parabolic_basin/plot_results_cross_section.py
r8602 r8788 24 24 #Plot stages 25 25 pyplot.clf() 26 pyplot.ion()27 26 pyplot.plot(p2_st.x[v2], p2_st.stage[time_level,v2],'b.', label='numerical stage') 28 27 pyplot.plot(p2_st.x[v2], p2_st.elev[v2],'k-', label='bed elevation') … … 37 36 #Plot xmomentum 38 37 pyplot.clf() 39 pyplot.ion()40 38 pyplot.plot(p2_st.x[v2], p2_st.xmom[time_level,v2], 'b.', label='numerical') 41 39 pyplot.plot(p2_st.x[v2], u*h,'r-', label='analytical') … … 49 47 #Plot velocities 50 48 pyplot.clf() 51 pyplot.ion()52 49 pyplot.plot(p2_st.x[v2], p2_st.xvel[time_level,v2], 'b.', label='numerical') 53 50 pyplot.plot(p2_st.x[v2], u,'r-', label='analytical') -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/parabolic_basin/produce_results.py
r8739 r8788 12 12 run_validation_script('plot_results_cross_section.py') 13 13 run_validation_script('plot_results_origin_wrt_time.py') 14 run('python', 'produce_report.py') 14 15 15 16 def clean(): -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/parabolic_basin/results.tex
r8602 r8788 1 \section{1D Parabolic Basin} 2 This simulates flow oscillations in a 1D parabolic basin. The analytical solution is described by Thacker (REF), and is periodic. At any instant in time, the free surface elevation is planar, and the velocity is constant (in wet regions). The scenario includes regular wetting and drying, as the flow oscillates back and forth in the basin. As well as testing the ability of the code to do wetting and drying, it will highlight any numerical energy loss or gain, manifest as an increase or decrease in the magnitude of the flow oscillations over long time periods, compared with the analytical solution. 1 \section{Thacker's Planar Oscillations on a Parabolic Basin} 2 This test simulates planar oscillations of water in a parabolic basin. The analytical solution was derived by Thacker~\cite{Thacker1981}, and is periodic. At any instant in time, the free surface elevation is planar, and the velocity is constant (in wet regions). The scenario includes regular wetting and drying, as the flow oscillates back and forth in the basin. As well as testing the ability of the code to do wetting and drying, it will highlight any numerical energy loss or gain, and manifest as an increase or decrease in the magnitude of the flow oscillations over long time periods (compared with the analytical solution). 3 4 Consider the topography 5 \begin{equation} 6 z(x) = D_0 \left(\frac{x}{L}\right)^2 7 \end{equation} 8 where $D_0$ is the largest depth when water is still and $L$ is the distance between the centre of water surface and the shore when water is still. 9 The analytical solution is 10 \begin{equation} 11 u(x,t) = -A \omega \sin(\omega t), 12 \end{equation} 13 \begin{equation} 14 w(x,t) = D_0 + \frac{2 A D_0}{L^2} \cos(\omega t) \left( x - \frac{A}{2}\cos(\omega t) \right). 15 \end{equation} 16 Here $\omega=\sqrt{\frac{2 g D_0)}{L}}$. 17 The initial condition is set by taking $t=0$ in the analytical solution. 18 3 19 4 20 \subsection{Results} 21 For our test, we consider $D_0=4$, $L=10$, and $A=2$. After running the simulation for some time, we have Figures~\ref{fig:cross_section_stage}--\ref{fig:cross_section_xvel} showing the stage, $x$-momentum, and $x$-velocity respectively. There should be a good agreement between numerical and analytical solutions. 5 22 6 Figures~\ref{fig:cross_section_stage}--\ref{fig:cross_section_xvel} show a good agreement between analytical and numerical solutions. 7 8 \begin{figure}[h] 23 \begin{figure}[!h] 9 24 \begin{center} 10 25 \includegraphics[width=0.9\textwidth]{cross_section_stage.png} 11 \caption{Stage on a cross section of the basin at time $t= $ ?}26 \caption{Stage on a cross section of the basin at time $t=10$.} 12 27 \label{fig:cross_section_stage} 13 28 \end{center} 14 29 \end{figure} 15 30 16 \begin{figure} [h]31 \begin{figure} 17 32 \begin{center} 18 33 \includegraphics[width=0.9\textwidth]{cross_section_xmom.png} 19 \caption{Xmomentum on a cross section of the basin at time $t= $ ?}34 \caption{Xmomentum on a cross section of the basin at time $t=10$.} 20 35 \label{fig:cross_section_xmom} 21 36 \end{center} 22 37 \end{figure} 23 38 24 \begin{figure} [h]39 \begin{figure} 25 40 \begin{center} 26 41 \includegraphics[width=0.9\textwidth]{cross_section_xvel.png} 27 \caption{Xvelocity on a cross section of the basin at time $t= $ ?}42 \caption{Xvelocity on a cross section of the basin at time $t=10$.} 28 43 \label{fig:cross_section_xvel} 29 44 \end{center} … … 31 46 32 47 33 There should be a good agreement with the analytical solution, although as time goes on, some deviations may appear. See Figures~\ref{fig:Stage_centre}--\ref{fig:Xvel_centre}.48 As time goes on, some small deviations may appear. These are shown in Figures~\ref{fig:Stage_centre}--\ref{fig:Xvel_centre}, which illustrate the stage, $x$-momentum, and $x$-velocity at the centroid of the domain. 34 49 35 \begin{figure}[ h]50 \begin{figure}[!h] 36 51 \begin{center} 37 52 \includegraphics[width=0.9\textwidth]{Stage_centre.png} … … 41 56 \end{figure} 42 57 43 \begin{figure} [h]58 \begin{figure} 44 59 \begin{center} 45 60 \includegraphics[width=0.9\textwidth]{Xmom_centre.png} … … 49 64 \end{figure} 50 65 51 \begin{figure} [h]66 \begin{figure} 52 67 \begin{center} 53 68 \includegraphics[width=0.9\textwidth]{Xvel_centre.png}
Note: See TracChangeset
for help on using the changeset viewer.