1 Introduction

Regulations such as the EU Water Framework Directive (the operational tool which set the objectives for water protection and implements the European water policies; [1]) enforce monitoring requirements of water bodies increasing the number of water-related datasets. The information content of such data is often not yet properly exploited, mainly because of very simple algorithms commonly adopted for their analysis. The availability of Information and Communication Technology (ICT) tools performing spatially and temporally based analysis can greatly help to better exploit the information content of such data and to get a better insight on water bodies’ behavior and dynamics. This would likely translate into a more efficient water management and thus into a better implementation of water regulations.

The project FREEWAT (FREE and open source tools for WATer resource management; [2, 3]) fosters the adoption of water related regulations by taking full advantage of collected data and their usage in analyses for producing scientifically and technically sounding decisions and policies. The project strategy relies on developing innovative data analysis tools integrated in a Geographical Information System (GIS) to facilitate spatial and temporal data analysis. The FREEWAT platform is then a public domain GIS integrated modelling platform that embeds data analyses tools, and integrates water management and planning modules for the assessment of conjunctive use of surface- and ground-water. The FREEWAT platform has been released with a Free and Open Source Software license (GPL v2) in order to guarantee its sustainability (no license fees and open community), its scientific excellence (rights to study and modify the source) and the capitalization of previous efforts (utilization of existing high-quality open source modules). Within the FREEWAT project, the analyses are run using a participatory approach at 14 case studies to demonstrate the platform relevance in the production of shared and evidence-based decision making in Water Resource Management (WRM).

As one of the institutions in the FREEWAT Consortium, the Institute of Earth Sciences (University of Applied Science and Arts of the Southern Switzerland, IST-SUPSI) participated in the development of the FREEWAT platform and to its testing in a case study addressing lake/groundwater interactions. Due to its case study specificity, along with general contributions, the IST-SUPSI developed a tool for data preprocessing and integration and implemented a module that integrates a modelling package to simulate lake/groundwater dynamic interactions [4].

The objective of the presented work is to demonstrate the FREEWAT approach by its application to the Lugano Lake case study. This makes specifically use of the time-series processing and the groundwater modelling capabilities in a situation where groundwater-lake interactions are relevant.

Section 2 presents the methodology proposed by the FREEWAT project in order to address these challenges and to meet its overarching objectives. In Sect. 3 the results of its application to the Lugano Lake case study are described, and finally discussed in Sect. 4.

2 Methodology

2.1 The FREEWAT platform and the development strategy

From a software point of view, the FREEWAT platform is a complex plugin for the geospatial open source software QGIS [5]; it takes advantage of SpatiaLite [6] as a geodatabase management system and FloPy [7] as reference Python library to connect with hydrological codes, particularly MODFLOW-2005 [8] and related programs. As these are the main simulation codes integrated, the FREEWAT platform, to date, is mostly applicable to groundwater resource management and aquifer contamination issues. The general motivation for the selected codes relies on the fact that all of them are released under compatible free and open source licenses: a key strategy adopted by the project in making the outcomes sustainable and easily adopted. Specifically, QGIS has been selected as the GIS platform to integrate hydrological tools due to its very large diffusion and excellent quality;Footnote 1 SpatiaLite, a file based database, has been preferred to other more traditional spatial databases due to its ability to be embedded inside the application that makes use of it, and therefore providing a perfect solution for model sharing. MODFLOW (USGS’s modular groundwater model) and related programs have been chosen as principal modelling codes since they are internationally recognized as standard for simulating groundwater conditions and their interaction with surface-water. FloPy selection is a consequence of the chosen modelling codes. In fact, it is a specialized Python library specifically designed to develop, run, and post-process models that are part of the MODFLOW family of codes.

