Changeset 4123
 Timestamp:
 Dec 28, 2006, 1:44:48 PM (17 years ago)
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

anuga_core/documentation/user_manual/anuga_user_manual.tex
r4101 r4123 106 106 governing equation using a finitevolume method. 107 107 108 \anuga also incorporates a mesh generator, called \code{pmesh}, that 108 \anuga also incorporates a mesh generator %, called \code{pmesh}, 109 that 109 110 allows the user to set up the geometry of the problem interactively as 110 111 well as tools for interpolation and surface fitting, and a number of … … 180 181 terrains in the model are represented by predefined forcing terms. 181 182 182 A mesh generator, called pmesh, allows the user to set up the geometry 183 The builtin mesh generator %, called pmesh, 184 allows the user to set up the geometry 183 185 of the problem interactively and to identify boundary segments and 184 186 regions using symbolic tags. These tags may then be used to set the 185 187 actual boundary conditions and attributes for different regions 186 (e.g. the Manning friction coefficient) for each simulation.188 (e.g.\ the Manning friction coefficient) for each simulation. 187 189 188 190 Most \anuga components are written in the objectoriented programming 
anuga_work/publications/linuxconf_2006/database1.bib
r4121 r4123 72 72 pages = {839855}, 73 73 } 74 75 76 @ARTICLE{Nielsen2006, 77 author = {Ole Nielsen, Jane Sexton, Duncan Gray and Nick Bartzis}, 78 year = 2006, 79 title = {Modelling answers tsunami questions}, 80 journal = {AusGeo News}, 81 month = {September}, 82 year = {2006}, 83 number = 83, 84 note = {\url{http://www.ga.gov.au/ausgeonews/ausgeonews200609/modelling.jsp} 85 } 86 87 74 88 @ARTICLE{Rob99l, 75 89 author = {C. Zoppou and S. Roberts}, 
anuga_work/publications/linuxconf_2006/paper_ole_nielsen.tex
r4121 r4123 32 32 \and 33 33 S.~G.~Roberts\thanks{Dept. of Maths, Australian National University, 34 Canberra, \textsc{Australia}. \protect\url{mailto:stephen.roberts }}}34 Canberra, \textsc{Australia}. \protect\url{mailto:stephen.roberts@anu.edu.au}}} 35 35 36 36 \date{30 December 2006} … … 73 73 for solving the conservative form of the Shallow Water Wave equation. 74 74 In this paper we describe the model, the architecture and some applications. 75 ANUGA has recently been released as Open Source available at 76 \url{http://sourceforge.net/projects/anuga}. This strategy will enable 77 free access to the software and allow the risk research community to 75 ANUGA has recently been released as Open Source. This strategy will enable 76 free access to the software and allow the scientific community to 78 77 use, validate and contribute to the software in the future. 79 78 … … 108 107 \label{sec:intro} 109 108 110 %Floods are the single greatest cause of death due to natural hazards 111 %in Australia, causing almost 40{\%} of the fatalities recorded 112 %between 1788 and 2003~\cite{Blong2005}. Analysis of buildings 113 %damaged between 1900 and 2003 suggests that 93.6{\%} of damage is 114 %the result of meteorological hazards, of which almost 25{\%} is 115 %directly attributable to flooding~\cite{Blong2005}. 116 117 Flooding of coastal communities may result from surges of nearshore 118 waters caused by severe storms. The extent of inundation is 119 critically linked to tidal conditions, bathymetry and topography; as 120 recently exemplified in the United States by Hurricane Katrina. 121 While the scale of the impact from such events is not common, the 109 The Indian Ocean tsunami on 26 December 2004 demonstrated the 110 potentially catastrophic consequences of natural hazards. While the 111 scale of the impact from such events is not common, smallerscale 112 tsunami regularly threaten coastal communities 113 around the world. Earthquakes which occur in the Java Trench near 114 Indonesia (e.g.~\cite{TsuMIS1995} or \cite{Baldwin2006}) and along 115 the Puysegur Ridge to the south of New Zealand (e.g.~\cite{LebKC1998}) 116 have potential to generate tsunami that may threaten Australia's 117 northwestern and southeastern coastlines. In addition, the 122 118 preferential development of Australian coastal corridors means that 123 stormsurge inundation of even a few hundred metres beyond the 124 shoreline has increased potential to cause significant disruption 125 and loss. 126 127 Coastal communities also face the small but real risk of tsunami. 128 Fortunately, catastrophic tsunami of the scale of the 26 December 129 2004 event are exceedingly rare. However, smallerscale tsunami are 130 more common and regularly threaten coastal communities around the 131 world. Earthquakes which occur in the Java Trench near Indonesia 132 (e.g.~\cite{TsuMIS1995} or \cite{Baldwin2006}) 133 and along the Puysegur Ridge to the south 134 of New Zealand (e.g.~\cite{LebKC1998}) have potential to generate 135 tsunami that may threaten Australia's northwestern and southeastern 136 coastlines. 137 138 Hydrodynamic modelling allows flooding, stormsurge and tsunami 139 hazards to be better understood, their impacts to be anticipated 140 and, with appropriate planning, their effects to be mitigated. 141 Geoscience Australia in collaboration with the Mathematical Sciences 142 Institute, Australian National University, is developing a software 143 application called \AnuGA{} to model the hydrodynamics of floods, 144 storm surges and tsunami. These hazards are modelled using the 145 conservative shallow water equations which are described in 146 section~\ref{sec:model}. In \AnuGA{} these equations are solved 147 using a finite volume method as described in section~\ref{sec:fvm}. 148 A more complete discussion of the method can be found in 149 \cite{modsim2005} where the model and solution technique is 150 validated on a standard tsunami benchmark data set. 151 152 In this paper we will provide a description of the parallelisation 153 of the code using a domain decomposition strategy and provide the 154 preliminary timing results which verify the scalability of the 155 parallel code. 156 119 inundation from hydrological disasters such as tsunami or stormsurge 120 of even a few hundred metres beyond the shoreline has increased 121 potential to cause significant disruption and loss. The extent of 122 inundation is critically linked to the event, tidal conditions, 123 bathymetry and topography and it not feasible to make impact 124 predictions using heuristics alone. 125 126 Hydrodynamic modelling allows impacts from flooding, stormsurge and 127 tsunami to be better understood, their impacts to be anticipated and, 128 with appropriate planning, their effects to be mitigated. Geoscience 129 Australia in collaboration with the Mathematical Sciences Institute, 130 Australian National University, is developing a software application 131 called \AnuGA{} to model the hydrodynamics of floods, storm surges and 132 tsunami. These hazards are modelled using the conservative shallow 133 water equations which are described in section~\ref{sec:model}. In 134 \AnuGA{} these equations are solved using a finite volume method as 135 described in section~\ref{sec:fvm}. A more complete discussion of the 136 method can be found in \cite{modsim2005} where the model and solution 137 technique is validated on a standard tsunami benchmark data set. 138 Section~\ref{sec:software} describes the software implementation and 139 the API while section~\ref{sec:validation} presents testing and 140 validation results. 157 141 158 142 … … 302 286 \end{figure} 303 287 304 305 306 307 308 288 In the computations presented in this paper we use an explicit Euler 309 289 time stepping method with variable timestepping adapted to the 310 290 observed CFL condition. 311 291 292 312 293 \section{Software Implementation} 313 294 314 To 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. 315 316 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 \ref{fig:anuga mesh} shows an example of 317 a geometry generated by pmesh. 318 319 295 \AnuGA{} is mostly written in the objectoriented programming 296 language \Python{} with computationally intensive parts implemented 297 as highly optimised shared objects written in C. 298 299 \Python{} is known for its clarity, elegance, efficiency and 300 reliability. Complex software can be built in \Python{} without undue 301 distractions arising from idiosyncrasies of the underlying software 302 language syntax. In addition, \Python{}'s automatic memory management, 303 dynamic typing, object model and vast number of libraries means that 304 software can be produced quickly and can be readily adapted to 305 changing requirements throughout its lifetime. 306 307 The fundamental object in \AnuGA{} is the \code{Domain} which 308 inherits functionality from a hierarchy of increasingly specialised 309 classes starting with a basic structural Mesh to classes implementing 310 the finitevolume scheme described in section \ref{sec:fvm}. Other classes 311 are \code{Quantity} which represents values of one variable across the mesh 312 along with their associated operations, \code{Geospatial_data} which 313 represents georeferenced elevation data and a collection of \code{Boundary} 314 classes which allows for a 'pluggable' way of driving the model. 315 The conserved quantities updated automatically by the numerical scheme 316 are \code{stage} (water level) $w$, \code{xmomentum} $uh$ and \code{ymomentum} 317 $vh$. The quanitites \code{elevation} $z$ and \code{friction} $\eta$ are 318 quantities that are not updated automaticall but can be changed explicitly 319 if the user wishes to. 320 321 To set up a scenario the user specifies the study area along with any internal 322 regions where increased mesh resolution is required. External edges may 323 be labelled using symbolic tags which are subsequently used to bind 324 boundary condition objects to tagged segments of the boundary. 325 326 Figure \ref{fig:anuga mesh} shows an example of a mesh generated by \AnuGA{}. 320 327 321 328 \begin{figure} … … 323 330 \includegraphics[width=5.0cm,keepaspectratio=true]{tsunamifig1} 324 331 \caption{Triangular mesh used in our finite volume method. Conserved 325 quantities $h$, $uh$ and $vh$ are associated with the centroid of326 each triangular cell.}\label{fig:anuga mesh}332 quantities $h$, $uh$ and $vh$ are associated with each triangular cell.} 333 \label{fig:anuga mesh} 327 334 \end{center} 328 335 \end{figure} 329 336 330 331 %Figure 1 Mesh generated by pmesh for a reservoir simulation. 332 333 When 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. 334 335 336 The (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 337 domain.set_quantity(name, X, location, region) 338 where 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: 337 The mesh is then generated using \AnuGA{}'s builtin mesh generator and 338 converted into the \code{Domain} object which provides all methods used to 339 setup and run the flow simulation. 340 341 Next step is to setup initial conditions for each Quantity object. For 342 the elevation $z$ this is typically obtained from bathymetric and 343 topographic data sets. Setting initial values for quantities is done 344 through the method \code{domain.set_quantity(name, X, location, 345 region)} where name is the name of the quantity (e.g.\ 'stage', 346 'xmomentum', 'ymomentum', 'elevation' or 'friction'). The variable X 347 represents the source data for populating the quantity and may take 348 one of the following forms: 339 349 340 350 \begin{itemize} 341 342 \item A constant value as in domain.set_quantity('stage', 1) which will set the initial water level to 1 m everywhere. 343 \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. 344 \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. 345 \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. 351 \item A constant value as in domain.set_quantity('stage', 1) which 352 will set the initial water level to 1 m everywhere. 353 \item Another quantity or a linear combination of quantities. If q1 354 and q2 are two arbitrary quantities defined within the same domain, 355 the expression set_quantity('stage', q1*(3*q2 + 5)) will set the stage 356 quantity accordingly. One common application of this would be to 357 assign the stage as a constant depth above the bed elevation. 358 \item An arbitrary function (or a callable object), f(x, y), where x 359 and y are assumed to be vectors. The quantity will be assigned values by 360 evaluating f at each location within the mesh. 361 \item An arbitrary set of points and associated values (wrapped into a 362 Geospatial_data object). The points need not coincide with triangle 363 vertices or centroids and a penalised least squares technique is 364 employed to populate the quantity in a smooth and stable way. 346 365 \item A filename containing points and attributes. 347 \item A Numerical Python array (or a list of numbers) ordered according to the internal data structure. 366 \item A Numerical Python array (or a list of numbers) ordered 367 according to the internal data structure. 348 368 \end{itemize} 349 369 350 370 351 The 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. 352 353 Since the least squares technique can be time consuming for large problems, set_quantity employs a caching technique which automatically decides whether to perform the computations or retrieve them from a cache. This will typically speed up the build by several orders of magnitude after each computation has been performed once. 354 355 Boundary conditions are bound to symbolic tags through the method domain.set_boundary which takes as input a lookup table (implemented as a Python dictionary) of the form {tag: boundary_object}. The boundary objects are all assumed to be callable functions of vectors x and y. Several predefined standard boundary objects are available and it is relatively straightforward to define problemspecific custom boundaries if needed. The predefined boundary conditions include Dirichlet, Reflective, Transmissive, Temporal, and SpatioTemporal boundaries. 356 357 Forcing terms can be written according to a fixed protocol and added to the model using the idiom domain.forcing_terms.append(F) where F is assumed to be a userdefined callable object. 358 359 When the simulation is running, the length of each time step is determined from the maximal speeds encountered and the sizes of triangles in order not to violate the CFL condition which specifies that no information should skip any triangles in one time step. With large speeds and small triangles, time steps can become very small. In order to access the state of the simulation at regular time intervals, AnuGA uses the method evolve: 360 For t in domain.evolve(yieldstep, duration): 361 <do whatever> 362 363 The parameter duration specifies the time period over which evolve operates, and control is passed to the body of the forloop 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. 371 The parameter location determines whether the values should be 372 assigned to triangle edge midpoints or vertices and region allows the 373 operation to be restricted to a region specified by a symbolic tag or 374 a set of indices. 375 376 Since the least squares technique can be time consuming for large 377 problems, \code{set_quantity} employs a caching technique which automatically 378 decides whether to perform the computations or retrieve them from a 379 cache. This will typically speed up the build by several orders of 380 magnitude after each computation has been performed once. 381 382 Boundary conditions are bound to symbolic tags through the method 383 \code{domain.set_boundary} which takes as input a lookup table (implemented 384 as a Python dictionary) of the form \code{\{tag: boundary_object\}}. 385 The boundary objects are all assumed to be callable functions of vectors x 386 and y. Several predefined standard boundary objects are available and 387 it is relatively straightforward to define problemspecific custom 388 boundaries if needed. The predefined boundary conditions include 389 Dirichlet, Reflective, Transmissive, Temporal, and SpatioTemporal 390 boundaries. 391 392 Forcing terms can be written according to a fixed protocol and added 393 to the model using the idiom \code{domain.forcing_terms.append(F)} where F is 394 assumed to be a userdefined callable object. 395 396 When the simulation is running, the length of each time step is 397 determined from the maximal speeds encountered and the sizes of 398 triangles in order not to violate the CFL condition which specifies 399 that no information should skip any triangles in one time step. With 400 large speeds and small triangles, time steps can become very small. 401 In order to access the state of the simulation at regular time 402 intervals, \AnuGA{} uses the method evolve: 403 404 \begin{verbatim} 405 For t in domain.evolve(yieldstep, duration): 406 <do whatever> 407 \end{verbatim} 408 409 The parameter \code{duration} specifies the time period over which 410 evolve operates, and control is passed to the body of the forloop at 411 each fixed time step called \code{yieldstep}. The internal workings 412 of the numerical scheme and its variable time stepping are thus 413 decoupled from the fixed time stepping of the evolve loop. This means 414 that the user of the API may access the model at fixed timesteps to 415 e.g.\ store model outputs, interrogate quantities or change the model 416 itself at runtime. The evolve method has been implemented using a 417 Python generator hence the reference to 'yield' in the parameter. 364 418 365 419 Figure \ref{fig:beach runup} shows a simulation of water flowing onto a … … 375 429 \end{center} 376 430 \end{figure} 377 378 379 %Figure 2 Simulation of a levee breach.380 381 Most of the components of AnuGA are written in Python, an objectoriented 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.382 383 384 385 386 387 388 431 389 432 … … 446 489 447 490 448 449 \section{Parallel Implementation}\label{sec:parallel}450 451 To parallelize our algorithm we use a simple domain decomposition452 strategy. We suppose we have a global mesh which defines the domain453 of our problem. We must first subdivide the global mesh into a set454 of nonoverlapping submeshes. This partitioning is done using the455 \Metis{} partitioning library. We will demonstrate the efficiency of456 this library in the following subsections. Once this partitioning457 has been done, and the proper communication patterns set, we can458 start to evolve our solution. Each timestep consists of459 independently and then communicate the appropriate ``ghost'' cell460 information once each timestep.461 462 %\begin{figure}[hbtp]463 % \centerline{ \includegraphics[scale = 0.6]{domain.eps}}464 % \caption{The first step of the parallel algorithm is to divide465 % the mesh over the processors.}466 % \label{fig:subpart}467 %\end{figure}468 469 470 471 \begin{figure}[h!]472 \centerline{ \includegraphics[width=6.5cm]{mermesh.eps}}473 \caption{The global Merimbula mesh}474 \label{fig:mergrid}475 \end{figure}476 477 \begin{figure}[h!]478 \centerline{ \includegraphics[width=6.5cm]{mermesh4c.eps}479 \includegraphics[width=6.5cm]{mermesh4a.eps}}480 481 \centerline{ \includegraphics[width=6.5cm]{mermesh4d.eps}482 \includegraphics[width=6.5cm]{mermesh4b.eps}}483 \caption{The global Merimbula mesh partitioned into 4 submeshes using \Metis.}484 \label{fig:mergrid4}485 \end{figure}486 487 488 489 490 \begin{table}[h!]491 \caption{4way and 8way partition tests of Merimbula mesh showing492 the percentage distribution of cells between the493 submeshes.}\label{tbl:mer}494 \begin{center}495 \begin{tabular}{cc c c c}496 \hline497 CPU & 0 & 1 & 2 & 3\\498 \hline499 Cells & 2757 & 2713 & 2761 & 2554\\500 \% & 25.6\% & 25.2\% & 25.6\% & 23.7\%\ \\501 \hline502 \end{tabular}503 504 \medskip505 506 \begin{tabular}{cc c c c c c c c}507 \hline508 CPU & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\509 \hline510 Cells & 1229 & 1293 & 1352 & 1341 & 1349 & 1401 & 1413 & 1407\\511 \% & 11.4\% & 12.0\% & 12.5\% & 12.4\% & 12.5\% & 13.0\% & 13.1\% & 13.1\%\\512 \hline513 \end{tabular}514 \end{center}515 \end{table}516 517 518 491 \section{Conclusions} 519 \label{sec:6} \AnuGA{} is a flexible and robust modelling system 492 \label{sec:6} 493 \AnuGA{} is a flexible and robust modelling system 520 494 that simulates hydrodynamics by solving the shallow water wave 521 495 equation in a triangular mesh. It can model the process of wetting … … 525 499 526 500 \AnuGA{} can take as input bathymetric and topographic datasets and 527 simulate the behaviour of riverine flooding, storm surge and 528 tsunami. Initial validation using wave tank data supports AnuGA's 501 simulate the behaviour of riverine flooding, storm surge, 502 tsunami or even dam breaks. 503 Initial validation using wave tank data supports \AnuGA{}'s 529 504 ability to model complex scenarios. Further validation will be 530 505 pursued as additional datasets become available. … … 534 509 Geoscience Australia's ongoing research effort to model and 535 510 understand the potential impact from natural hazards in order to 536 reduce their impact on Australian communities. 537 538 539 %\paragraph{Acknowledgements:} 540 %The authors are grateful to Belinda Barnes, National Centre for 541 %Epidemiology and Population Health, Australian National University, 542 %and Matt Hayne and Augusto Sanabria, Risk Research Group, Geoscience 543 %Australia, for helpful reviews of a previous version of this paper. 544 %Author Nielsen publish with the permission of the CEO, Geoscience 545 %Australia. 546 547 % Preferably provide your bibliography as a separate .bbl file. 548 % Include URLs, DOIs, Math Review numbers or Zentralblatt numbers in your bibliography 549 % so we help connect the web of science and ensure maximum visibility 550 % for your article. 511 reduce their impact on Australian communities (see \cite{Nielsen2006}). 512 513 The \AnuGA{} source code is available 514 at \url{http://sourceforge.net/projects/anuga}. 515 551 516 \bibliographystyle{plain} 552 517 \bibliography{database1}
Note: See TracChangeset
for help on using the changeset viewer.