Changeset 8773


Ignore:
Timestamp:
Mar 20, 2013, 5:55:11 PM (12 years ago)
Author:
mungkasi
Message:

Adding and modifying automated report for Carrier--Greenspan transient.

Location:
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/carrier_greenspan_transient
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/carrier_greenspan_transient/numerical_cg_transient.py

    r8632 r8773  
    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/carrier_greenspan_transient/plot_results.py

    r8632 r8773  
    4444#Plot the stages##############################################################
    4545pyplot.clf()
    46 pyplot.ion()
    4746pyplot.plot(p2_st.x[v2], p2_st.stage[0,v2], 'b.', label='numerical')
    4847pyplot.plot(p2_st.x[v2], p2_st.stage[1,v2], 'b.')
     
    6160#Plot the momentums##########################################################
    6261pyplot.clf()
    63 pyplot.ion()
    6462pyplot.plot(p2_st.x[v2], p2_st.xmom[0,v2], 'b.', label='numerical')
    6563pyplot.plot(p2_st.x[v2], p2_st.xmom[1,v2], 'b.')
     
    7775#Plot the velocities#########################################################
    7876pyplot.clf()
    79 pyplot.ion()
    8077pyplot.plot(p2_st.x[v2], p2_st.xvel[0,v2], 'b.', label='numerical')
    8178pyplot.plot(p2_st.x[v2], p2_st.xvel[1,v2], 'b.')
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/carrier_greenspan_transient/produce_results.py

    r8739 r8773  
    1010def build():
    1111    run_validation_script('numerical_cg_transient.py')
    12     run_validation_script('plot_results.py')   
     12    run_validation_script('plot_results.py') 
     13    run('python', 'produce_report.py')   
    1314
    1415def clean():
  • trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/carrier_greenspan_transient/results.tex

    r8632 r8773  
    11
    2 \section{Carrier-Greenspan transient solution}
     2\section{Carrier--Greenspan transient solution}
    33
    4 The Carrier-Greenspan transient solution for flows on a sloping beach. References: Carrier and Greenspan, Journal of Fluid Mechanics, 1958.
     4A transient solution for flows on a sloping beach was proposed by Carrier and Greenspan~\cite{CG1958}. The water moves to the shore at an early time, then it becomes still when time is large.
     5
     6Consider the dimensionless shallow water equations, as presented in the Carrier--Greenspan periodic solution.
     7
     8The analytical solution is:
     9\begin{equation}
     10w = - \frac{u^2}{2} + \epsilon {Re}
     11\left[1- 2 \frac{5/4 - i\lambda}{\left\{(1-i\lambda)^2 + \sigma^2 \right\}^{3/2}}
     12+ \frac32 \frac{(1-i\lambda)^2}{\left\{ (1-i\lambda)^2 + \sigma^2 \right\}^{5/2}} \right],
     13\end{equation}
     14\begin{equation}
     15u = \frac{8\epsilon}{a} {Im} \left[ \frac{1}{\left\{(1-i\lambda)^2 + \sigma^2 \right\}^{3/2}}
     16- \frac34 \frac{1-i\lambda}{\left\{ (1-i\lambda)^2 + \sigma^2 \right\}^{5/2}}    \right],
     17\end{equation}
     18where
     19\begin{equation}
     20t = \frac12 a\lambda -u\,, \quad c = \frac14 a\sigma\,,
     21\end{equation}
     22in which $c=\sqrt{gh}$ is the wave propagation speed.
     23Here $\sigma \geq 0$ and we take $a=1.5(1+0.9\epsilon)^{1/2}$. Carrier and Greenspan~\cite{CG1958} observed that the waves do not break if $\epsilon$ is very small, namely $\epsilon \leq 0.23$. Setting $\sigma=0$ into this solution, we get the motion of the shoreline.
     24
     25The initial condition is given by setting time $t=0$ in this analytical solution. Note that this analytical solution is defined in the dimensionless space. To implement this in the numerical test, we just need to scale it back to the dimensional space.
    526
    627\subsection{Results}
    728
    8 
    9 We should see excellent agreement between the analytical and numerical solutions.
     29We consider $\epsilon=0.2$. The following three figures show the stage, $x$-momentum, and $y$-momentum at several instants in time. We should see excellent agreement between the analytical and numerical solutions.
    1030
    1131\begin{figure}[h]
Note: See TracChangeset for help on using the changeset viewer.