Introduction

There is a rapidly increasing demand for freshwater in southeast costal Tanzania due to rapid population growth and urbanization. Until recently, most of the water supply has been drawn from the Ruvu River. This is the single most important source of water in the area, involving significant operational costs. Prolonged droughts and deforestation have adversely affected the runoff characteristics within the river basin. Presently, more than 1,800 shallow wells have been drilled to exploit the upper part of the coastal aquifer. The majority of these wells are <100 m deep, with greatly varying capacities and water qualities (JICA 2005). To meet the increasing water demand, the Dar es Salaam Water Supply Authority (DAWASA) has commenced a search for potential groundwater sites in the area. After drilling six deep wells of up to 610 m at Kimbiji, Mpiji, and Mpera, a deep, regional Neogene aquifer was discovered in the alluvial plain in the coastal area of Dar es Salaam (Fig. 1). These findings indicated that this aquifer system was very large and could potentially be a future source of groundwater supply to the public in the region. Especially relevant was the existence of strong artesian conditions in the confined units, with a flowing well discharging more than 3 L s−1 (Ruden 2007).

Fig. 1
figure 1

A map showing the study areas and locations of water sampling points from surface water, rainwater, and groundwater wells. The designated cross-section line XY indicates the geological profile of the study area as shown in Fig. 2 below. Map of coastal Tanzania after (Kent et al. 1971)

Sustainable management of this resource is dependent on better knowledge of the groundwater system’s recharge provenance and hydrogeochemical evolution. It is especially important to understand the processes and factors that control the evolution of saline water in the aquifers. The hydrochemical differentiation of salinization processes in coastal areas is often complex due to the co-existence of other pressures, such as sources of anthropogenic pollution and seawater intrusion (Richter and Kreitler 1993; Morell et al. 1996; Stoessell 1997; Ozler 2003). The study area is a generic example of this challenge, being a coastal area that is experiencing seawater intrusion and which is subjected to multiple anthropogenic pressures, particularly affecting the shallow aquifer.

We attempt here to improve our methodology for classifying groundwater samples and identifying significant factors governing water quality. The paper illustrates how one can employ conceptual geochemical reasoning to interpret results from multivariate statistical analysis of data on groundwater chemistry and environmental isotopes. A statistical approach is a powerful tool for identifying the empirical influence of measured variables on the overall physicochemical composition of groundwater. Hierarchical cluster analysis (HCA) and factor analysis (FA) are multivariate statistical methods that are commonly used for the assessment of groundwater quality (Word 1963; Suk and Lee 1999; Helina et al. 2000; Adams et al. 2001; Lee et al. 2001; Thyne et al. 2004; Kim et al. 2005a, b). Stable isotopes of the water molecule (δ18O and δ2H) have been widely and successfully used as inert tracers providing insight into the origin of different water, their recharge processes, residence times in the aquifer and evidence of mixing with connate, thermal or seawater-derived fluids. Such information complements data on the physical hydrology, geophysics, and geochemistry (Kharaka and Carothers 1986; Cook and Herczeg 2000; Kim et al. 2003; Burnett et al. 2006).

This paper focuses on three main objectives: (1) to classify groundwater samples into groups that are governed by the same hydrogeochemical processes using HCA; (2) to identify and describe the main factors affecting groundwater quality in each group, using FA; (3) and to investigate the origin of the recharge and groundwater evolution using chemical species and stable isotope signatures (δ18O, δ2H).

Hydrogeological settings and aquifer characteristics of the study area

The study area comprises the southeastern catchment of the coastal rivers within Dar es Salaam, including the Mpiji, Kizinga and Ruvu rivers (Fig. 1). All rivers and groundwater drain into the Indian Ocean. The area has a tropical climate, with temperatures ranging from 18.1 to 32.2°C and a mean annual temperature of 25.7°C. The mean annual precipitation is 1,124 mm, with a mean yearly potential evapotranspiration of 1,900 mm. The topography of the study area is mostly a low lying terrain, with increasing altitudes from about 20 m a.s.l. around the city center to about 260 m a.s.l. at a distance of about 30 km from the coastline.

