Changeset 8788


Ignore:
Timestamp:
Mar 28, 2013, 10:47:22 PM (12 years ago)
Author:
mungkasi
Message:

Automated report for parabolic basin.

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  
    44"""
    55from numpy import zeros,sqrt,sin,cos
     6from anuga import g
    67
    7 def analytic_cannal(x,t, D0=4., L=10., A=2., g=9.81):
     8def analytic_cannal(x,t, D0=4., L=10., A=2., g=g):
    89    omega = sqrt(2*D0*g)/L
    910    N = len(x)
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/parabolic_basin/numerical_parabolic_basin.py

    r8602 r8788  
    101101
    102102
     103#------------------------------------------------------------------------------
     104# Produce a documentation of parameters
     105#------------------------------------------------------------------------------
     106parameter_file=open('parameters.tex', 'w')
     107parameter_file.write('\\begin{verbatim}\n')
     108from pprint import pprint
     109pprint(domain.get_algorithm_parameters(),parameter_file,indent=4)
     110parameter_file.write('\\end{verbatim}\n')
     111parameter_file.close()
     112
     113
    103114#------------------------------
    104115#Evolve the system through time
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/parabolic_basin/plot_results_cross_section.py

    r8602 r8788  
    2424#Plot stages
    2525pyplot.clf()
    26 pyplot.ion()
    2726pyplot.plot(p2_st.x[v2], p2_st.stage[time_level,v2],'b.', label='numerical stage')
    2827pyplot.plot(p2_st.x[v2], p2_st.elev[v2],'k-', label='bed elevation')
     
    3736#Plot xmomentum
    3837pyplot.clf()
    39 pyplot.ion()
    4038pyplot.plot(p2_st.x[v2], p2_st.xmom[time_level,v2], 'b.', label='numerical')
    4139pyplot.plot(p2_st.x[v2], u*h,'r-', label='analytical')
     
    4947#Plot velocities
    5048pyplot.clf()
    51 pyplot.ion()
    5249pyplot.plot(p2_st.x[v2], p2_st.xvel[time_level,v2], 'b.', label='numerical')
    5350pyplot.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  
    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/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}
     2This 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
     4Consider the topography
     5\begin{equation}
     6z(x) = D_0 \left(\frac{x}{L}\right)^2
     7\end{equation}
     8where $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,t) = -A \omega \sin(\omega t),
     12\end{equation}
     13\begin{equation}
     14w(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}
     16Here $\omega=\sqrt{\frac{2 g D_0)}{L}}$.
     17The initial condition is set by taking $t=0$ in the analytical solution.
     18
    319
    420\subsection{Results}
     21For 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.
    522
    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]
    924\begin{center}
    1025\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$.}
    1227\label{fig:cross_section_stage}
    1328\end{center}
    1429\end{figure}
    1530
    16 \begin{figure}[h]
     31\begin{figure}
    1732\begin{center}
    1833\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$.}
    2035\label{fig:cross_section_xmom}
    2136\end{center}
    2237\end{figure}
    2338
    24 \begin{figure}[h]
     39\begin{figure}
    2540\begin{center}
    2641\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$.}
    2843\label{fig:cross_section_xvel}
    2944\end{center}
     
    3146
    3247
    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}.
     48As 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.
    3449
    35 \begin{figure}[h]
     50\begin{figure}[!h]
    3651\begin{center}
    3752\includegraphics[width=0.9\textwidth]{Stage_centre.png}
     
    4156\end{figure}
    4257
    43 \begin{figure}[h]
     58\begin{figure}
    4459\begin{center}
    4560\includegraphics[width=0.9\textwidth]{Xmom_centre.png}
     
    4964\end{figure}
    5065
    51 \begin{figure}[h]
     66\begin{figure}
    5267\begin{center}
    5368\includegraphics[width=0.9\textwidth]{Xvel_centre.png}
Note: See TracChangeset for help on using the changeset viewer.