Graphical user interfaces (GUIs) are commonly used to construct and postprocess numerical groundwater flow and transport models. Scripting model development with the programming language Python is presented here as an alternative approach. One advantage of Python is that there are many packages available to facilitate the model development process, including packages for plotting, array manipulation, optimization, and data analysis. For MODFLOW‐based models, the FloPy package was developed by the authors to construct model input files, run the model, and read and plot simulation results. Use of Python with the available scientific packages and FloPy facilitates data exploration, alternative model evaluations, and model analyses that can be difficult to perform with GUIs. Furthermore, Python scripts are a complete, transparent, and repeatable record of the modeling process. The approach is introduced with a simple FloPy example to create and postprocess a MODFLOW model. A more complicated capture‐fraction analysis with a real‐world model is presented to demonstrate the types of analyses that can be performed using Python and FloPy.
1 October 2013 in Environmental Modelling & Software
The effect of preferential flow on the stability of landslides is studied through numerical simulation of two types of rainfall events on a hypothetical hillslope. A model is developed that consists of two parts. The first part is a model for combined saturated/unsaturated subsurface flow and is used to compute the spatial and temporal water pressure response to rainfall. Preferential flow is simulated with a dual-permeability continuum model consisting of a matrix domain coupled to a preferential flow domain. The second part is a soil mechanics model and is used to compute the spatial and temporal distribution of the local factor of safety based on the water pressure distribution computed with the subsurface flow model. Two types of rainfall events were considered: long-duration, low-intensity rainfall, and short-duration, high-intensity rainfall. The effect of preferential flow on slope stability is assessed through comparison of the failure area when subsurface flow is simulated with the dual-permeability model as compared to a single-permeability model (no preferential flow). For the low-intensity rainfall case, preferential flow has a positive effect on drainage of the hillslope resulting in a smaller failure area. For the high-intensity rainfall case, preferential flow has a negative effect on the slope stability as the majority of rainfall infiltrates into the preferential flow domain when rainfall intensity exceeds the infiltration capacity of the matrix domain, resulting in larger water pressure and a larger failure area.
Time series analysis is an increasingly popular method to analyze heads measured in an observation well. Common applications include the quantification of the effect of different stresses (rainfall, pumping, etc.), and the detection of trends and outliers. Pastas is a new and open source Python package for the analysis of hydrogeological time series. The objective of Pastas is twofold: to provide a scientific framework to develop and test new methods, and to provide a reliable ready‐to‐use software tool for groundwater practitioners. Transfer function noise modeling is applied using predefined response functions. For example, the head response to rainfall is simulated through the convolution of measured rainfall with a Gamma response function. Pastas models are created and analyzed through scripts, ensuring reproducibility and providing a transparent report of the entire modeling process. A Pastas model can be constructed in seven simple steps: import Pastas, read the time series, create a model, specify the stresses and the types of response functions, estimate the model parameters, visualize output, and analyze the results. These seven steps, including the corresponding Python code, are applied to investigate how rainfall and reference evaporation can explain measured heads in an observation well in Kingstown, Rhode Island, USA. The second example demonstrates the use of scripts to analyze a large number of observation wells in batch to estimate the extent of the drawdown caused by a well field in the Netherlands. Pastas is free and open source software available under the MIT‐license at http://github.com/pastas/pastas.