The broader geological setting of the study area is described by Kent et al. (1971). The coastal Neogene Aquifer consists of heterogeneous and layered Neogene (Miocene) sands, overlying an assumed geological basement of Lower Tertiary (Eocene) carbonates. From Dar es Salaam and northwards, the Neogene is overlain by thick Holocene deposits, but to the south, Neogene sands are exposed over an area of ~10,000 km2, between 39oE–39o45′E and 6o30′S–7o30′S, south of Dar es Salaam. The physical boundaries of the Neogene sands have not yet been ascertained, as surveys so far have been restricted to the central areas of the Kimbiji Peninsula, where thicknesses of the Neogene sands are know to exceed 1,000 m (Fig. 2).

Fig. 2
figure 2

Cross-section line XY as indicated in Fig. 1 above shows the regional geological context of the Kimbiji Neogene Aquifer, Tanzania. ‘P’ and ‘Q’ are designated as the approximate positions for deep wells P-4 (Mpera) and P-6 (Kimbiji), respectively. Profile after TPDC (2007). The aquifer coincides with the Neogene deposits shown on profile

The results from pumping tests of two deep wells at Kimbiji indicated the presence of an unconfined aquifer in the upper parts of the wells and a confined aquifer in the lower parts, with strong artesian flow characteristics of more than 3 L s−1 (Ruden 2007). Based on a drilling report of six deep wells in the study area (NORCONSULT 2008), borehole cross sections show primarily that alluvium and granular material comprise the upper, unconfined freshwater aquifer. It is also described as consisting of fine to medium sand that contains varying amounts of silt and clay. The unconfined aquifer is shallow in its southwestern part, with an average thickness of 10 m. It is deeper in the eastern part of the study area, up to 50 m. The depth of the water table in the unconfined aquifer ranges from at or near the land surface in low-lying areas to tens of meters below the surface in areas of higher elevation. The upper aquifer is of special significance for the present water supply because most of the groundwater used in Dar-es-Salaam City is withdrawn from this zone (JICA 2005).

The lower confined aquifer is comprised mainly of medium to coarse sands, and sometimes gravels and pebbles occur, interbedded with clayey-rich material. There is no obvious lithological boundary between the two aquifer units, apart from the numerous and nearly cyclic sand and marl beds. Consequently, a gradual transition from upper unconfined to lower confined conditions is expected. A seismic overview study of the area (TPDC 2007) suggests that the average saturated thickness of the aquifer system is around 1,000 m, and the overall flow direction is from west to east, driven by artesian pressure arising from the western hinterland.

There are no prominent agricultural activities in the study area; however, some of the shallow wells are located in the squatter settlements in Dar es Salaam, an area which is characterized by high-population densities and a poor sanitation system.

Materials and methods

Sampling and chemical analysis

Groundwater samples were collected from 13 shallow wells (<100 m) and six deep wells (up to 610 m depth), representing the upper and lower aquifer systems around the coastal watershed, respectively (Fig. 1). Three river water samples in their base flow conditions, six rainwater samples, and one sample of seawater were also collected. The water sampling from wells and streams was conducted between the 17th and 27th of April, 2009. The rainwater samples were collected using a high-density polyethylene funnel (25 cm in diameter), which was connected to a 5 L plastic container, placed 1 m above ground level. The container was covered with aluminium foil to minimize evaporation. The sampling collectors were installed at the end of March, 2009 and collected 1 month later. The seawater sample was collected in January, 2010, at the Slipway shore area in Dar es Salaam.