The FREEWAT platform includes five major interconnected modules dedicated to: (1) observation processing and management; (2) groundwater flow simulation and interactions with surface-water; (3) solute transport simulation in aquifers and water quality data analysis tools; (4) rural water management; (5) calibration, sensitivity analysis and parameter estimation. In its implementation the project followed the approach of interconnecting training activities and development to reach the goals of increasing the number of users and experts, while increasing the number of testers and feedbacks. As illustrated in Fig. 1, after a first phase of coding, a beta version, along with documentation and tutorials, was released. Then, an intense program of training, named Training the trainers, was given by the core developers at each partner premises. This allowed to collect a large number of feedback and to cope with existing bugs leading to the next development versions (beta to v0.1, to v0.5). These versions where finally used by the project partners in conducting local courses and implementing case studies. Both, case studies and local courses (followed by more than 1000 individuals), were useful to collect requests and bugs that ultimately lead to the first stable release (v1.0).

Fig. 1
figure 1

FREEWAT platform development approach: from beta version to stable release

2.2 Data integration module

Any tool, and more specifically any hydrologic or groundwater model, built for providing WRM with relevant information, requires quantitative data which defines the physical properties of the study area and describes its temporal evolution. Identifying data needs, as well as collecting data is an essential part of any WRM related task. According to Refsgaard et al. [9], there is a need for seamlessly integration of monitoring and modelling tasks to reduce working time and errors. For this reason, the capacity of a modelling platform to retrieve, analyze and use monitoring data is an essential feature that is often missing in existing software.

