Changeset 8800


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

Adding automated report for transcritical flow without a shock.

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

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/transcritical_without_shock/analytical_without_shock.py

    r8622 r8800  
    1212from scipy.optimize import fsolve
    1313from pylab import plot, show
     14from anuga import g
    1415
    1516
    1617q0  = 1.53  # This is the imposed momentum
    1718h_d = 0.66  # 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_without_shock/numerical_transcritical.py

    r8622 r8800  
    107107
    108108#------------------------------------------------------------------------------
     109# Produce a documentation of parameters
     110#------------------------------------------------------------------------------
     111parameter_file=open('parameters.tex', 'w')
     112parameter_file.write('\\begin{verbatim}\n')
     113from pprint import pprint
     114pprint(domain.get_algorithm_parameters(),parameter_file,indent=4)
     115parameter_file.write('\\end{verbatim}\n')
     116parameter_file.close()
     117
     118#------------------------------------------------------------------------------
    109119# Evolve system through time
    110120#------------------------------------------------------------------------------
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/transcritical_without_shock/plot_results.py

    r8622 r8800  
    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], 1.53*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], 1.53/h,'r-', label='analytical')
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/transcritical_without_shock/produce_results.py

    r8739 r8800  
    1111    run_validation_script('numerical_transcritical.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/transcritical_without_shock/results.tex

    r8622 r8800  
    11
    2 \section{Flow over a bump: transcritical flow without a shock}
     2\section{Transcritical flow without a shock over a bump}
    33
    4 This is transcritical flow over a bump without a shock.
     4This scenario exhibits transcritical flow without a shock over a bump.
     5This test is adapted from Goutal and Maurel~\cite{GM1997}.
     6The topography and the initial conditions are the same as those used in the subcritical flow as well as the transcritical flow with a shock (See the description given in the report on the subcritical flow and transcritical flow with a shock). 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}. The analytical height or depth $h$ of the transcritical flow is calculated the Bernoulli equation. The velocity is computed as $u=q/h$\,.
    57
    68\subsection{Results}
     9Referring to Goutal and Maurel~\cite{GM1997}, we consider the initial condition
     10\begin{equation}
     11u(x,y,0)=v(x,y,0)=0\,, \quad
     12w(x,y,0)= 0.66\,,
     13\end{equation}
     14We enforce Dirichlet boundary conditions
     15at $x=0^{-}$ given by
     16\begin{equation}
     17[w,hu,hv]=[1.0144468506259066,~~~1.53,~~~0]\,,
     18\end{equation}
     19and at $25^{+}$ given by
     20\begin{equation}
     21[w,hu,hv]=[0.4057809296474606,~~~1.53,~~~0]\,.
     22\end{equation}
    723
    824
    9 We should see excellent agreement between the analytical and numerical solutions.
     25
     26
     27Representatives of the simulation results are given in the following three figures. We should see excellent agreement between the analytical and numerical solutions. Small discrepancy may occurs for the $x$-momentum. It is not clear what makes this discrepancy. Numerical analysis may be conducted further to investigate why this discrepancy occurs.
    1028
    1129\begin{figure}[h]
Note: See TracChangeset for help on using the changeset viewer.