General procedures for water sampling, preservation, transportation, and chemical analyses were conducted according to ISO standard (IMPACTS manuals) (Vogt et al. 2001). Sampling from the deep and shallow wells was performed using a bailer sampler and water pumps, respectively, except for the well with artesian flow conditions. The samples were collected in 250-mL high-density polyethylene (HDPE) bottles, after passing through 0.45 μm syringe filters. Prior to filtration, temperature, electrical conductivity (EC), pH, oxidation–reduction potential (ORP), and dissolved oxygen (DO) were measured using portable meters (Hach USA). Total alkalinity was measured by potentiometric titration with 0.1600 N H2SO4 to a pH end point of 4.5 (Hach 1992) on the same day of sampling at Ardhi University in Dar es Salaam. All other chemical analyses were performed at the University of Oslo, Norway, within a month from sampling. Dissolved concentrations of anions Cl, Br, NO3 and SO4 2− and the major cations Ca2+, Mg2+, K+ and Na+ were analyzed by means of Dionex ion chromatography (IC) using ICS-1000 and ICS-2000 columns for the anions and cations, respectively. The overall charge discrepancy between cations and anions was less than ±5%, except for one rainwater sample (R-1), which had a 20% cation deficiency. Concentrations of Mn were measured with Perkin–Elmer, Inductively Coupled Plasma-Mass Spectrometry (Norwalk, CT, USA). The instrument was calibrated to the multi-element standard. The relative standard deviation for replicates of all the Mn analyses was within ±5%.

Stable isotopes analyses

Unfiltered samples for stable isotope analyses were collected in 50-mL HDPE bottles and sealed with PE caps. The samples were stored at 4°C in the laboratory prior to analysis. The isotopic measurements were conducted at the Institute for Energy Technology in Kjeller, Norway. The concentrations are given in δ-units, calculated with respect to Vienna Standard Mean Ocean Water (VSMOW) according to Eq. 1.

$$ \delta_{\text{sample}} \left( \permille \right) = 1,000\left[ {\frac{{R_{\text{sample}} - R_{\text{VSMOW}} }}{{R_{\text{VSMOW}} }}} \right] $$
(1)

where, R sample and R VSMOW are the isotopic ratios of the sample and VSMOW, respectively. Samples were measured at least in duplicates, providing a measure for precision of the analytical measures of ±0.1‰ for δ18O and ±1‰ for δ2H. International Atomic Energy Agency (IAEA) reference materials were used throughout the isotopic water analyses to ensure a high quality of the data.

Multivariate statistical analysis

Data on 13 physicochemical variables, i.e., DO, pH, EC, Ca2+, Mg2+, Na+, K+, HCO3 , Cl, Br, SO4 2−, NO3 and Mn2+, for the 28 water samples were assessed using multivariate statistical techniques. The data (Table 1) were normalized to give each variable equal weight in the multivariate statistical analysis and thereby to prevent results from being influenced most strongly by the variable with the greatest absolute magnitude and span (Thyne et al. 2004).

Table 1 Results of water samples analyses in the study area

Hierarchical cluster analysis (HCA) and factor analysis (FA) were used for the multivariate analysis. The HCA method is used to produce a graphical representation of sample groups using dendrograms. As such, this method is well suited to identify hydrochemical facies. An agglomerative hierarchical clustering was applied, using a combination of the Word’s linkage method (Word 1963; Suk and Lee 1999), where squared Euclidean distances was used as a measure of similarity between every pair of objects (Thyne et al. 2004; Kim et al. 2005a, b).

The FA explains relationships between measured variables and thus may be used to infer the hydrogeochemical processes that control water chemistry (Suk and Lee 1999; Helina et al. 2000; Kim et al. 2005a). The FA takes the data organized in a correlation matrix and rearranges them in a manner that better explains the structure of the underlying system that produced the data. Therefore, the matrix of correlation coefficients measures how well the variance of each constituent can be explained by its relationships with each of the others. The statistical analytical procedures were conducted using the statistical software package MINITAB (version 15, Minitab Inc., USA).

Results and discussion

Physicochemical data

