Changeset 4118


Ignore:
Timestamp:
Dec 22, 2006, 1:53:58 PM (18 years ago)
Author:
ole
Message:

tex

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/publications/linuxconf_2006/paper_ole_nielsen.tex

    r4117 r4118  
    312312To set up a scenario the user specifies the geometry (derived from bathymetric and topographic data), the initial water level, boundary conditions (e.g. tide), outputs from other models (e.g. a deep water tsunami model), and forcing terms (e.g. frictional resistance, wind stress, atmospheric pressure gradients etc.).  The geometry could for example be a digital elevation model of an estuary and a boundary could be a collection of time series derived from tide gauges.
    313313
    314 To help with these tasks, a tool called pmesh has been developed which allows the user to set up the geometry of the problem interactively.  Pmesh produces a triangular mesh of the study area in which the user can specify the locations and types of boundary conditions that apply as well as identifying regions for either mesh refinement or for assignment of values at run time.  Figure 1 shows an example of a geometry generated by pmesh.
     314To help with these tasks, a tool called pmesh has been developed which allows the user to set up the geometry of the problem interactively.  Pmesh produces a triangular mesh of the study area in which the user can specify the locations and types of boundary conditions that apply as well as identifying regions for either mesh refinement or for assignment of values at run time.  Figure \ref{fig:anuga mesh} shows an example of
     315a geometry generated by pmesh.
     316
     317
     318
     319\begin{figure}
     320\begin{center}
     321\includegraphics[width=5.0cm,keepaspectratio=true]{tsunami-fig-1}
     322\caption{Triangular mesh used in our finite volume method. Conserved
     323quantities $h$, $uh$ and $vh$ are associated with the centroid of
     324each triangular cell.} \label{fig:anuga mesh}
     325\end{center}
     326\end{figure}
    315327
    316328 
    317 Figure 1 Mesh generated by pmesh for a reservoir simulation.
     329%Figure 1 Mesh generated by pmesh for a reservoir simulation.
    318330
    319331When the model is run, the mesh is converted into a domain object which represents the study area, the mesh, quantities, boundaries and forcing terms together with methods for time stepping, flux calculations, and all other numerical operations pertinent to the model.
     332
    320333
    321334The (conserved) quantities updated by the numerical scheme are stage (water level) and horizontal momentum while bed elevation and friction are quantities that are not updated.  Setting initial values for quantities is done through the method
    322335domain.set_quantity(name, X, location, region)
    323336where name is the name of the quantity (e.g. 'stage', 'xmomentum', 'ymomentum', 'elevation' or 'friction').  The variable X represents the source data for populating the quantity and may take one of the following forms:
    324 "       A constant value as in domain.set_quantity('stage', 1) which will set the initial water level to 1 m everywhere.
    325 "       Another quantity or a linear combination of quantities.  If q1 and q2 are two arbitrary quantities defined within the same domain, the expression set_quantity('stage', q1*(3*q2 + 5)) will set the stage quantity accordingly.  One common application of this would be to assign the stage as a constant depth above the bed elevation.
    326 "       An arbitrary function (or a callable object), f(x, y), where x and y are assumed to be vectors.  The quantity will take values for f at each location within the mesh.
    327 "       An arbitrary set of points and associated values (wrapped into a point_set object).  The points need not coincide with triangle vertices or centroids and a penalised least squares technique is employed to populate the quantity in a smooth and stable way.
    328 "       A filename containing points and attributes.
    329 "       A Numerical Python array (or a list of numbers) ordered according to the internal data structure.
     337
     338\begin{itemize}
     339
     340\item A constant value as in domain.set_quantity('stage', 1) which will set the initial water level to 1 m everywhere.
     341\item Another quantity or a linear combination of quantities.  If q1 and q2 are two arbitrary quantities defined within the same domain, the expression set_quantity('stage', q1*(3*q2 + 5)) will set the stage quantity accordingly.  One common application of this would be to assign the stage as a constant depth above the bed elevation.
     342\item An arbitrary function (or a callable object), f(x, y), where x and y are assumed to be vectors.  The quantity will take values for f at each location within the mesh.
     343\item An arbitrary set of points and associated values (wrapped into a point_set object).  The points need not coincide with triangle vertices or centroids and a penalised least squares technique is employed to populate the quantity in a smooth and stable way.
     344\item A filename containing points and attributes.
     345\item A Numerical Python array (or a list of numbers) ordered according to the internal data structure.
     346\end{itemize}
     347
     348
    330349The parameter location determines whether the values should be assigned to triangle edge midpoints or vertices and region allows the operation to be restricted to a region specified by a symbolic tag or a set of indices.
    331350
     
    342361The parameter duration specifies the time period over which evolve operates, and control is passed to the body of the for-loop at each fixed yieldstep.  The internal time stepping is thus decoupled from the overall time stepping so that outputs may be stored, displayed or interrogated.  The evolve method has been implemented using a Python generator.
    343362
    344 Figure 2 shows a simulation of water flowing through a hypothetical breach in a levee, down onto a flat surface and past an obstacle.  A number of complex patterns are captured in this example including a shock where water reflected off the wall far (at the right hand side) meets the main flow. Other physical features are the standing waves and interference patterns.
     363Figure \ref{fig:beach runup} shows a simulation of water flowing onto a
     364hypothetical beach with obstacles. 
     365A number of complex patterns are captured in this example including a shock where water reflected off the wall far (at the right hand side) meets the main flow. Other physical features are the standing waves and interference patterns.
     366
     367
     368\begin{figure}
     369\begin{center}
     370\includegraphics[width=5.0cm,keepaspectratio=true]{tsunami-fig-2}
     371\caption{A hypothetical runup scenario.}
     372\label{fig:beach runup}
     373\end{center}
     374\end{figure}
    345375
    346376 
    347 Figure 2  Simulation of a levee breach.
     377%Figure 2  Simulation of a levee breach.
    348378
    349379Most of the components of AnuGA are written in Python, an object-oriented programming language known for its clarity, elegance, efficiency and reliability.  It is often said that "Python lets you focus on the problem at hand".  This means that it is possible to develop complex pieces of software without undue distractions in dealing with idiosyncrasies of the software language syntax.  Consequently, software written in Python can be produced quickly and can be readily adapted to changing requirements throughout its lifetime.
Note: See TracChangeset for help on using the changeset viewer.