Changeset 8799
- Timestamp:
- Apr 1, 2013, 9:50:20 PM (12 years ago)
- 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 12 12 from scipy.optimize import fsolve 13 13 from pylab import plot,show,ylim 14 from anuga import g 14 15 15 16 16 17 qA = 0.18 # This is the imposed momentum 17 18 hx = 0.33 # This is the water height downstream 18 g = 9.81 # Accelleration due to gravity19 19 20 20 def analytic_sol(x): -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/transcritical_with_shock/numerical_transcritical.py
r8621 r8799 98 98 99 99 #------------------------------------------------------------------------------ 100 # Produce a documentation of parameters 101 #------------------------------------------------------------------------------ 102 parameter_file=open('parameters.tex', 'w') 103 parameter_file.write('\\begin{verbatim}\n') 104 from pprint import pprint 105 pprint(domain.get_algorithm_parameters(),parameter_file,indent=4) 106 parameter_file.write('\\end{verbatim}\n') 107 parameter_file.close() 108 109 #------------------------------------------------------------------------------ 100 110 # Evolve system through time 101 111 #------------------------------------------------------------------------------ -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/transcritical_with_shock/plot_results.py
r8621 r8799 18 18 #Plot the stages############################################################## 19 19 pyplot.clf() 20 pyplot.ion()21 20 pyplot.plot(p2_st.x[v2], p2_st.stage[300,v2], 'b.-', label='numerical stage') # 0*T/6 22 21 pyplot.plot(p2_st.x[v2], h+z,'r-', label='analytical stage') … … 32 31 #Plot the momentums########################################################## 33 32 pyplot.clf() 34 pyplot.ion()35 33 pyplot.plot(p2_st.x[v2], p2_st.xmom[300,v2], 'b.-', label='numerical') # 0*T/6 36 34 pyplot.plot(p2_st.x[v2], 0.18*ones(len(p2_st.x[v2])),'r-', label='analytical') … … 45 43 #Plot the velocities######################################################### 46 44 pyplot.clf() 47 pyplot.ion()48 45 pyplot.plot(p2_st.x[v2], p2_st.xvel[300,v2], 'b.-', label='numerical') # 0*T/6 49 46 pyplot.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 11 11 run_validation_script('numerical_transcritical.py') 12 12 run_validation_script('plot_results.py') 13 13 run('python', 'produce_report.py') 14 14 15 def clean(): 15 16 autoclean() -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/transcritical_with_shock/results.tex
r8621 r8799 1 1 2 \section{ Flow over a bump: transcritical flow with a shock}2 \section{Transcritical flow with a shock over a bump} 3 3 4 This is transcritical flow over a bump with a shock. 4 This 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 6 Referring 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} 8 q^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} 10 where $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$\,. 5 11 6 12 \subsection{Results} 7 8 9 We should see excellent agreement between the analytical and numerical solutions. 13 For our simulation, we consider Dirichlet boundary conditions 14 at $x=0^{-}$ given by 15 \begin{equation} 16 [w,hu,hv]=[0.41373588752426715,~~~0.18,~~~0]\,, 17 \end{equation} 18 and at $25^{+}$ given by 19 \begin{equation} 20 [w,hu,hv]=[0.33,~~~0.18,~~~0]\,. 21 \end{equation} 22 With 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. 10 23 11 24 \begin{figure}[h]
Note: See TracChangeset
for help on using the changeset viewer.