The physicochemical and stable isotopic compositions of the water samples are summarized in Table 1. Electrical conductivity (EC) of groundwater varied widely, from 358 to 6,130 μS cm−1. The highest EC value was observed in a shallow groundwater sample <5 km from the coast, indicating the presence of saline groundwater intrusion. Oxidation–reduction potential (ORP) fluctuated from reducing (−81.2) to oxidative (88.7 mV) conditions and both ORP and dissolved oxygen concentration (DO) decreased exponentially with depth. The anoxic conditions in the deep aquifer may be due to the mineralization of organic matter. This may have occurred either upon passing through organic-rich surface layers in the recharge zone or by oxidation of dissolved organic matter brought down with the percolating soil water. Groundwater was slightly acidic to alkaline, with pH ranging from 5.80 to 8.33. Concentrations of HCO3 were the highest in the deep groundwater, reaching up to 361 mg L−1. Weathering of Eocene carbonate rocks comprising the basement of the aquifer system is believed to be the main source for the high-bicarbonate concentrations in the deep groundwater. Saturation indices (SI) for selected minerals, calculated by the hydrogeochemical code PHREEQC (Parkhurst and Appelo 1999) using the chemical data, show that most of the deep groundwater samples are supersaturated with respect to calcite and dolomite (Table 1). This suggests that it is these carbonate minerals that are governing the bicarbonate concentrations in the deep aquifers.

Multivariate analysis and groundwater quality

Hierarchical cluster analysis

Hierarchical cluster analysis (HCA) was performed to sort the samples into a finite number of groups with similar hydrochemical compositions, and therefore inferred similar processes governing their physiochemistry. Figure 3 shows the resulting dendrogram classifying the samples into four groups (A, B, C, D). The affiliation of the sample groups are easily recognized on the basis of the varying salinity contents for the groups A, C and D, and nitrate concentrations for group B. Group A represents the groundwater with high HCO3 concentrations and moderate salinity. More than half of the groundwater samples in group A are from the deep aquifer with strongly reducing conditions. Group B had significantly higher nitrate and potassium concentrations (Table 1; Fig. 3) than those of the other groups, indicating that this group has been severely contaminated. These high-nutrient values are most likely due to leakage from domestic wastewater, since these samples are all from wells situated in the squatter settlements of Dar es Salaam. This area is characterized by a high-population density and poor sanitation infrastructure. Group C comprises the samples with low and intermediate salinity. This group comprises all surface and rainwater samples in addition to some groundwater samples. Group D contains the most saline groundwater samples with high-EC and some Cl content. This is most likely due to seawater intrusion into the coastal area.

Fig. 3
figure 3

Dendrogram (samples) from hierarchical cluster analysis using Ward’s method as a linkage rule, and the squared Euclidian distance as a measure of similarity

Factor analysis

Table 2 gives the parameter loading of the first three extracted factors, which together explained 80.6% of the total data variance in the dataset. The varimax-rotated factor loadings and factor scores for the first two factors are presented in Fig. 4. Factor I, explaining 44.5% of the total data variance, presents significant and positive loading with EC, Na+, Cl and Br, as well as with Ca2+, Mg2+ and SO4 2−. Factor I is, therefore, conceptually interpreted to express the degree of salinization and thereby saltwater intrusion. Water samples in group D of the cluster analysis, therefore, have strong positive scores, while samples in group C have negative scores along this factor (Fig. 4b). High-ionic strength may in some cases simply be due to up-concentration by evaporation (Liu et al. 2003; Ceron et al. 2000), although in this case seawater intrusion appears to be the main governing process. Salinization by mixing with seawater is also confirmed by the Na+/Cl and Br/Cl ratios (Fig. 7), as well as the δ18O–Cl relationship (Fig. 8).

Table 2 Rotated factor loading of three factors after varimax rotation, significant loading were shown as bold fonts
Fig. 4
figure 4

Varimax-rotated factor loadings (a) and factor scores (b) for the first two factors of hydrochemical parameters of the groundwater in the study area

Factor II, explaining an additional 19.1% of the total variance (Table 2), possesses strong negative loadings of HCO3 and pH, and a high-positive loading of dissolved oxygen (DO). This factor is descriptive of the process governing the chemistry of the samples in group A in the cluster analysis (see Figs. 3, 4). The opposite strong loading of pH and HCO3 to DO translates conceptually into a gradient of the residence time of groundwater. Fresh groundwater contains dissolved organic matter which, over time, becomes mineralized, thus reducing the DO. This generates CO2, which in water forms carbonic acid that dissociates to H+ and HCO3 ions. The acidity that is generated is consumed by enhanced weathering of calcite and carbonate rocks in the aquifer basement, resulting in increased concentrations of pH and HCO3 . A confounding issue along this factor is the high-positive scores of samples that are contaminated by sewage (group B in Fig. 3). Still, these samples constitute relatively young water and as such comply with the overall interpretation.

