Recharge Estimation by Daily Precipitation with MODFLOW UZF and Python

The processes of the superficial and groundwater water cycle are related to the precipitation (shape and intensity) and the dynamic of soil moisture. This dynamic of soil moisture is determined by the type of soil and the root zone in a daily, or even hourly, temporal scale. These phenomena have not been considered or studied in conventional hydrogeology text books, maybe because of their intensive use of modeling tools and complex conceptualizations and validations.

The study of groundwater is the study of uncertainty. It’s the dilemma of not seeing what you’re studying, and understanding a whole just by particular observations in piezometers or base flow. Until some develops new tools that would let us see groundwater inside the porous media in the same way we see a magnetic resonance, we will have to make strong analytic efforts to understand the subterranean water resource.


The time scale is daily

While talking to other hydrologists, hydrogeologists and even biologists, we see that the understanding of the water cycle is partial, based in that each one of us has learned academically or in practice. So, there are certain trends like:

  • Hydrological modeling not considering base flow
  • Hydrogeological modeling with constant recharge
  • Estimation of wetlands not considering groundwater
  • Hydrological modeling at monthly scale

As you can see, the examples are part of our professional practice, but it’s not a reflex of the understanding of the nature dynamics, in what we can understand for what we measure or the tools we have.

Understanding the recharge phenomenon implies the study of the cover, of the root zone in a spatial and temporal discretization limited by computational and software aspects, but refined enough to represent the fluxes in the different parts of the interaction surface-soil-aquifer.

To comprehend the recharge processes it’s necessary to use a very small temporal discretization, where we could even think about an hourly scale, or a daily scale in long simulations like this tutorial.


The wetting front

The evapotranspiration is the main consumer of precipitation water, being able to reach a 60% of the precipitation water in Andean basins with precipitations of 1100 mm/year.

This consumption happens in the soil zone where effective precipitation water percolates through the root zone, where these roots absorb it for plant’s consumption. If the precipitation water is higher than what the soil can absorb, runoff will be generated; when roots can’t absorb the water infiltration, the excess will percolate to the water table producing recharge to the aquifer.

Soil wetting fronts for a regional groundwater model. Source: MODFLOW UZF Documentation (

Soil wetting fronts for a regional groundwater model. Source: MODFLOW UZF Documentation (


In this example we have calculated the wetting fronts in a daily scale. The animation shows the saturation processes of the soil and the wetting front. In the middle of the simulation the precipitation decreases and, consequently, the soil saturation. Finally, during the dry time it is seen the loss of soil humidity and its effect on the saturation curve.

Soil humidity profile for this study. Model made with MODFLOW UZF

Soil humidity profile for this study. Model made with MODFLOW UZF


Case study

To explain in a clear manner the concepts exposed, we have developed a case study with MODFLOW and the UZF (Unsaturated Zone Flow) package. The processing tool used is Model Muse which is developed by, as well as MODFLOW, by the United States Geological Survey (USGS). To visualize the saturation profile we have used a Python script and the Jupyter application. All software used in this tutorial is free access.

The MODFLOW model has 2 layers with a total of 18 cells. The width of the cells is 10m and has been modeled during one year on a daily scale.

Here you can find the video of the tutorial:


Modeling data

Download the data here.

Saul Montoya

Saul Montoya es Ingeniero Civil graduado de la Pontificia Universidad Católica del Perú en Lima con estudios de postgrado en Manejo e Ingeniería de Recursos Hídricos (Programa WAREM) de la Universidad de Stuttgart con mención en Ingeniería de Aguas Subterráneas y Hidroinformática.

Smiley face

Subscribe to our free e-newsletter for tutorials, articles, webminars, courses and more.