Changeset 8773
- Timestamp:
- Mar 20, 2013, 5:55:11 PM (12 years ago)
- 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 107 107 108 108 #------------------------------------------------------------------------------ 109 # Produce a documentation of parameters 110 #------------------------------------------------------------------------------ 111 parameter_file=open('parameters.tex', 'w') 112 parameter_file.write('\\begin{verbatim}\n') 113 from pprint import pprint 114 pprint(domain.get_algorithm_parameters(),parameter_file,indent=4) 115 parameter_file.write('\\end{verbatim}\n') 116 parameter_file.close() 117 118 #------------------------------------------------------------------------------ 109 119 # Evolve system through time 110 120 #------------------------------------------------------------------------------ -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/carrier_greenspan_transient/plot_results.py
r8632 r8773 44 44 #Plot the stages############################################################## 45 45 pyplot.clf() 46 pyplot.ion()47 46 pyplot.plot(p2_st.x[v2], p2_st.stage[0,v2], 'b.', label='numerical') 48 47 pyplot.plot(p2_st.x[v2], p2_st.stage[1,v2], 'b.') … … 61 60 #Plot the momentums########################################################## 62 61 pyplot.clf() 63 pyplot.ion()64 62 pyplot.plot(p2_st.x[v2], p2_st.xmom[0,v2], 'b.', label='numerical') 65 63 pyplot.plot(p2_st.x[v2], p2_st.xmom[1,v2], 'b.') … … 77 75 #Plot the velocities######################################################### 78 76 pyplot.clf() 79 pyplot.ion()80 77 pyplot.plot(p2_st.x[v2], p2_st.xvel[0,v2], 'b.', label='numerical') 81 78 pyplot.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 10 10 def build(): 11 11 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') 13 14 14 15 def clean(): -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/carrier_greenspan_transient/results.tex
r8632 r8773 1 1 2 \section{Carrier- Greenspan transient solution}2 \section{Carrier--Greenspan transient solution} 3 3 4 The Carrier-Greenspan transient solution for flows on a sloping beach. References: Carrier and Greenspan, Journal of Fluid Mechanics, 1958. 4 A 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 6 Consider the dimensionless shallow water equations, as presented in the Carrier--Greenspan periodic solution. 7 8 The analytical solution is: 9 \begin{equation} 10 w = - \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} 15 u = \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} 18 where 19 \begin{equation} 20 t = \frac12 a\lambda -u\,, \quad c = \frac14 a\sigma\,, 21 \end{equation} 22 in which $c=\sqrt{gh}$ is the wave propagation speed. 23 Here $\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 25 The 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. 5 26 6 27 \subsection{Results} 7 28 8 9 We should see excellent agreement between the analytical and numerical solutions. 29 We 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. 10 30 11 31 \begin{figure}[h]
Note: See TracChangeset
for help on using the changeset viewer.