The third factor, accounting for 17.0% of the total variance, is mainly associated with a high-positive loading for NO3 and K+, and moderate loadings for Mn2+. This factor is, therefore, representative of the factors governing the water chemistry in samples of group B in the cluster analysis. The lower limit of nitrate concentration for Group B samples is 173.9 mg L−1, which is higher than the limit set for drinking water, which is 50 mg L−1 as established by WHO Guidelines for drinking-water quality (2004), or 100 mg L−1 as established by Tanzania Standard for Rural Water Supplies, Ministry of Water (2006). Both nitrate and potassium are nutrients that are usually kept at low concentrations in nature due to rapid plant uptake. Furthermore, the NO3 has no known lithological source and hence it reveals an anthropogenic loading, which is here attributed to wastewater leakage from domestic activities. In addition, K+ is positively correlated with NO3 (R = 0.73, see Table 3). This co-variation is likely due to the fact that they are both found in high concentrations in sewage and released by bacterial action during the decomposition of organic material (Appelo and Postman 2005). Furthermore, since neither is correlated with any other major anions and cations (Table 3), it seems likely that they come from the same anthropogenic sources.

Table 3 Pearson correlation coefficients for 13 hydrogeochemical variables of water samples

Geochemical indicators of origin and groundwater evolution

Stable isotopes and groundwater provenance

Stable δ2H and δ18O isotopes are ideal tracers for assessing the recharge areas and flow path of groundwater because they make up the water molecules and they are sensitive to physical processes such as mixing and evaporation/salinization processes (Faure and Mensing 2005). The results of δ18O and δ2H analyses are presented in Table 1 and are shown in Fig. 5. Stable isotope values of rainwater are slightly variable from −5.0 to −2.0‰ for δ18O and from −24.2 to −3.6‰ for δ2H. The rainwater samples are found to the left of the global meteoric water line (GMWL) of Craig (1961). This is a typical characteristic for tropical climate stations (Dansgaard 1964). The slope of the fitting line for the rainwater data (Fig. 5), given as δ2H = 10.5 + 7.2δ18O (R 2 = 0.97), is in agreement with the slope for the mean monthly isotopic composition reported by Dansgaard (1964) for Dar es Salaam rainwater station (δ2H = 13 + (8 ± 2)δ18O), but is slightly lower than global meteoric water lines (δ2H = 10 + 8δ18O, R 2 = 1). Such a low slope is common for East African Equatorial sites, where precipitation events are related to air masses with different source characteristics during different seasons and local factors affecting the climate (Nicholson 1996; Rietti-Shati et al. 2000). Stable isotope values of river water are the least negative (between −2.9 and −1.7‰ for δ18O, between −12.9 and −7.0‰ for δ2H). River water samples from Ruvu and Mpiji rivers are plotted along the same slope as the fitting line of rainwater data and GMWL (Fig. 5), respectively, indicating a predominantly meteoric water source. The Kizinga River sample is the most enriched in δ18O and plotted below the GMWL (Fig. 5), reflecting a significant effect of evaporation (Clark and Fritz 1997). It appears, therefore, that river water in the study area is mainly supplied by local rainfall. The shallow groundwater in groups B, C, and D had a wide range of stable isotope values ranging from −5.7 to −1.8‰ and −8.1 to −14.3‰ for δ18O and δ2H, respectively. This could result from heterogeneity of the recharge conditions due to different flow paths. All groundwater samples show minimal effects from evaporation, except for two of three samples in group D (P-17, P-18) which show significant evaporation and they are plotted below the GMWL. That the observed isotopic values (δ2H and δ18O) of both shallow and deep groundwater samples are equal to or more depleted than the local precipitation implies that groundwater recharge is accompanied by minimal evaporation (Nkotagu 1996). Stable isotopes of some of the shallow groundwater samples are plotted on the same slope as river water and rainwater (Fig. 5). This may be the result of surface water–ground water interaction or direct infiltration by local precipitation. It appears, therefore, that the shallow groundwater in the coastal aquifer is mainly recharged by modern precipitation and surface water.

