Changeset 8799


Ignore:
Timestamp:
Apr 1, 2013, 9:50:20 PM (12 years ago)
Author:
mungkasi
Message:

Adding automated report for transcritical flow with a shock.

Location:
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/transcritical_with_shock
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/transcritical_with_shock/analytical_with_shock.py

    r8621 r8799  
    1212from scipy.optimize import fsolve
    1313from pylab import plot,show,ylim
     14from anuga import g
    1415
    1516
    1617qA  = 0.18  # This is the imposed momentum
    1718hx  = 0.33  # This is the water height downstream
    18 g   = 9.81  # Accelleration due to gravity
    1919
    2020def analytic_sol(x):
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/transcritical_with_shock/numerical_transcritical.py

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

    r8621 r8799  
    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], 0.18*ones(len(p2_st.x[v2])),'r-', label='analytical')
     
    4543#Plot the velocities#########################################################
    4644pyplot.clf()
    47 pyplot.ion()
    4845pyplot.plot(p2_st.x[v2], p2_st.xvel[300,v2], 'b.-', label='numerical') # 0*T/6
    4946pyplot.plot(p2_st.x[v2], 0.18/h,'r-', label='analytical')
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/transcritical_with_shock/produce_results.py

    r8739 r8799  
    1111    run_validation_script('numerical_transcritical.py')
    1212    run_validation_script('plot_results.py')
    13 
     13    run('python', 'produce_report.py') 
     14   
    1415def clean():
    1516    autoclean()
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/transcritical_with_shock/results.tex

    r8621 r8799  
    11
    2 \section{Flow over a bump: transcritical flow with a shock}
     2\section{Transcritical flow with a shock over a bump}
    33
    4 This is transcritical flow over a bump with a shock.
     4This scenario simulates a transcritical flow over a bump with a shock. The topography and the initial conditions are the same as those used in the subcritical flow (See the description given in the report on the subcritical flow test). However, to get a transcritical flow, the boundary conditions are different from those used in the subcritical flow test. Here we refer to the parameters used by Goutal and Maurel~\cite{GM1997}.
     5
     6Referring to our description for the subcritical flow test, the analytical height or depth $h$ of the transcritical flow at smooth regions is found by solving the Bernoulli equation. The analytical solution for the shock position is found by implementing three equations, namely, (a) the Bernoulli equation at upstream (on the left of the shock), (b) the Bernoulli equation at downstream (on the right of the shock), and (c) the Rankine-Hugoniot relation. The Rankine-Hugoniot relation for the steady flow can be expressed as
     7\begin{equation}
     8q^2 \left( \frac{1}{h_1} - \frac{1}{h_2} \right) + \frac{g}{2} \left(h_1^2 - h_2^2\right) = 0\,,
     9\end{equation}
     10where $q$ is the discharge or momentum, $h_1$ is the height upstream (on the left of the shock), and $h_2$ is the height downstream (on the right of the shock). When the height $h$ has been found, the velocity is computed as $u=q/h$\,.
    511
    612\subsection{Results}
    7 
    8 
    9 We should see excellent agreement between the analytical and numerical solutions.
     13For our simulation, we consider Dirichlet boundary conditions
     14at $x=0^{-}$ given by
     15\begin{equation}
     16[w,hu,hv]=[0.41373588752426715,~~~0.18,~~~0]\,,
     17\end{equation}
     18and at $25^{+}$ given by
     19\begin{equation}
     20[w,hu,hv]=[0.33,~~~0.18,~~~0]\,.
     21\end{equation}
     22With these conditions, representatives of the simulation results are shown in the following three figures. They show the stage, $x$-momentum, and $x$-velocity respectively. We should see excellent agreement between the analytical and numerical solutions.
    1023
    1124\begin{figure}[h]
Note: See TracChangeset for help on using the changeset viewer.