Changeset 8790


Ignore:
Timestamp:
Mar 29, 2013, 1:02:35 AM (12 years ago)
Author:
mungkasi
Message:

Adding automated report for paraboloid basin.

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  
    66"""
    77from numpy import zeros, sin, cos, sqrt
     8from anuga import g
    89
    910
    1011# Set bed elevation
    11 def bed_elevation(x,y,D0=1000.,L=2500.,R0=2000.,g=9.81):
     12def bed_elevation(x,y,D0=1000.,L=2500.,R0=2000.,g=g):
    1213    n = x.shape[0]
    1314    z = 0*x
     
    1718    return z
    1819
    19 def analytic_sol(x,y,t,D0=1000.,L=2500.,R0=2000.,g=9.81):
     20def analytic_sol(x,y,t,D0=1000.,L=2500.,R0=2000.,g=g):
    2021    A = (L**4 - R0**4)/(L**4 + R0**4)
    2122    omega = 2./L*sqrt(2.*g*D0)
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/paraboloid_basin/numerical_paraboloid_basin.py

    r8603 r8790  
    1414import sys
    1515import anuga
     16from anuga import g
    1617from math import sqrt, cos, sin, pi
    1718from numpy import asarray
     
    8485L = 2500.
    8586R0 = 2000.
    86 g = 9.81
    8787
    8888A = (L**4 - R0**4)/(L**4 + R0**4)
     
    165165#===============================================================================
    166166
     167
     168#------------------------------------------------------------------------------
     169# Produce a documentation of parameters
     170#------------------------------------------------------------------------------
     171parameter_file=open('parameters.tex', 'w')
     172parameter_file.write('\\begin{verbatim}\n')
     173from pprint import pprint
     174pprint(domain.get_algorithm_parameters(),parameter_file,indent=4)
     175parameter_file.write('\\end{verbatim}\n')
     176parameter_file.close()
     177
    167178for t in domain.evolve(yieldstep = 1.0, finaltime = 200.0):
    168179    domain.write_time()
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/paraboloid_basin/plot_results_cross_section.py

    r8603 r8790  
    2222#Plot stages
    2323pyplot.clf()
    24 pyplot.ion()
    2524pyplot.plot(p2_st.x[v2], p2_st.stage[time_level,v2],'b.', label='numerical stage')
    2625pyplot.plot(p2_st.x[v2], p2_st.elev[v2],'k-', label='bed elevation')
     
    3534#Plot xmomentum
    3635pyplot.clf()
    37 pyplot.ion()
    3836pyplot.plot(p2_st.x[v2], p2_st.xmom[time_level,v2], 'b.', label='numerical')
    3937pyplot.plot(p2_st.x[v2], u2*h2,'r-', label='analytical')
     
    4745#Plot velocities
    4846pyplot.clf()
    49 pyplot.ion()
    5047pyplot.plot(p2_st.x[v2], p2_st.xvel[time_level,v2], 'b.', label='numerical')
    5148pyplot.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  
    1212    run_validation_script('plot_results_cross_section.py')
    1313    run_validation_script('plot_results_origin_wrt_time.py')   
     14    run('python', 'produce_report.py')   
    1415
    1516def 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}
     2This 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
     4Consider the topography in two dimensions
     5\begin{equation}
     6z(x,y) = -D_0\left[1 -\left(\frac{r}{L}\right)^2\right]
     7\end{equation}
     8where $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.
     9The analytical solution is
     10\begin{equation}
     11u(x,y,t) = \frac{\omega r A sin{(\omega t)}}{ 2 \left[1 -A \cos(\omega t)\right] },
     12\end{equation}
     13\begin{equation}
     14w(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}
     17Here $\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.
     18The initial condition is set by taking $t=0$ in the analytical solution.
    319
    420\subsection{Results}
     21For our test, we consider $D_0=1000$, $L=2500$, and $R_0=2000$.
     22After 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.
    523
    6 Figures~\ref{fig:cs_stage}--\ref{fig:cs_xvel} show a good agreement between analytical and numerical solutions.
     24As 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.
    725
    8 \begin{figure}[h]
     26
     27\begin{figure}
    928\begin{center}
    1029\includegraphics[width=0.9\textwidth]{cross_section_stage.png}
     
    1433\end{figure}
    1534
    16 \begin{figure}[h]
     35\begin{figure}
    1736\begin{center}
    1837\includegraphics[width=0.9\textwidth]{cross_section_xmom.png}
     
    2241\end{figure}
    2342
    24 \begin{figure}[h]
     43\begin{figure}
    2544\begin{center}
    2645\includegraphics[width=0.9\textwidth]{cross_section_xvel.png}
     
    3150
    3251
    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}.
    3452
    35 \begin{figure}[h]
     53
     54\begin{figure}
    3655\begin{center}
    37 \includegraphics[width=0.9\textwidth]{Stage_centre.png}
     56\includegraphics[width=0.9\textwidth]{Stage_origin.png}
    3857\caption{Stage over time in the centre of the paraboloid basin.}
    3958\label{fig:w_centre}
     
    4160\end{figure}
    4261
    43 \begin{figure}[h]
     62\begin{figure}
    4463\begin{center}
    45 \includegraphics[width=0.9\textwidth]{Xmom_centre.png}
     64\includegraphics[width=0.9\textwidth]{Xmom_origin.png}
    4665\caption{Xmomentum over time in the centre of the paraboloid basin.}
    4766\label{fig:p_centre}
     
    4968\end{figure}
    5069
    51 \begin{figure}[h]
     70\begin{figure}
    5271\begin{center}
    53 \includegraphics[width=0.9\textwidth]{Xvel_centre.png}
     72\includegraphics[width=0.9\textwidth]{Xvel_origin.png}
    5473\caption{Xvelocity over time in the centre of the paraboloid basin.}
    5574\label{fig:u_centre}
Note: See TracChangeset for help on using the changeset viewer.