Fig. 5
figure 5

Stable isotopes plot of the rainwater, surface water and groundwater in the coastal area of Tanzania. Groundwater samples are sorted according to clustered groups

In contrast, the groundwater samples in group A show a depleted stable isotope values, which are plotted above the fitting line of the rainwater data and GMWL (Fig. 5). The δ18O values ranged from −6.1 to −4.0‰, and coincide with the other chemical factors such as DO, pH and HCO3 in the study area. This indicates that the deep aquifer is an older groundwater system that is initially fed by shallow groundwater and precipitation. The anoxic conditions in the deep aquifer (Table 1) imply a long residence time. A separate study on age estimation, based on radiocarbon dating in the same study area, suggests that the residence time of deep groundwater is on the order of several thousands of years and reflects past recharge during a colder climate than at present (Bakari et al. in progress).

The origin of groundwater salinity

The multivariate analysis (Figs. 3, 4) shows that groundwater samples in the coastal area are distinctively grouped in terms of salt contents and degree of nitrate contamination. Using ionic ratios and concentrations of major dissolved constituents, the clustered sample groups are clearly distinguished by water types in a Piper diagram (Fig. 6). Group A consists of NaHCO3 type water and represents old groundwater. Group B is more a Na(Mg, Ca)–NO3 type of water which has been contaminated by sewage. Group D, which is a Na(Mg, Ca)–Cl type of water, represents a more simple freshwater–seawater mixing. This wide range of hydrochemical facies reflects the complexity of the hydrogeochemistry in the study area. It seems that the observed facies for group D (P-14, P-17, P-18), with chloride (Cl) as the dominant anion, are the samples that are most influenced by seawater intrusion (Fig. 4b), judging from the elevated EC, Cl and high content of Na+ relative to Ca2+, Mg2+ and K+ (Table 1). The chloride concentration of groundwater samples for group D ranges from 1,003 to 1,422 mg L−1. The variations in concentration of other elements are more difficult to link to this process because their amounts are strongly governed by interactions with aquifer materials such as clay, silt, and sands (Stoessell 1997). In contrast, group C is characterized by low and intermediate salinity water, which includes also rainwater and surface water samples. The hydrochemical facies of the groundwater samples in group C are partially related to surface and rainwater chemical signatures, although their chemistry has been modified by spatially varying conditions. These features are indicative of shallow groundwater that are still in on early evolutionary stage.

Fig. 6
figure 6

Piper diagram of water samples in the study area. Samples are sorted according to clustered groups