In modelling practice, time-series pre-processing is executed taking advantage of independent tools with statistical capabilities like Microsoft Excel, Matlab [10] and R [11] or, when the modeler has programming capability, making use of specific libraries in different coding languages like PANDAS [12] for Python or ROOT (https://root.cern.ch/) for C ++. A popular time series analyses tool supporting calibration of hydrological models is TSPROC (Time Series PROCessor; [13]), which is a simple scripting language including features often used with surface-water models.

Despite this availability of tools, Billah et al. [14] recognized as a major challenge for data and modelling integration the lack of common file structures and semantics. This challenge has been addressed in the current work by taking inspiration from the Sensor Observation Service open standard (SOS) [15], which defines data models to represent and exchange observations derived by sensor measures. In the context of groundwater modelling, time-series data can be climate observations such as rainfall and temperature, boundary conditions represented by means of surface water stages or discharge measurements, or pumping and irrigation rates among others. Raw digital time-series data, generally collected from monitoring networks, meteorological services or environmental authorities, are always subject to pre-processing. This is specific to the temporal discretization of the model, which in itself is subject to the goal of modelling, and the possible spatial relationship to the area of interest.

To facilitate this integration process, a module in the FREEWAT platform named Observation Analysis Tool (OAT) [16] was developed. OAT aims at simplifying the processing and manipulation of time-series data to ease its exploitation for water quality and quantity management. The idea is to achieve this goal specifically through: (1) the pre-processing of time-series data to drive the implementation and analysis of conceptual and numerical models for WRM, (2) the preparation of input data for numerical models, (3) the visualization and post-processing of model results that may support management decisions, (4) the capability of easily use time-series for calibration and sensitivity analysis (performed in FREEWAT through the inverse modelling code UCODE 2014 [17]).

OAT is built as Python library which is integrated in the FREEWAT platform trough specific user interfaces. From a dependency point of view, it takes advantage of the PANDAS, NUMPY and SCIPY [18] packages. The OAT library implements two main classes: the Sensor class that is designated to handle time-series data and metadata and the Method class designated to represent a processing method. The Sensor class took inspiration from the SOS and it’s istSOS implementation [19], with specific simplifications to ease its usage. A Sensor object is characterized by two components: a PANDAS time-series storing observations and a point feature with metadata. Every Sensor object can be stored in a SpatiaLite DB and re-loaded back with its own data and metadata. The “metadata component” includes name, description, location (lat, lon, elev), unit of measure, observed property, coordinate system, time-zone, frequency, weight statistic and data availability (time interval). The “data component” includes time, data, name, and quality index, as well as a tag marking whether or not an individual observation in the series will be used. In addition to requesting sensor data from an istSOS server, OAT can retrieve data stored in local files or databases into the FREEWAT platform for further use. Additional accepted input format may be implemented in the future. The general structure and implemented usage of the library in FREEWAT platform is depicted in Fig. 2.

Fig. 2
figure 2

The OAT data retrieval, processing, storage and export workflow

The library design follows the behavioral visitor pattern so that the output of the process function of the Sensor class depends on the specific visiting Method object: in this way the algorithms are implemented in Method ‘s child objects that are separated from the Sensor on which they operate. As a consequence, adding a new processing capability involves the implementation of a new Method child class only. Most of the currently available Method objects are based on TSPROC processing capabilities [13]. However, this library of processes is open and expandable to incorporate users’ needs, specifically as an aspect of the participatory approach adopted in FREEWAT project development.

2.3 Groundwater/lake interaction module

The need for understanding the interactions between a lake and an aquifer has been addressed in literature with different methods evolving from fixed lake stages to sophisticated dynamic models like the Lake Package (LAK) for MODFLOW [4]. This capability is particular important when the aquifer of interest is connected with a lake and the fluxes can vary depending on the relative stages of the water bodies influencing in example contaminant or nutrient exchanges. As the FREEWAT platform mainly uses the FloPy library to create model input files for MODFLOW, the implementation of the LAK consists mainly of an easy to use workflow and interface in order to include lakes in the model. The LAK allows for the simulation of hydraulic interaction between a lake and groundwater in the surrounding aquifer so that the effects of the changes in the conditions of one of the two water bodies are calculated on the other. The lake volume is calculated through the 2D horizontal extent of the cells identified as lake, as well as the vertical number of layers that contain lake cells.

In the FREEWAT-platform, the implementation of the LAK can be achieved through consequential steps (see Fig. 3). All model data objects corresponding to model layers need to be prepared according to MODFLOW specifications for the LAK. The vertical size of the lake cells, i.e., the thickness of the aquifer layers, can be changed to account for lake bathymetry. The selection and editing of appropriate cells is performed with existing QGIS tools, by querying and modifying the attribute tables of relevant model layers. The last step requires the activation of the “Create lake layer” interface to set lake solver properties, lake source and sink terms for each time step, as well as starting stages, minimum and maximum stages, as well as lake leakance terms. The supplementary time-variant values are input and output of the lake water budget that may take the form of: atmospheric recharge, evaporation, overland runoff following precipitation events, and direct withdrawal. Through this “Create lake layer” interface, the lake layers are created with a grid equal to that of the model layers. The created layers contain a lake ID attribute, which allows the cells to be assigned to one specific lake in each layer. Once lakes have been created, they can also be deleted through this interface, although the manipulation of the dataset is restricted to the created model tables to ease usability. After a successful termination of the MODFLOW simulation, the LAK estimates the hydrologic budget summaries for the lakes at each time step specified in the MODFLOW output control. Each lake budget includes stage, volume, volume change, precipitation, evaporation, runoff, inflow and outflow from groundwater and surface water, water use, influx from connected lakes, surface area, stage-change and percentage error, for each time step, printed into an output file.

Fig. 3
figure 3

Lake package implementation workflow

2.4 Participatory approach

The use of advanced ICT tools in WRM is often limited to well-trained practitioners and professionals, who develop the required analysis and then present the result of their work, rarely sharing with relevant stakeholders data and steps taken to reach the gathered conclusions. This approach, beside leading to results that may be easily rejected or questioned, particularly when findings shown the need of unpopular decisions [20], often diminishes the value of using advanced technologies in WRM. In this sense, the lack of participatory approach in using advanced ICT tools for evidence-based decisions constitutes a limit to the application of the water related regulations.

To overcome the purely technical approach in dealing with complex water related issues when a large variety of stakeholders is involved, we believe the participatory approach needs to be introduced. The participatory approach has been applied in several cases and described in several papers in literature [2123]. In fact, the non-technical aspects of water resource systems (such as societal, political and legal concerns) are recognized as having a great, if not fundamental, importance to reaching an agreed-upon decision. These are therefore to be integrated into the more technical and mathematical issues [24].

The FREEWAT project identified the participatory approach as one of the key factor to create consensus and agreement on analyses outputs. To this end, at each case study, a Focus Group (FG) including the relevant stakeholders was established. Local administrations, water utilities, researchers, environmental associations and geo-environmental companies, and private citizens took part to the FGs.

3 Results of the Lugano Lake case study

The FREEWAT platform was applied to the Lugano Lake case study, a transboundary water-body shared between Switzerland and Italy. In order to assess the groundwater- surface water interactions within the aquifers connected directly to the Lugano Lake, a groundwater model was built using the FREEWAT platform and its MODFLOW-2005 code and packages and OAT. The case study included frequent interactions with local stakeholders as well as experts from beyond the region. For the Lake Lugano case study, the FG participants included, in addition to the modeler institution (IST-SUPSI), private engineering companies, the administration in Ticino and Lombardy, the local water utility, environmental protection agencies, and members of the local hydrological division.

From the initial FG meetings, it was clear that the primary concern for all stakeholders was the water quality of the lake. The main issue is whether surface water could be better managed to reduce phosphorous load to the lake. As the FREEWAT-platform, in its current implementation mainly supports groundwater modelling, the question was reposed as determining whether contaminants could enter the lake through the groundwater in significant amounts and how this issue could be addressed. The interest was then in the development of a general model that may then be used for transport simulation of a variety of species (phosphorus, nitrogen, pesticides), for emergency response in the case of spills, as well as for defining of well-head protection areas. The rest of the discussion aimed at setting a common understanding of the study area and identifying the general available data. During FG meetings from 3 to 6, several challenges were encountered, discussed and overcome in a way that satisfied all relevant stakeholders. Among these we cite the limited data coming from geological investigations, as well as the lack of a hydrostratigraphic model. In fact, there had been no previous groundwater investigations that yielded a comprehensive conceptual model of the study area. Finally, because the watershed and the aquifers are trans-boundary, several problems were encountered during the case study implementation regarding the accessibility and homogenization of data. The knowledge and directions gained from these meetings was then implemented throughout the modelling process.

3.1 Characterization of the study area and conceptual model

The study area is comprised within the Lake Lugano watershed, as shown in Fig. 4. The watershed of the Lugano Lake is here considered up to the weir at Ponte Tresa (on the West), outlet of the Lake.

Fig. 4
figure 4

An overview of the Lugano Lake study and modelled area

Geologically, the lake resulted from fluvial erosion of a tertiary canyon which underwent a strong morphological overprint during the Pleistocene and Alpine glaciations [25].

The total lake surface is 48.9 km2 with a volume of 5.86 km3 and a maximum depth of 288 m, in the Northern basin. The output volume of the Southern basin is approximated to 0.77 km3 y−1. The lake is fed by a large number of mountain streams and rivers, most of which are ungagged. The average water level in the lake is 270.4 m. The discharge of the lake is automated at the weir, in order to avoid flood events, then not depending only on natural conditions. Surface runoff from the mountains enters the porous aquifers in each sub basin either as direct runoff that infiltrates into the groundwater, or as accumulated runoff in the form of ephemeral torrents and streams, as well as a few perennial rivers. Many of the smaller streams that flow off the mountains are not simulated, as they are channeled into impervious drainage canals within the flat areas and flow directly into the major rivers, which are then connected to the groundwater.

The watershed is broadly characterized by massive or fractured bedrock formations with little or no significant groundwater flow, and alluvial aquifers formed in the valleys connected to the lake. The fractured rocks comprising are not included in the model, as available information on their hydrodynamic behavior is very limited. Among the several small aquifers around the lake, there are five main aquifers of interest in this paper: Veddegio, Cassarate, Laveggio (located in Switzerland), and Cuccio and Boletta (situated in Italy).

Although many bore logs are available in the study area, often from construction sites, most logs do not extend deep, and no processed geological or stratigraphic information exists for the whole study area. In some areas, mostly near Laveggio, Vedeggio and Agno aquifers, there have been geophysical investigations to delineate the bedrock elevation under the aquifers. However, this data is not available for all of the investigated aquifers.

The second FG addressed the definition of the conceptual model, which resulted from the discussion in the following description. Physical no-flow model boundaries are set at the base of the aquifers, and the lateral mountainous watershed boundary. Artificial boundaries are required at the lateral extent of the aquifers to account for inflow from the surface. Recharge takes the form of precipitation recharge over the entire watershed, with stream infiltration in the aquifers. The model area is drained by the regulated discharge of the Tresa River and besides this, evaporation from the lake surface constitutes the other outflow term. Groundwater withdrawals for irrigation and drinking water occur in all five aquifers and this information input depends on available data.

3.2 Numerical model implementation

The modelling area is defined by a grid of 173 rows by 171 columns (29,583 cells) with a resolution of 150 by 150 m. The model vertical discretization consists of two layers, the upper is used exclusively to represent the lake, and the lower layer represents the aquifers. The upper layer is set as inactive (no solution of groundwater equations), as such the first model layer is only active on the lake domain. The thickness of the upper layer varies to represent the bottom of the lake. The active domain is defined by the location of the porous aquifers, by means of a lower model layer shows uniform thickness of 60 m as this was judged to be sufficient for the needed tasks in the FG meetings.

The simulation covers the year 2012 as a representative year, with 52 stress periods of 7 days length each. The high temporal resolution allows to simulate the dynamic changes in the model, considered very important in this case study as highly dependent on surface water changes. The hydraulic conductivity parameter (K) of the aquifers is set according to a kriging interpolation of known K values from pumping tests, as well as fixed values where the number of data did not allow interpolation.

One of the main features of the Lugano Lake case study is the usage of the MODFLOW Lake Package (LAK). At the boundary between the bedrock and aquifer, the MODFLOW well package (WEL) is used to recharge the groundwater based on flow accumulation and precipitation. The MODFLOW River Package (RIV) was used to simulate the effect of the major rivers in the model area. As some rivers may have an impervious bottom, they are only simulated when they are in contact with groundwater, and when they are not ephemeral.

Recharge was applied to the topmost active cell, i.e., the cells of second layer, based on precipitation and land use distribution using the MODFLOW Recharge Package (RCH). Groundwater extraction was simulated using the WEL Package for those aquifers where data was available based on concession amounts in well permits.

The OAT module was used extensively for the creation of model input time-series, as well as to create the head observation layer. Its use and application in general and in the Lake Lugano case study has been described in more detail in Cannata and Neumann [16]. Temperature, precipitation, stream discharge, stream height, humidity, atmospheric pressure, and lake level, among others, are monitored by the Canton Ticino hydro-meteorological network and are available through the istSOS software in the model area. In total, 14 time-series were loaded directly from the online istSOS service, 6 were added externally through Comma Separated Values (CSV) text files derived from the monitoring stations of the Swiss Federal Office for the Environment, and 4 were added as CSV files from the Canton Ticino database of boreholes, wells and springs (GESPOS) [26]. Not all sensors were used to create model input, but all were used for conceptual modeling.

3.3 Model results

The model results provide valuable insights, which can be used in each of the identified challenges. The results presented in this section reflect manually calibrated model output. In fact, since at the time of writing the major features of the model (the WEL, LAK and RIV packages) were not implemented in the sensitivity analysis/calibration features of FREEWAT-platform, the sensitivity analysis and the automatic calibration was not possible. The calibration was therefore conducted trying to manually adjust the conductivity values of the layers so that estimated groundwater levels fit the observations.

An interesting output produced by the model is the water exchanges between the lake and the aquifers (Fig. 5). It is clear that most of the fluxes are directed from the groundwater to the lake, while only marginally the opposite occurs.

Fig. 5
figure 5

Water flow (m3 s−1) between the lake and the groundwater system in the Lugano Lake watershed

Thanks to the geospatial post-processing capabilities of the FREEWAT-platform, it is straightforward to produce additional outputs representing maps of groundwater level curves at specific simulation times. In Fig. 6 the representation is extracted for the 18th week (June 2013). Looking at specific aquifers of the maps, it can be noted how the river-aquifer interaction type is different. For example, while in general the Vedeggio river is draining the aquifer, the Cassarate river is feeding the aquifer. This is a very important information that has a great influence on possible contaminant dispersion. For example, in the Vedeggio case a pollutant infiltrating in the terrain may quickly reach the lake trough the river instead of gradually infiltrating and potentially being degraded by the soil.

Fig. 6
figure 6

Estimated groundwater elevation in June

The trial and error calibrated model shows a quality adequate for the purposes of the study, though it might be improved by using automatic calibration methods. The model overestimates the observed values of approximately 4 m, but the simulated head changes correspond to the observed ones.

4 Discussion and conclusion

The Lugano Lake model represents a first relevant milestone in assessing the groundwater resources of the case study area according to the available information. The modeling process has led to various insights into the data needed for improving WRM, from novel uses of available data to important missing data. This result may be then additionally used by the local stakeholders in the administration services to inform future data collection policies. For example, river levels are monitored only in a single point: having the stages at two points would allow to evaluate the water river losses or gains to the aquifers.

The objective set by the FG of creating a complete groundwater model, interacting with surface water, that can be used to estimate water budgets and gain a better understanding of the integrated system in order to support water quality management was successfully achieved. The produced results can be used to derive important information based on the simulated groundwater fluxes and to identify critical areas where detailed investigations are required. A detailed model is under development for the Cassarate aquifer.

The participatory approach led to a shared identification and selection of the data as well as a better the understanding of model results, limitation and opportunities. Stakeholders were exposed to model definition and implementation including all the possible issues and source of uncertainties that the process may encompass. This is very important since it permits decision makers and stakeholders to better evaluate the model results, understand the system dynamics and consider water usage conflicts.

Also the dispersion of potential contaminants in the aquifer may be subject of evaluation. Since the majority of the drinking water is extracted from the groundwater, it is of particular concern the ability to timely identify plumes of contaminants so that timely actions can be taken. The groundwater model may then be used to delineate well-head protection and for the assignment of pumping concessions for newly drilled wells.

The case study model additionally demonstrates two modules of the FREEWAT-platform: the Observation Analysis Tool (OAT) and the Lake Package (LAK). OAT was used extensively throughout the modeling process to integrate data from several monitoring stations into the case study model, while the LAK is successfully used to dynamically simulate the interaction between the aquifers and the lake.

Since the analyzed system is complex and highly dynamic, the FG recognized that it is essential to increase the spatial and temporal resolution of data collection using the latest ICT technologies to capture the phenomena dynamics. The integration of different data types (satellite images, automatic station, samples) in the modelling platform is therefore desirable.

The role of models as operative instruments for testing scenarios, making predictions and set land use restrictions, has been fully recognized and the open source approach evaluated positively. Nevertheless, to achieve a better sustainability there is the need of supporting open data and open standards diffusion to facilitate water related studies.

While the legislation poses static target values driving water quality management, climate changes and growing urbanization impose new pressures and rapid changes on the water ecosystem that would require a more adaptive management approach. The SG suggests that the conjunctive use of modern ICT systems and traditional methods may guarantee the required management approach while reducing the risks of innovation.

As a final remark, the Lugano Lake case study has demonstrated that the FREEWAT project may constitute a milestone in spreading groundwater modelling across water management practices. The participatory modelling approach leaded the stakeholders to encompass, understand and trust the outputs that are the results of their agreed choices. The future maintenance of the platform sustainability is assured by a created FREEWAT community. Nevertheless, due to its young life, the FREEWAT platform still requires improvements and extensions to support specific needs like for example the integration of hydrodynamic-ecological lake models discussed by the Lugano Lake FG.