Index: /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/plot_results.py
===================================================================
--- /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/plot_results.py	(revision 8651)
+++ /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/plot_results.py	(revision 8651)
@@ -0,0 +1,95 @@
+"""
+View results of run_channel.py
+
+Simple water flow example using ANUGA: Water flowing down a channel.
+It was called "steep_slope" in an old validation test.
+"""
+#---------------
+# Import Modules
+#---------------
+import time
+import anuga
+import numpy
+import scipy
+from matplotlib import pyplot as pyplot
+from anuga.utilities import plot_utils as util
+#--------------
+# Get variables
+#--------------
+p=util.get_output('channel.sww', 0.001)
+p2=util.get_centroids(p,velocity_extrapolation=True)
+
+#------------------
+# Select line
+#------------------
+#v=(y==2.5)
+v=(p2.y==p2.y[3])
+
+#-------------------------------
+# Define variables of case study
+#-------------------------------
+mann=0.03 # Manning's coef
+bedslope=-0.1
+fluxin=20./100. #The momentum flux at the upstream boundary ( = discharge / width)
+
+#---------------------------------------------
+# Analytical solution for steady, uniform flow
+#---------------------------------------------
+# This comes from solving 
+# 1) Friction_slope=bedslope , and
+# 2) flux = depth*velocity = flux_in
+uana= ( mann**(-2.)*abs(bedslope)*fluxin**(4./3.) )**(3./10.) # Velocity
+dana= fluxin/uana # Depth
+
+#--------------------
+# Make plot animation
+#--------------------
+pyplot.clf()
+pyplot.ion()
+
+line, = pyplot.plot( (p2.x[v].min(),p2.x[v].max()) ,( (p2.stage[:,v]-p2.elev[:,v]).max(),(p2.stage[:,v]-p2.elev[v]).min() ) )
+line.set_label('numerical')
+pyplot.plot( (0,100),(dana,dana), 'r',label='analytical' )
+pyplot.legend()
+#pyplot.plot(x[v],elev[v],'green')
+for i in range(p2.xmom.shape[0]):
+    line.set_xdata(p2.x[v])
+    line.set_ydata(p2.stage[i,v]-p2.elev[v])
+    pyplot.draw()
+    pyplot.title('Flow depth: should be converging to steady uniform flow ' )
+    pyplot.xlabel('Xposition')
+    pyplot.ylabel('Depth')
+pyplot.ylim([0.085,0.095])
+pyplot.legend(loc='best')
+pyplot.title('Flow depth at 400s')# -- there should be a central region with steady uniform flow ' )
+pyplot.savefig('final_depth.png')
+
+#--------------------------------------------
+# Compare velocity with analytical solution
+#--------------------------------------------
+# Find an x value close to x==50
+tmp=(abs(p2.x-50.)).argmin()
+v=(p2.x==p2.x[tmp])
+
+pyplot.clf()
+pyplot.plot(p2.y[v],p2.xvel[100,v], 'o', label='numerical')
+pyplot.plot((0,100),(uana,uana),label='analytical')
+pyplot.ylim([1.0,3.0])
+pyplot.xlabel('Yposition along the line x=50')
+pyplot.ylabel('Xvelocity m/s')
+pyplot.title('Final Xvelocity around the line x=50.')
+pyplot.legend(loc='best')
+pyplot.savefig('x_velocity.png')
+
+pyplot.clf()
+pyplot.plot(p2.y[v],p2.yvel[100,v],'o', label='numerical')
+pyplot.plot((0,100),(0.0, 0.0),label='analytical')
+pyplot.xlabel('Yposition along the line x=50')
+pyplot.ylabel('Yvelocity')
+pyplot.title('Final Yvelocity around the line x=50.')
+pyplot.legend(loc='best')
+pyplot.savefig('y_velocity.png')
+
+
+
+
Index: /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/produce_results.py
===================================================================
--- /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/produce_results.py	(revision 8651)
+++ /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/produce_results.py	(revision 8651)
@@ -0,0 +1,21 @@
+"""
+Simple water flow example using ANUGA: Water flowing down a channel.
+It was called "steep_slope" in an old validation test.
+"""
+#--------------------------------
+# import modules
+#--------------------------------
+
+from fabricate import *
+from validation_tests.utilities import run_validation_script
+
+# Setup the python scripts which produce the output for this
+# validation test
+def build():
+    run_validation_script('run_channel.py')
+    run_validation_script('plot_results.py')
+
+def clean():
+    autoclean()
+
+main()
Index: /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/results.tex
===================================================================
--- /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/results.tex	(revision 8651)
+++ /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/results.tex	(revision 8651)
@@ -0,0 +1,39 @@
+%Note for this test case:
+%Simple water flow example using ANUGA: Water flowing down a channel.
+%It was called "steep_slope" in an old validation test.
+
+
+\section{Shallow flow down a mild slope}
+This case simulates very shallow flow running down a mild slope topography. It represents an idealisation of the rainfall-runoff problem, which will often involve very shallow flows down such a topography. This case has an analytical solution (the steady-uniform solution, bed slope = friction slope).   
+
+\subsection{Results}
+Figures~\ref{fig:depthdownchan} shows the steady state depth in the downstream direction. There should be a good agreement with the analytical solution, at least away from the boundaries.  
+
+\begin{figure}[h]
+\begin{center}
+\includegraphics[width=0.8\textwidth]{final_depth.png}
+\caption{Depth in the downstream direction}
+\label{fig:depthdownchan}
+\end{center}
+\end{figure}
+
+Figures~\ref{fig:xvelscrosschan} and~\ref{fig:yvelscroschan} show the steady state $x$- and $y$-velocities, along a slice in the cross slope direction (near $x=50$). The $x$-velocities should agree well with the analytical solution, and the $y$-velocities should be zero.  
+
+\begin{figure}[h]
+\begin{center}
+\includegraphics[width=0.8\textwidth]{x_velocity.png}
+\caption{$x$-velocity along the cross-section $x=50$ (i.e. a cross-section with constant bed elevation)}
+\label{fig:xvelscrosschan}
+\end{center}
+\end{figure}
+
+\begin{figure}[h]
+\begin{center}
+\includegraphics[width=0.8\textwidth]{y_velocity.png}
+\caption{$y$-velocity along the cross-section $x=50$ (i.e. a cross-section with constant bed elevation)}
+\label{fig:yvelscroschan}
+\end{center}
+\end{figure}
+
+
+\endinput
Index: /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/run_channel.py
===================================================================
--- /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/run_channel.py	(revision 8651)
+++ /trunk/anuga_core/validation_tests/Tests/Simple/rundown_mild_slope/run_channel.py	(revision 8651)
@@ -0,0 +1,67 @@
+"""
+Simple water flow example using ANUGA: Water flowing down a channel.
+It was called "steep_slope" in an old validation test.
+"""
+import sys
+
+#------------------------------------------------------------------------------
+# Import necessary modules
+#------------------------------------------------------------------------------
+import anuga
+from anuga import rectangular_cross as rectangular_cross
+from anuga.structures.inlet_operator import Inlet_operator
+from anuga import Domain
+
+#------------------------------------------------------------------------------
+# Setup computational domain
+#------------------------------------------------------------------------------
+points, vertices, boundary = rectangular_cross(50, 50, len1=100.0, len2=100.0)
+domain = Domain(points, vertices, boundary) # Create domain
+domain.set_name('channel') # Output name
+
+#------------------------------------------------------------------------------
+# Setup Algorithm, either using command line arguments
+# or override manually yourself
+#------------------------------------------------------------------------------
+from anuga.utilities.argparsing import parse_standard_args
+alg, cfl = parse_standard_args()
+alg = '2_0'
+domain.set_flow_algorithm(alg)
+domain.set_CFL(cfl)
+
+#------------------------------------------------------------------------------
+# Setup initial conditions
+#------------------------------------------------------------------------------
+##Note by Sudi Mungkasi: DO NOT USE INLET. INLET IS NOT APPROPRIATE FOR THIS PROBLEM
+Qin=20.
+fluxin=Qin/100. #The momentum flux at the upstream boundary ( = discharge / width)
+uana= 2.15843634571 # analytical Xvelocity
+dana= 0.0926596702273 # analytical water depth
+
+def topography(x, y):
+	return -x/10. # linear bed slope
+
+def init_stage(x,y):
+    stg= -x/10.+0.01 # Constant depth: 1 cm.
+    return stg
+#line0=[ [0.,0.], [0., 100.] ]
+#Uin=[uana, 0.0]
+#Inlet_operator(domain, line0, Q=Qin, velocity=Uin)
+
+domain.set_quantity('elevation', topography) # Use function for elevation
+domain.set_quantity('friction', 0.03) # Constant friction
+domain.set_quantity('stage', init_stage)
+
+#------------------------------------------------------------------------------
+# Setup boundary conditions
+#------------------------------------------------------------------------------
+Bt = anuga.Transmissive_boundary(domain)
+BdIN = anuga.Dirichlet_boundary([dana, fluxin, 0.0])
+#BdOUT = anuga.Dirichlet_boundary([dana-10., fluxin, 0.0])
+Br = anuga.Reflective_boundary(domain) # Solid reflective wall
+domain.set_boundary({'left': BdIN, 'right': Bt, 'top': Br, 'bottom': Br})
+#------------------------------------------------------------------------------
+# Evolve system through time
+#------------------------------------------------------------------------------
+for t in domain.evolve(yieldstep=2.0, finaltime=200.0):
+	print domain.timestepping_statistics()