If the chemical composition of groundwater samples were only controlled by a simple mixing process with seawater, then the samples would be plotted along the straight dashed line in Fig. 6, connecting the background freshwater and the seawater on the diamond-shape field of the Piper diagram. However, the chemical compositions of coastal groundwater affected by seawater intrusion are also controlled by cation exchange reactions (Appelo 1996). Therefore, the spatial trend in groundwater within the study area primarily shows a curved path (full line) of hydrogeochemical evolution, which starts from the Ca–NaHCO3–Cl type, progresses through the Na–Ca–Cl type, and ends up as the NaCl type of groundwater. This is a typical pattern indicating the cation exchange reaction when seawater intrusion has occurred (Appelo and Postma 1993). Another ion exchange process, found as a gradient in group A samples, is of increasing HCO3 concentrations with essentially decreasing Ca2+ concentrations, shifting from a more CaHCO3 to a NaHCO3 type of water (plotted in the lower-right portion of the diamond-shape field). A NaHCO3 water type is referred to as reflecting exchange water since there is more HCO3 than alkaline-earth cations (Ca2+ and Mg2+) on an equivalent basis (Tijani 2004). These distribution patterns therefore indicate that the groundwater chemistry in the study area is influenced by cation exchange reactions as well as the simple mixing with seawater as a result of seawater intrusion. This concept is also supported by the ionic ratios of both Na+/Cl and Br/Cl (Fig. 7). Since Na+ is exchanged for Ca2+ and Mg2+, the Na+/Cl ratio, plotted against Cl (Fig. 7a) is a good indicator of cation exchange-related changes in the groundwater chemistry (Stigter et al. 2006). Where the degree of groundwater salinization by seawater intrusion increases, the chloride concentration increases accordingly, but the Br/Cl ratio decreases. The Br/Cl ratio as a function of the chloride concentration (Fig. 7c) may therefore be used to identify the degree of seawater intrusion in coastal regions (Andreasen and Fleck 1997; Richter and Kreitler 1993). The most saline groundwater samples (group D) have Na+/Cl and Br/Cl ratios close to that of seawater. Corroborating the findings above, we see that group D comprises the most salinized groundwater samples, with Br/Cl ratios similar to the seawater ratio (0.0016). The exchange process also affects the concentration of Ca2+ relative to bicarbonate (Fig. 7b). In general, the groundwater samples of group A show an increase in the Na+/Cl ratio (Fig. 7a) and a decrease in the Ca2+/HCO3 ratio (Fig. 7b) with decreasing Cl concentrations. The deep aquifer water samples in group A are, as expected, less salinized and show relatively lower chloride concentrations and higher Br/Cl ratios. An interesting exception is the deep groundwater sample (P-2), which shows a comparatively high-chloride concentration and low Br/Cl ratio. One may therefore speculate that this anomaly is linked to relict seawater in this lower aquifer system. During the Pleistocene the sea level stood much higher than today (Johnston 1983), causing the aquifer system to be invaded by seawater to a greater extent. When the sea level dropped to its present position, some of this relict seawater may have remained in the aquifer and showed up in the well producing sample P-2.

Fig. 7
figure 7

Relationship between Na+/Cl ratio versus Cl (a), Ca2+/HCO3 ratio versus Cl (b) and Br/Cl ratio versus Cl concentrations in groundwater samples in the study area. Samples are sorted according to clustered groups

Intrusion of marine water into the shallow aquifer has also been reported previously from the Kigamboni Peninsula along the Dar es Salaam coastal strip (Nkotagu 1989). In addition, a few of the boreholes from the Mtwara coastal region of Tanzania were reported to have a mixture of freshwater and seawater (Gondwe 1991).

The isotopic variations of oxygen along with other chemical characteristics, such as Cl and NO3 , are assessed to provide supplementary information on the salinitization process of groundwater in the coastal aquifer. As discussed earlier, the variations in the δ18O and δ2H values in fresh water are naturally determined by the recharge regimes. In saline and contaminated groundwater, however, the variations in δ18O and δ2H values are also controlled by the composition of the saline and/or contaminant sources. In the shallow groundwater samples of groups B and D, we have observed an increase in δ18O values with chloride content (Fig. 8a), thus reflecting the enriched δ18O characteristics of the saline sources. Our data show that the most affected saline groundwater in group D has both high-δ18O and Cl concentrations (Fig. 8a). Given these combined geochemical and isotopic signals, these groundwater samples P-14, P-17 and P-18, classified as group D from the cluster analysis, are interpreted to be derived from a saline source with chemical characteristics that mimic those of sea water intrusion. In contrast, the saline samples from group B (P-10, P-16) have both high-chloride and high-nitrate concentrations (Table 1), although the isotopic variations of δ18O did not show a clear trend with respect to the nitrate concentrations (Fig. 8b). The high-δ18O values and salinity might reflect both evaporation/salinization processes and/or groundwater contamination from anthropogenic sources. Evaporation/salinization as the main process can be ruled out since there are no correlations between nitrate and any of the main contributors to groundwater salinity such as Cl (Table 3). The observed increasing concentrations of nitrate relative to δ18O values, without corresponding chloride concentrations for group B samples (Fig. 8), strengthened our claim that these wells have been contaminated by anthropogenic sources. Since there are no agricultural activities around these wells, the potential sources of nitrate pollution in the area are likely to be linked to nitrate-rich water from domestic sewage. This anthropogenic recharge component represents degradation of the water quality of the aquifer, not only due to the high nitrate but also due to fecal bacteria that are commonly associated with this source.

