Changeset 8797


Ignore:
Timestamp:
Apr 1, 2013, 10:50:14 AM (12 years ago)
Author:
mungkasi
Message:

Automated report for subcritical flow over a bump.

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  
    1212from scipy.optimize import fsolve
    1313from pylab import plot, ylim, show
     14from anuga import g
    1415
    1516qA = 4.42  # This is the imposed momentum
    1617hx = 2.0   # This is the water height downstream
    17 g  = 9.81  # Accelleration due to gravity
    1818
    1919def analytic_sol(x):   
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/subcritical_over_bump/numerical_subcritical.py

    r8620 r8797  
    9797
    9898#------------------------------------------------------------------------------
     99# Produce a documentation of parameters
     100#------------------------------------------------------------------------------
     101parameter_file=open('parameters.tex', 'w')
     102parameter_file.write('\\begin{verbatim}\n')
     103from pprint import pprint
     104pprint(domain.get_algorithm_parameters(),parameter_file,indent=4)
     105parameter_file.write('\\end{verbatim}\n')
     106parameter_file.close()
     107
     108#------------------------------------------------------------------------------
    99109# Evolve system through time
    100110#------------------------------------------------------------------------------
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/subcritical_over_bump/plot_results.py

    r8620 r8797  
    1818#Plot the stages##############################################################
    1919pyplot.clf()
    20 pyplot.ion()
    2120pyplot.plot(p2_st.x[v2], p2_st.stage[300,v2], 'b.-', label='numerical stage') # 0*T/6
    2221pyplot.plot(p2_st.x[v2], h+z,'r-', label='analytical stage')
     
    3231#Plot the momentums##########################################################
    3332pyplot.clf()
    34 pyplot.ion()
    3533pyplot.plot(p2_st.x[v2], p2_st.xmom[300,v2], 'b.-', label='numerical') # 0*T/6
    3634pyplot.plot(p2_st.x[v2], 4.42*ones(len(p2_st.x[v2])),'r-', label='analytical')
     
    4644#Plot the velocities#########################################################
    4745pyplot.clf()
    48 pyplot.ion()
    4946pyplot.plot(p2_st.x[v2], p2_st.xvel[300,v2], 'b.-', label='numerical') # 0*T/6
    5047pyplot.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  
    1111    run_validation_script('numerical_subcritical.py')
    1212    run_validation_script('plot_results.py')
     13    run('python', 'produce_report.py')     
    1314
    1415def clean():
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/subcritical_over_bump/results.tex

    r8620 r8797  
    11
    2 \section{Flow over a bump: subcritical flow}
     2\section{Subcritical flow over a bump without a shock}
    33
    4 This is a subcritical flow over a bump. No shock occurs.
     4This is a subcritical flow over a bump. This test is adapted from Goutal and Maurel~\cite{GM1997}. No shock occurs in this scenario.
     5
     6Consider a one dimensional domain $[0,25]$ with topography
     7\begin{equation}
     8z(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}
     13together with Dirichlet boundary conditions.
     14Physically, 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
     17The analytical height is found by solving the Bernoulli equation. The simplified Bernoulli equation is the following cubic equation
     18\begin{equation}
     19h^3 + \left(z - \frac{q^2}{2 g H^2} - H \right) h^2 + \frac{q^2}{2 g} = 0\,,
     20\end{equation}
     21where $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$\,.
    522
    623\subsection{Results}
     24For our test we consider the initial condition
     25\begin{equation}
     26u(x,y,0)=v(x,y,0)=0\,, \quad
     27w(x,y,0)= 0.2\,,
     28\end{equation}
     29and the Dirichlet boundary conditions at $x=0^{-}$ and $25^{+}$ to be $[w,hu,hv]=[2, 4.42, 0]$\,.
     30Representatives 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.
    731
    8 
    9 We should see excellent agreement between the analytical and numerical solutions.
    10 
    11 \begin{figure}[h]
     32\begin{figure}
    1233\begin{center}
    1334\includegraphics[width=0.9\textwidth]{stage_plot.png}
     
    1738
    1839
    19 \begin{figure}[h]
     40\begin{figure}
    2041\begin{center}
    2142\includegraphics[width=0.9\textwidth]{xmom_plot.png}
     
    2546
    2647
    27 \begin{figure}[h]
     48\begin{figure}
    2849\begin{center}
    2950\includegraphics[width=0.9\textwidth]{xvel_plot.png}
Note: See TracChangeset for help on using the changeset viewer.