Changeset 8790
- Timestamp:
- Mar 29, 2013, 1:02:35 AM (12 years ago)
- Location:
- trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/paraboloid_basin
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/paraboloid_basin/analytical_paraboloid_basin.py
r8603 r8790 6 6 """ 7 7 from numpy import zeros, sin, cos, sqrt 8 from anuga import g 8 9 9 10 10 11 # Set bed elevation 11 def bed_elevation(x,y,D0=1000.,L=2500.,R0=2000.,g= 9.81):12 def bed_elevation(x,y,D0=1000.,L=2500.,R0=2000.,g=g): 12 13 n = x.shape[0] 13 14 z = 0*x … … 17 18 return z 18 19 19 def analytic_sol(x,y,t,D0=1000.,L=2500.,R0=2000.,g= 9.81):20 def analytic_sol(x,y,t,D0=1000.,L=2500.,R0=2000.,g=g): 20 21 A = (L**4 - R0**4)/(L**4 + R0**4) 21 22 omega = 2./L*sqrt(2.*g*D0) -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/paraboloid_basin/numerical_paraboloid_basin.py
r8603 r8790 14 14 import sys 15 15 import anuga 16 from anuga import g 16 17 from math import sqrt, cos, sin, pi 17 18 from numpy import asarray … … 84 85 L = 2500. 85 86 R0 = 2000. 86 g = 9.8187 87 88 88 A = (L**4 - R0**4)/(L**4 + R0**4) … … 165 165 #=============================================================================== 166 166 167 168 #------------------------------------------------------------------------------ 169 # Produce a documentation of parameters 170 #------------------------------------------------------------------------------ 171 parameter_file=open('parameters.tex', 'w') 172 parameter_file.write('\\begin{verbatim}\n') 173 from pprint import pprint 174 pprint(domain.get_algorithm_parameters(),parameter_file,indent=4) 175 parameter_file.write('\\end{verbatim}\n') 176 parameter_file.close() 177 167 178 for t in domain.evolve(yieldstep = 1.0, finaltime = 200.0): 168 179 domain.write_time() -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/paraboloid_basin/plot_results_cross_section.py
r8603 r8790 22 22 #Plot stages 23 23 pyplot.clf() 24 pyplot.ion()25 24 pyplot.plot(p2_st.x[v2], p2_st.stage[time_level,v2],'b.', label='numerical stage') 26 25 pyplot.plot(p2_st.x[v2], p2_st.elev[v2],'k-', label='bed elevation') … … 35 34 #Plot xmomentum 36 35 pyplot.clf() 37 pyplot.ion()38 36 pyplot.plot(p2_st.x[v2], p2_st.xmom[time_level,v2], 'b.', label='numerical') 39 37 pyplot.plot(p2_st.x[v2], u2*h2,'r-', label='analytical') … … 47 45 #Plot velocities 48 46 pyplot.clf() 49 pyplot.ion()50 47 pyplot.plot(p2_st.x[v2], p2_st.xvel[time_level,v2], 'b.', label='numerical') 51 48 pyplot.plot(p2_st.x[v2], u2,'r-', label='analytical') -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/paraboloid_basin/produce_results.py
r8739 r8790 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/paraboloid_basin/results.tex
r8603 r8790 1 \section{Oscillation on a paraboloid basin} 2 This simulates flow oscillations in a paraboloid basin. The analytical solution is described by Thacker (REF), and is periodic. At any instant in time, the free surface elevation is paraboloid, and the velocity is linear. 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{Oscillations on a paraboloid basin} 2 This test simulates water oscillations on a paraboloid basin. The analytical solution was derived by Thacker~\cite{Thacker1981}, and is periodic. At any instant in time, the free surface elevation is paraboloid, and the velocity is linear. The scenario includes regular wetting and drying, as the flow oscillates up and down 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). This test was also implemented by Yoon and Cho~\cite{YC2001} to investigate the performance of their numerical method. 3 4 Consider the topography in two dimensions 5 \begin{equation} 6 z(x,y) = -D_0\left[1 -\left(\frac{r}{L}\right)^2\right] 7 \end{equation} 8 where $r=\sqrt{x^2 + y^2}$. Here $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,y,t) = \frac{\omega r A sin{(\omega t)}}{ 2 \left[1 -A \cos(\omega t)\right] }, 12 \end{equation} 13 \begin{equation} 14 w(x,y,t) = D_0 \left[\frac{\sqrt(1-A^2)}{1-A\cos(\omega t)} -1 15 -\left( \frac{r}{L}\right)^2 \frac{1-A^2}{[(1-A\cos(\omega t))^2]-1} \right]. 16 \end{equation} 17 Here $\omega=\frac{2\sqrt{2 g D_0}}{L}$ and $A = \frac{L^4 - R_0^4}{L^4 + R_0^4}$ and $R_0$ is the horizontal distance between the centre of water surface and the shore at the initial condition. 18 The initial condition is set by taking $t=0$ in the analytical solution. 3 19 4 20 \subsection{Results} 21 For our test, we consider $D_0=1000$, $L=2500$, and $R_0=2000$. 22 After running the simulation for some time, we have Figures~\ref{fig:cs_stage}--\ref{fig:cs_xvel} showing the stage, $x$-momentum, and $x$-velocity respectively. There should be a good agreement between numerical and analytical solutions. 5 23 6 Figures~\ref{fig:cs_stage}--\ref{fig:cs_xvel} show a good agreement between analytical and numerical solutions.24 As time goes on, some small deviations may appear. These are shown in Figures~\ref{fig:w_centre}--\ref{fig:u_centre}, which illustrate the stage, $x$-momentum, and $x$-velocity at the centroid of the domain. 7 25 8 \begin{figure}[h] 26 27 \begin{figure} 9 28 \begin{center} 10 29 \includegraphics[width=0.9\textwidth]{cross_section_stage.png} … … 14 33 \end{figure} 15 34 16 \begin{figure} [h]35 \begin{figure} 17 36 \begin{center} 18 37 \includegraphics[width=0.9\textwidth]{cross_section_xmom.png} … … 22 41 \end{figure} 23 42 24 \begin{figure} [h]43 \begin{figure} 25 44 \begin{center} 26 45 \includegraphics[width=0.9\textwidth]{cross_section_xvel.png} … … 31 50 32 51 33 There should be a good agreement with the analytical solution, although as time goes on, some deviations may appear. See Figures~\ref{fig:w_centre}--\ref{fig:u_centre}.34 52 35 \begin{figure}[h] 53 54 \begin{figure} 36 55 \begin{center} 37 \includegraphics[width=0.9\textwidth]{Stage_ centre.png}56 \includegraphics[width=0.9\textwidth]{Stage_origin.png} 38 57 \caption{Stage over time in the centre of the paraboloid basin.} 39 58 \label{fig:w_centre} … … 41 60 \end{figure} 42 61 43 \begin{figure} [h]62 \begin{figure} 44 63 \begin{center} 45 \includegraphics[width=0.9\textwidth]{Xmom_ centre.png}64 \includegraphics[width=0.9\textwidth]{Xmom_origin.png} 46 65 \caption{Xmomentum over time in the centre of the paraboloid basin.} 47 66 \label{fig:p_centre} … … 49 68 \end{figure} 50 69 51 \begin{figure} [h]70 \begin{figure} 52 71 \begin{center} 53 \includegraphics[width=0.9\textwidth]{Xvel_ centre.png}72 \includegraphics[width=0.9\textwidth]{Xvel_origin.png} 54 73 \caption{Xvelocity over time in the centre of the paraboloid basin.} 55 74 \label{fig:u_centre}
Note: See TracChangeset
for help on using the changeset viewer.