Fig. 8
figure 8

Variation of δ18O (‰) versus chloride concentrations (a), and δ18O (‰) versus nitrate concentrations (b) of groundwater samples in the study area. Samples are sorted according to clustered groups

In summary, we conclude that the high-ionic strength of water in the group B samples is derived from sewage, and groundwater salinization of groups C and D is due to seawater intrusion. The isotopic variations of group A samples did not show a significant relationship to either Clor NO3 (Fig. 8). This groundwater is, therefore, considered to be freshwater with low concentrations of both Cl and NO3 (Table 1), and classified as a NaHCO3 type of water induced mainly by dissolution of carbonate minerals and ion exchange reactions.

Conclusion

This study delineates different geochemical processes controlling the groundwater chemistry of the coastal aquifer in Tanzania. These processes are revealed by a conceptual assessment of multivariate statistical analyses on chemical tracers and stable isotopes. There are three main factors that govern the spatial variation in groundwater composition. Together, they explain 80.6% of the total variance in the groundwater quality. The first factor has high-positive loadings for most of the physicochemical parameters, and it is a representative of the degree of seawater intrusion. The second factor has high-negative loadings for pH and HCO3 , and a high-positive loading for DO. These points to a residence time gradient with dilution of groundwater by fresh recharge on the one extreme, and enhanced mineralization by water–soil/rock interaction on the other. The third factor has a high-positive loading for NO3 and K+, and moderate loadings for Mn2+. These ions are mainly associated with sewage.

HCA sorted the water samples into four groups distinguishable mainly by salinity, bicarbonate content, and nitrate concentrations. Group A is old groundwater with moderate salinity. Group B is sewage-contaminated water. Group C is freshwater–seawater mixing, with low and intermediate-salinity, and group D comprises saline intrusion water, with a high-salinity content.

The slope of the fitting line describing the δ2H–δ18O relationship for the rainwater data is typical for areas having seasonal rain and dry periods under hot climatic conditions. The stable isotope data in the shallow groundwater indicate that it is recharged by fresh precipitation and infiltration by surface water. The narrow range of depleted stable isotope values in the deep groundwater indicates that this water is old and probably derived from infiltration in the recharge zone followed by slow lateral percolation. This is also supported by the general chemical signature of deep ground water. The most important geochemical processes occurring in the studied coastal aquifer system are intrusion of seawater accompanied by cation exchange reactions, and the dissolution of carbonate minerals. The enriched δ18O corresponding with high-Cl concentration and the strong correlation between all major ions, except NO3 and K+, infer that the high-salinity in the shallow groundwater samples (group D) are due to seawater intrusion. It is also clear that the high-nitrate concentrations (up to 445 mg L−1) and high-δ18O values for groundwater samples in group B is due to sewage originating from the squatter settlements in Dar es Salaam.

This study shows that conceptual reasoning supported by results from multivariate statistical analysis (using HCA and FA) of chemical composition is a powerful tool for the classification of groundwater and the identification of major factors governing groundwater quality. The application of HCA techniques may be used to roughly distinguish between samples whose chemistry is governed by different mechanisms. A conceptual understanding of the role of the parameter with the strongest loadings in the FA revealed that the main governing geochemical processes included salinization, natural mineralization and anthropogenic contamination. The sample scores in the FA allow us to ascertain the predominant processes governing sample clusters from the HCA. Stable isotopes signatures compliment this assessment by suggesting groundwater origin and which pressures might be influencing the quality of the groundwater aquifer. Explicitly, the results of this study provided a conceptual understanding of groundwater characteristics in the alluvial plain of coastal area in Dar es Salaam, Tanzania, which is required knowledge for being able to make decisions toward establishing a cost-efficient and sustainable management system for this valuable freshwater resource. The best water quality was found in the lower confined aquifer. The results from this study highlight the importance of having stringent measures and a system for close monitoring in place when this aquifer is opened up for exploitation, to avoid further saltwater intrusion.