Introduction

In most of the world's arid and semi-arid regions, groundwater is the primary source of potable water for the agricultrial and industrial sectors. In these areas, groundwater is more accessible and resistant to contamination than surface water, making it a more reliable water source (Todd and Mays 2005; Wagh et al. 2016; Varade et al. 2018; Kadam et al. 2019). Nowadays, groundwater plays an increasingly crucial role in daily life, especially in arid regions like Iran, providing more than 55% of the water needed in Iran (Sakizadeh et al. 2016). As a result of a combination of natural and anthropogenic factors, groundwater quality is in jeopardy worldwide, particularly in Iran. Furthermore, primarily in arid or semi-arid regions—such as Iran—booming population growth, unsustainable development of agricultural and industrial activities, and lack of sufficient surface water supplies exert substantial pressure on groundwater resources (Besser et al. 2018; Adimalla 2020).

Both natural and anthropogenic parameters strongly change aquifer chemistry. The main natural factors are hydrogeology, geology, local precipitation, evaporation rate, water–rock interactions, weathering, and mineral dissolution (Dubey et al. 2021; Xiao et al 2022a, b). In addition, industrial effluent, urban and rural sewage, and the widespread use of agrochemicals are the most significant anthropogenic components (Alexakis 2011; Singh et al. 2011; Ehya and Marbouti 2016; Adimalla 2020; Mahaqi et al. 2021). From recharge to discharge areas, groundwater hydrochemistry is significantly changing due to several factors such as mineral weathering, presence of various ionic species in the medium, surface complexation, absorption/desorption processes, formation of secondary minerals, and flux of sewage or industrial effluents (Domenico and Schwartz 1990; Mahesha and Nagaraja 1996; Möller et al. 2006).

Metals and metalloids with an atomic mass greater than 20 and a specific gravity greater than 5 are considered heavy metals. There are numerous metals and metalloids that can be classified as heavy metals, including cadmium (Cd), mercury (Hg), copper (Cu), arsenic (As), lead (Pb), chromium (Cr), iron (Fe), nickel (Ni), and zinc (Zn) (Li et al. 2019). In the subsurface environment, heavy metals can enter via natural processes (dissolution of heavy metals from minerals) and anthropogenic processes (metallurgical, mining, nuclear energy, and chemical manufacturing) (Wu et al. 2019). Although Acid Mine Drainage (AMD) can form in the underground workings of deep mines (groundwater), its effects are typically limited when the groundwater table is artificially lowered by pumping. Discharging contaminated groundwater is possible when mines are abandoned, and the pumps are turned off (Johnson and Hallberg 2005). Some mine waste products (tailings) are abandoned without treatment in Zanjan province. Insufficient information is available to determine whether these tailings are leaching or posing health risks. Mine tailings contain various sulfide minerals, including pyrite, sphalerite, chalcopyrite, and galena (Xiaolong et al. 2020). Arsenic is primarily obtained as a secondary product from the treatment of copper, silver, gold, zinc, lead, and other metals (Morin and Calas 2006). Based on the redox conditions in the geological environment, arsenic (AS), AS (III), and AS (IV) concentrations differ significantly (Ying et al. 2011; Molinari et al. 2013; Kanoua and Merkel 2017; Islam et al. 2019). The requirement for water for human health contributes to the economy's growth and the ecosystems’ well-being (Basheer 2018; Raju 2022). Heavy metal concentrations in groundwater, such as AS, Pb, Fe, Cu, and Zn, pose a significant threat to human health and ecosystems (Johnson and Hallberg 2005; Kurwadkar et al. 2020). Several factors determine the form of AS and its transport, such as pH, redox potential (Eh), iron concentration, metal sulfide concentrations, sulfate ions concentrations, salinity, temperature, and microorganisms. Long-term consumption of AS in potable water and food can lead to various serious health problems, including melanosis, hyperkeratosis, skin cancer, restrictive lung disease, peripheral vascular disease, and gangrene (Buschmann et al. 2008; Rahman et al. 2009; Rasool et al. 2016; Kanoua and Merkel 2017; Ahmad and Bhattacharya 2019). In addition, excessive application of agrochemicals can contaminate groundwater through irrigation return flow due to retention in the unsaturated zone (Basheer and Ali 2018). Moreover, heavy metals accumulated in crops and transported through the food chain pose a risk to human health (Nouri et al. 2008; Wongsasuluk et al. 2014; Lu et al. 2016; Hembrom et al. 2020).

Research has been conducted using statistical methods, a Geographical Information System (GIS), and various diagrams to better understand Iran’s hydrogeochemical evolution in arid and semi-arid regions (Parizi and Samani 2013; Barzegar et al. 2018; Joodavi et al. 2021). Hydrogeochemical studies and inversion geochemical modeling by pH-Redox-Equilibrium-Calculation (PHREEQC) have been used to determine the origins of salinity in the aquifer (Samani et al. 2015). To this end, the current study describes the hydrochemical characteristics of groundwater in Zanjan plain, northwestern Iran, using a series of approaches such as geological, hydrogeological, hydrochemical, statistical, and geochemical inverse modeling. Although some studies have been conducted in this area (Saatsaz et al. 2018; Masoumi et al. 2019; Mohammadi Arasteh and Shoaei 2020), this is the first comprehensive investigation of groundwater chemistry in the study area, which correlates hydrochemical patterns with groundwater flow systems. The study was undertaken to fill this gap in scientific knowledge. It also provides a suitable basis for future research. An important aspect of this study is the estimation of the contributions of both natural and anthropogenic (urban and industrial contaminations and mining activities) sources of salinity. This is achieved through assessing groundwater chemistry and using geochemical evolution models. Further, this study provides essential information to decision-makers about groundwater quality and management.

Location, geology and hydrogeology of the study area

Study area

The Zanjan plain is located in northwestern Iran and east of Ghazal Ozan River, between 48 to 49° east longitude and 36 to 37° north latitude (Fig. 1). The Zanjanrood watershed is located in this area, known as the Zanjan-Soltaniyeh plain. The total area of this region is 4705 km2, of which 3038 km2 are highlands and 1667 km2 are plains. The aquifer occupies approximately 1200 km2, or approximately 71.9% of the plain's total area, corresponding to approximately 25.5% of the total study area. This region is classified as a semi-arid region due to its climatic conditions (Fig. 2). The average annual temperature in the study area is 10 °C, and there are an average of 117 frosty days. The average annual evaporation and perspiration amount to 1025 mm. According to Fig. 3, Zanjan City and the industrial areas are located on agricultural lands with good to medium productivity and near vegetation. In these areas, household, urban, and industrial wastewater can absorb into the soil and enter the groundwater.

Fig. 1
figure 1

Location of Zanjan plain

Fig. 2
figure 2

Average precipitation in the Zanjan plain (Government of I.R. Iran 2020)

Fig. 3
figure 3

The Zanjan plain's land use

Geological setting

The Zanjan Soltaniyeh Plain is a wide and high valley formed by Quaternary sediments between the Tarom and Soltaniyeh mountains (Fig. 4). These heights (Horst), which include geological formations from the Precambrian period and the first and second epochs, were raised during the third epoch (Stöcklin 1968; Abdi 2000; Darvishzadeh 1991). The area’s oldest rocks date back to the Precambrian period and consist of metamorphic rocks, shales, and granite. These rocks have formed the area’s bedrock (Table supplementary).

Fig. 4
figure 4

Geological map (Eftekhar Nezhad et al. (1996)) and groundwater samples of Zanjan plain

Dolomite, shale, and sandstone sedimentary rocks with a depth of 2000 m can be found in the Soltaniyeh Mountains, located at the plain's southernmost peaks. These rocks have formed Bayandor, Soltaniyeh, Barut, Lalun, and Zagun types of formations in the area. Another formation in the Soltaniyeh Mountains is the Mila Formation, consisting of thick-layer dolomites with chert nodules; quartzite, sandstone, and shale with calcareous dolomite sandstones being part of the Doroud Formation; and well-layer limestones with dark gray forming the Routeh Formation Black, which is located on sandstone and shale formations. The area's shale sandstone sediments with lower Jurassic trace vegetation and marine limestone formations known as the Delichai and Lar Formations are exposed to rocks of the second period.

The Lar Formation is exposed to a small area of light limestone in the Soltaniyeh Mountains and covers the same slope as the Shemshak Formation. In the study area, the formations of the third period are more widespread than those of the other periods. Most of these formations are volcanic rocks and thick tuffs, usually located in the north and east of the basin (Stöcklin 1968; Abdi 2000; Darvishzadeh 2003). In Eocene volcanoclastic rocks, these intrusive events are characterized by altered halos. Sub-volcanic intrusions are associated with silicic, argillic, propylitic and sericitic hydrothermal alteration (Karimzadeh Somarin 2006). These hydrothermal alteration halos are associated with gold, copper, lead–zinc, iron, and kaolinite mineralization (Azizi et al. 2010). Fourth-period evaporitic sediments include marl and brown, yellow, and pink gypsum silty clay strata, with sand layers deposited southeast of Zanjan, related to the aging Pliocene period and having a 200-m thickness. Several of these sediments can be found in the impermeable bedrock of the plains or the hilly areas at the end of the plain. There are sequences of lime, shale, marl, and evaporated sediments within the Qom Formation. This formation is composed of layers of shale and sandstone of the Shemshak group (Stöcklin 1968; Abdi 2000; Darvishzadeh 2003).

In the present era, alluvial sediments of the plain and along the Zanjanrood River, along with the alluvial deposits at the mouth of the channels that enter the plain alluvial formations of the region, constitute alluvial deposits consisting of gravel, sand, and low-density clay (Aghanabati 2004). As with the formations mentioned previously, the Zanjan aquifer is classified as a phreatic aquifer (Stöcklin 1968; Abdi 2000; Darvishzadeh 2003).

Hydrogeology

The Zanjan plain consists of a series of alluvial sediments and river terraces, whose thickness generally decreases from the south to the north of the plain. According to long-term statistics, Zanjan’s average annual rainfall is 310 mm, and its runoff volume is about 2 billion m3. The aquifer has been observed that the region's aquifer is typically replenished by snowmelt from mountains and rivers (Mohammadi Arasteh and Shoaei 2020). In some instances, however, it has been observed that the aquifer itself replenishes the rivers.

The Zanjan River is the most important river in the study area. According to general divisions of Iranian basins, this river is a part of the Sefid-Rud catchment. Sefid-Rud is the largest catchment area and the most waterlogged region in Iran's northern and central regions. The Zanjan aquifer consists of alluvial sediment sequences and river terraces of varying thicknesses. Towards the north and center of the plain, they reach a height of more than 500 m and gradually decrease in the northern parts of the aquifer. On the southern side of the mountains, sediment granulation includes coarse-grained sediments such as pebble and gravel and fine-grained sediments along the Zanjan River. Moreover, silt and clay are predominant in the northern part of the aquifer (Mohammadi Arasteh and Shoaei 2020).

The margins of the Mountains are typically composed of limestone from the Mila, Lar, and Qom formations. These formations in this study area are considered to be potential karst resources. A large portion of the plain's bedrock is composed of clay-marl units (formations such as Kahar, Bayandor, Barut, and Shemshak) dating back to the Miocene and Pliocene epochs. These bedrocks have a synclinal structure, and the slope on the sides is approximately 30° to 40° towards the center. In general, the size of the sedimentary particles is larger in the eastern half of the plain than in the western half. In addition, the yield of the alluvial aquifer is significantly higher (Government of I.R. Iran 2020). An important hydrogeological characteristic of an aquifer is its transmissivity, which plays a significant role in determining the quality of groundwater resources and the spread of contaminants (Awasthi et al. 2005; Gholami et al. 2022). Pumping tests have been performed to determine the transmissivity of the aquifer. The aquifer transmissivity values increase from the south of the plain to the center due to the increase in saturated thickness of the aquifer and the coarseness of its sedimentary particles (Fig. 5). In contrast, at the end (northern part of the aquifer), the aquifer transmissivity values decrease due to the fineness of its sedimentary particles (Government of I.R. Iran 2020). The thickness of the alluvial sediments in the plain varies from 10 to 150 m, and the thickness increases from the mountains toward the center. Alluvial sediment thickness has increased in the eastern part of the study area (Fig. 6) due to fault systems, mountain rise, and erosion (Government of I.R. Iran 2020). The alluvial sediments in the west and northwestern parts of the plain consist of clay, sand, and gravel, which are placed on the clay bedrock (Fig. 6).

Fig. 5
figure 5

Transmissivity in the Zanjan plain

Fig. 6
figure 6

Hydrogeological profile A–B (Government of I.R. Iran 2020)

A general estimate of the aquifer's storage factor is 5% (Government of I.R. Iran 2020). In order to determine groundwater balance, the total inputs and outputs from/to the aquifer are compared over a specified period (balance period), written as follows:

$$\sum \mathrm{Inputs}-\sum \mathrm{Outputs}=\text{Change in aquifer}.$$
(1)

As a result of considering the inputs and outputs of the Zanjan aquifer, the following balance equation was derived:

$$\pm \Delta V=\left({Q}_{\mathrm{in}}+{Q}_{\mathrm{is}}\right)-\left({Q}_{\mathrm{W}}+{Q}_{\mathrm{Eg}}+{G}_{\mathrm{d}}+{Q}_{\mathrm{Out}}\right)$$
(2)

where Qin denotes groundwater inflow through the aquifer boundary or the amount of water leaking from the bedrock, Qis represents surface infiltration of water from various sources into the aquifer, QW is the extraction and discharge of water from the aquifer by wells, Qanats, and springs, QEg denotes the evaporation of groundwater in areas where the groundwater level is close to the surface, Gd represents natural or artificial drainage of the aquifer, Qout is discharging groundwater from the aquifer, and ΔV denotes the volume change of the aquifer storage. Qis is written as follows:

$${Q}_{\mathrm{is}}={Q}_{\mathrm{P}}+{Q}_{\mathrm{I}}+{Q}_{\mathrm{SW}}+{Q}_{\mathrm{R}}.$$
(3)

QP denotes recharging from precipitation on the aquifer’s surface, QI represents recharge from agricultural irrigation consumptions, QSW denotes recharge from drinking water and industrial wastewater, and QR is recharge from rivers or surface flows. Each term is expressed as a volume of water during the balance period (million m3/year).

As shown in Table 1, the aquifer's water output volume exceeds its input volume. As a result, ΔV becomes negative. Among the largest output volumes from the aquifer is the Qw factor, which is transferred out of the aquifer through exploitation wells, springs, and Qanats. A large volume of water is extracted by exploitation wells, reducing the quality of the entire aquifer. The groundwater level map (Fig. 7) reveals that the water flow originates in the eastern foothills and reaches the Zanjan River’s base. In other words, the groundwater flow in the region is southeast–northwest, from the foothills to the east and finally to the Zanjan River. Figure 8 shows that groundwater levels in the Zanjan aquifer have decreased significantly over the past ten years (average reduction of approximately 40 cm per year). Several factors are responsible for the decline in groundwater levels, including a decrease in rainfall, uncontrolled water usage, and rapid development of agricultural lands. Over time, this decrease in groundwater level is likely to be accompanied by a reduction in the volume of aquifer water (discharge volume), an increase in the exchange of groundwater resources with aquifer materials, and ultimately the destruction of the groundwater quality (Mohammadi Arasteh and Shoaei 2020).

Table 1 Groundwater balance in the Zanjan plain (MCM/year) (Government of I.R. Iran 2020)
Fig. 7
figure 7

Direction of groundwater flow in Zanjan plain

Fig. 8
figure 8

Groundwater level decline in Zanjan plain

Materials and methods

In September 2020, 45 well samples were collected to identify the water chemistry (Fig. 4). In order to determine the physicochemical parameters of the samples, previous studies' procedures were followed (APHA 2012; Amiri et al. 2021; Rezaei et al. 2021; Ganiyu et al. 2021). The used bottles (1 L) were dry, clean, and sterilized polyethylene. Before sampling, bottles were pre-washed with 1:1 HNO3 and rinsed three times. A portable measuring instrument (WTWCond 340i, Germany) was used to measure the samples’ EC, TDS, and pH immediately after collection in the field. Each electrode has been calibrated before and after each measurement. The water samples were stored at 4 °C until further analysis in the laboratory. Within 48 h after the sampling campaign, ions such as chloride, bicarbonate, carbonate, sulfate, sodium, potassium, calcium, magnesium, iron, zinc, and lead were analyzed. Some methods have been used in this study to measure ionic concentrations. For measuring Ca, Na, and K content flame photometry have applied. Titrimetry was used for determining HCO3 and CO3 content. Cl concentration measured by titration with AgNO3. Nitrate was measured by spectrophotometry (HACH-RD2000). TDS was measured by evaporating a pre-filtered sample to dryness at 105–110 °C. Quality assurance and quality control (QA/QC) of the analytical data included using standard operating procedures, checking reagent blanks and standards, and analyzing replicates of collected QC samples. Ionic balances calculated as \(\left(\frac{\mathrm{cations}-\mathrm{anions}}{\mathrm{cations}+\mathrm{anions}}\right)\times 100\) were used to identify analytical precision for ions, typically within 10%. An ICP-MS device (HP Agilent 4500) was used to analyze the filtered and acidified groundwater samples for Fe, Pb, and Zn elements at the university's Zanjan Laboratory. The main recharge sources of phreatic groundwater are precipitation, irrigation, and seepage of surface water (Gao et al. 2019). The Zanjan aquifer is considered as phreatic aquifer (Stöcklin 1968; Abdi 2000; Darvishzadeh 2003). The phreatic aquifers are more susceptible to contamination than confined aquifers, particularly anthropogenic activities (Abdesselam et al. 2013; Gao et al. 2019).

First, the status of the data in terms of normality was analyzed, and due to the non-normality, the following steps were performed on the samples before statistical analysis. The following equations were used for standardization: (a) Logarithmic transformation was applied to the data, and (b) The following equations were used for standardization:

$$Z=x-u/s,$$
(4)

where x denotes the parameter’s value, u represents the average value of the parameter, and s is the standard deviation. This data standardization process leads to equal weight in the different variables, especially since the Euclidean mean distance method is influenced by higher-weight variables (Güler et al. 2002).

Using correlation coefficients to demonstrate relationships between various variables—independent and dependent—is a common and valid method of demonstrating these relationships (Kumar et al. 2006; Howladar et al. 2016). The abnormal distribution of parameters led to using Spearmen rank correlation. This indicator shows the degree of correlation between two relative variables, and its value fluctuates between + 1 and − 1. The positive value means changes in the two parameters occur in the same direction, while the negative means two factors change in opposite directions. Zero indicates that there is no meaningful relationship between these two factors (Cohen 1988). Hydrochemical facies have been introduced to define the hydrochemical properties of a groundwater system (Sing 2011; Wang et al. 2017; Adimalla and Li 2019). These facies represent the distribution of different main dissolved ions in aquifers at a specific site (Back and Hanshaw 1965). The Hierarchical Cluster Analysis (HCA) is a useful method for determining hydrochemical types and their origins (Cloutier et al. 2008; Saberinasr et al. 2019). FA efficiently reduces dimensions, classifies the obtained data into minimal practical components, and illustrates as much information as possible. FA was applied using the Principles Component Analysis (PCA) based on eigenvalues higher than one and varimax rotation to detect partial contributions and determine the optimal number of factors. In addition, Kaiser Normalization is essential to obtain the optimal number of active components. Sampling adequacy for the PCA method was also assessed by Kaiser–Meyer–Olkin measurement (KMO > 0.5).

The geochemical reactions, occurring along flow pathways within groundwater systems, have been investigated with several geochemical models. For a geochemical model to be applied to aqueous media, it must assumed that the dissolved species are in chemical equilibrium with each other (Plummer 1992). Inverse geochemical models can be developed to model the variation in the chemical composition of groundwater caused by hydrogeochemical processes such as dissolution, precipitation, ion exchange, sorption, and desorption occurring along the flow path (Apodaca et al. 2002). In order to apply such models, two mixtures of water at various points and a number of phases must exist along the flow path (Parkhurst et al. 1980). This model determines the phase transitions and reactants along the flow path and maintains the molecular equilibrium. The Geochemical processes and saturation indices were calculated with the PHREEQC inverse model program. Inverse geochemical models have a wide range of applications.

There are various software and methods that demonstrate the importance of the hydrogeochemical evolution of groundwater (Yu et al. 2018; Guma et al. 2021; Suvarna et al. 2022). This study utilized Arc GIS 10.3 software to create geological, DEM, and piezo-metric maps. Also, SPSS 22 software with correlation coefficients, HCA, PCA, and Factor Analysis (FA) has been applied to define the link between measured parameters.

Saturation Index (SI) was calculated using PHREEQC version 2 for evaporates (gypsum, anhydrite, and halite), carbonates (calcite, dolomite, and aragonite), an iron sulfide mineral (pyrite), and iron oxide minerals (hematite and goethite) in order to determine chemical equilibrium between various host minerals and groundwater (Parkhurst and Appelo 1999). Measured parameters such as SI and Total Hardness (TH) are depicted in Table 2. SI values can be affected by factors such as Ion Activity Product (IAP) and Solubility Product Constant (Ksp). By using the inverse geochemical model, it is possible to determine the reactions that affect the hydrochemistry of water along the flow path. Based on the model, the phase changes and reactions along the path are determined (Parkhurst et al. 1980; Parkhurst and Appelo 1999). In the Zanjan aquifer, inverse geochemical models were calculated with the PHREEQC software. The inverse geochemical model was used to identify reactions affecting the hydrochemistry of water along the flow path.

Table 2 Equations used for calculating SI and TH

Results and discussion

Physico-hydrochemical characteristics of groundwater

Statistical analysis

Statistical analysis of the main dissolved ions and physicochemical parameters in the basin of the Zanjan is illustrated in Table 3. The data normality was assessed by a one-sample Kolmogorov–Smirnov test, and the results indicate that most of the parameters are abnormally distributed (significant level of 0.05). In addition, the skewness and elongation values confirm the abnormality (Table 3). Based on WHO (2017), ions such as Ca2+, Mg2+, Na+, K+, and Cl are within the optimal range. However, some ions have values that exceed the standard values. The major sources of groundwater HCO3 are the dissolution of calcite and dolomite and anoxic biodegradation of organic matter. This may come from urban sewage, domestic sewage, septic tanks, and landfills (Nematollahi et al. 2016; Rezaei and Hassani 2018). The concentration of HCO3 should not exceed 240 mg/l (WHO 2017), even though it is safe and has no known adverse health effects. The bicarbonate content ranges from 75.6 to 325.7 mg/l. The average sulfate concentration is 164.3 mg/l, and the range is 34.5 to 444.4 mg/l. Sulfate in drinking water may produce significant taste problems and contribute to corrosion of distribution systems at concentrations above 250 mg/l. However, at concentrations above 500 mg/l, sulfate can have health-related effects such as gastrointestinal effects (WHO 2017). In groundwater, sulfate primarily originates from weathering of gypsum and anhydrite, and industrial wastes (Fianko et al. 2009). Nitrate levels in groundwater ranged from 16 to 66 mg/l, with an average of 38.8 mg/l. According to WHO guidelines, 50 mg/l of nitrate is the maximum amount of nitrate acceptable in drinking water (WHO 2017). Intake of high levels of nitrates can result in a variety of diseases, including thyroid dysfunction, breathing problems, fatigue, and multiple sclerosis (WHO 2017; Vanhatalo et al. 2018). In some parts of the Zanjan City and industrial areas were still wastewater is not fully collected, and it is disposed of in a traditional manner (Eslami and Ghadimi 2013). There are two main sources of nitrate in urban areas: (1) direct influx of nitrate from mineral fertilizer and sewage, and (2) influx of nitrate from nitrification of ammonium resulting from mineral fertilizers, soil organic nitrogen mineralization and sewage as well as the urea hydrolysis in human wastes (Mattern et al. 2009; Zendehbad et al. 2019). The maximum TDS in drinking water is 1000 mg/l (WHO 2017). Groundwater with a high TDS cannot be used for irrigation or drinking water (Nematollahi et al. 2016; Rawat et al. 2018). The TDS values in the groundwater samples ranged from 179 to 1264 mg/l, with an average of 526.7 mg/l. The EC measures the electric current capacity of water (Meride and Ayenew 2016). There is a wide range of conductivity values, ranging from 260.5 to 6023.7 μs/cm, with an average value of 1328.9 μs/cm. Groundwater samples with high EC values indicate salt enrichment. The maximum EC level in drinking water is 1500 μs/cm (WHO 2017). Pipes can corrode more readily when water contains a hardness lower than 100 mg/l. Aside from reducing soap's ability to lather, hardness also leads to scaling formation in plumbing fixtures and pipes. (Nematollahi et al. 2016). The calculated TH values in Table 2 range from 117.2 to 757.9 mg/l, with an average of 242.2 mg/l. The maximum permissible concentration of TH in drinking water is 500 mg/l, while 100 mg/l is the most desirable concentration (WHO 2017).

Table 3 Statistical description of the physical parameters of the main ions of Zanjan plain

Cluster analysis

The primary role of cluster analysis is to identify groups of similar items in a data series using various analytical techniques. Hierarchical clustering methods provide a hierarchy of clusters, from small clusters of very similar cases to large clusters that include other dissimilar cases (Holland 2006). Fourteen hydrochemical parameters in the HCA, including Ca2+, Mg2+, Na+, K+, Cl, SO42−, HCO3, CO32−, NO3, Fe2+, Zn2+, Pb2+, EC, and pH were measured in this study. In this study, two groups were identified from a dendrogram, each representing specific hydrogeochemical facies. In the dendrogram, distance 10 is taken into consideration for classification (Fig. 9).

Fig. 9
figure 9

Clustering of groundwater samples in the Zanjan plain

Group 1, the first group of water samples, comprised 82% of the water samples. This group showed low salinity, and its cation and anion order was Na+ > Ca2+ > Mg2+ > K+ and HCO3 > SO42− > Cl > CO32−, respectively. The high sodium content indicates the weathering of feldspars minerals, including albite, in the study area. The origins of high bicarbonate and calcium contents are mainly related to Mila, Lar, and Qom formations—these are all carbonate formations located southwest and west of the study area. Group 2 accounted for 18% of total water samples. Na+ > Ca2+ > Mg2+ > K+ were the predominant constituents, while for anions, SO42− > HCO3 > Cl > CO32− were dominant for anions. This group is dominated by sulfate as the predominant anion and sodium as the dominant cation (Na–Ca–SO4). The source of high Na+ in this group is evidence of weathering sodium plagioclase minerals such as albite and change in water type due to releasing pollutants via numerous industrial towns (Naidu et al. 1985) in the study area.

Consequently, Group 1 includes water in the southwest and southeast, east, south, and northeastern parts of the area that are recharged by the highlands in the southeast, southwest, and northeastern parts. Group 2 includes groundwater near Zanjan City and Zanjan industrial towns in the central parts of the study area (Fig. 10). According to the flow path (Fig. 7), group 2 can also be considered a discharge zone for zone 1. Previously, the Zanjan province reported heavy metal contamination near mining and smelting sites for lead, zinc, iron, and copper. In Zanjan, heavy metal contamination has also been reported at lead and zinc mining and smelting sites. Transporting concentrated ore by truck from mines to industrial sites, particularly the Zinc Industrial Complex, is another anthropogenic source of metal contamination (Parizanganeh et al. 2010; Zamani et al. 2012; Nabatian et al. 2015; Khosravi et al. 2018; Jamal et al. 2019). In the vicinity of the industrial complex, 2.5 million tons of tailings have been drained, causing contamination of soil, surface water, and groundwater. Tailings from the industrial complex are dumped in the open at extremely high metal levels in the vicinity of the complex (Parizanganeha et al. 2010). Consequently, water salinity increased in these areas, and group 2 is formed according to the HCA classification.

Fig. 10
figure 10

Group of groundwater samples in the Zanjan plain

Spearman correlation

It is possible to determine the origin of solutes and the processes influencing observed water composition by investigating the compositional relations among dissolved species (Jalali 2007; Singh et al. 2008; Azaza et al. 2011). Due to the non-normal distribution of the data, Spearman rank correlation was utilized to determine the correlation between variables (Table 4). There is a 0.6 correlation between Mg2+, Na+, K+, HCO3, and TH, indicating a good correlation between these ions. Na+ and K+ are correlated due to the dissolution of evaporating minerals, while Mg2+, HCO3, and TH are associated due to carbonates weathering. In addition, the correlation between Na+ and Mg2+ indicates weathering of silicates. The correlation between Na+, K+, Cl, and SO42− is 0.8 due to evaporation dissolution. Na+ and K+ correlations can also be the result of industrial activities. These correlations indicate that the dissolution of carbonates and evaporite minerals are crucial factors that increase TH, TDS, and EC.

Table 4 Spearman correlation between ions

Factor analysis

Identifying a set of hydrogeological conditions and hydrochemical processes that affect groundwater quality is difficult. Groundwater quality is controlled by a variety of hydrogeological conditions and hydrochemical processes. Therefore, hydrogeochemists use FA (Jolliffe 2005). This is a statistical technique that simplifies complex relationships among observable variables. The results of the chemical analysis are considered observable variables in hydrogeochemical studies. Groundwater quality data can be interpreted using this method for hydrogeological processes. These analyses have the primary objective of identifying the factors or factors that can explain the dispersion of hydrochemical data (Smith 2002). Factor loads, hydrogeological conditions, and geological and hydrochemical processes are used to interpret and determine the origin of different factors. It is essential to standardize data to perform this analysis. The number of factors was determined using the Kaiser Method (Kaiser 1960) and varimax rotation. Three factors and sixteen variables are included in the factor model. According to FA, these factors account for approximately 71% of the total variance in hydrogeochemistry. Approximately 46.5% of the total is determined by factor one, 15% by factor two, and 10% by factor three.

Coefficients above 0.6 are represented in bold in Table 5, indicating each factor's effective parameters. The following FA variables are considered: Ca2+, Mg2+, Na+, K+, HCO3, Cl, SO42−, CO32−, pH, Fe2+, Pb2+, Zn2+, NO3, TH, TDS and EC. There is a high positive factor loading factor 1 for Ca2+, Mg2+, Na+, K+, HCO3, SO42−, Cl, TH, TDS, and EC, which accounts for 46.49% of variances. In groundwater, Na+, K+, Cl, and SO42− ions have a high factor loading, indicating a common source (evaporite minerals), and Ca2+, Mg2+, HCO3, and TH come from carbonates sources. Furthermore, the dissolution of minerals in igneous rocks such as plagioclase (albite and anorthite) causes increased Ca2+ and Na+ ions in groundwater. These minerals increase the EC and TDS of water, particularly the dissolution of evaporite minerals. Approximately 15 percent of the total variance is accounted for by factor 2, which indicates a high factor load in Pb, Zn, and Fe ions due to the dissolution of igneous minerals and municipal wastewater.

Table 5 Factor analysis between ions

The water–rock interaction is a crucial factor in hydrogeochemistry, as shown by factor 1. In addition, in group two samples (near industrial areas), factor 2 indicates that industrial wastewater is a source of pollution. Industrial wastewater contributes to increased ions in groundwater concentrations of Fe2+, Zn2+, and Pb2+ ions. A high factor loading of EC and TDS in factor 1 with main ions indicates that groundwater salinization can be affected by increased ion concentration due to interactions between groundwater and geological formations. Factor 3 consists of two main components, CO32− and pH, contributing 9.7% to the total variance. There is a significant correlation between CO32− and pH in factor 3, indicating that alkaline groundwater has a higher CO32− content. Carbonic acid promotes the incomplete dissolution of siliceous minerals, resulting in bicarbonate ions and cations forming. After a long time, carbonate minerals are precipitated.

Consequently, the re-dissolution of these carbonate minerals can effectively impact this factor. A high factor load in this factor is also due to the weathering of carbonate minerals leading to an increase in pH (Table 5). Spearman correlations are consistent with FA results.

Investigation of the chemical evolution of groundwater using hydrogeochemical techniques

Hydrogeochemical facies

Chemical processes operating within the lithologic framework, as well as patterns of water flow, are reflected by facies. Groundwater flow through the aquifer system influences the distribution of facies within one formation or a group of uniform mineralogy formations (Back 1966). The Piper diagram (Piper 1944) has been used to characterize the type of groundwater. Figure 11 illustrates the two water groups on a Piper diagram. Based on cluster analysis and the Piper diagram, the first group contains approximately 82% of the samples in this group.

Fig. 11
figure 11

Piper diagram of area water samples

As mentioned before, the water type in group 1 is Na–Ca–HCO3. Weathering of feldspars, evaporites minerals and carbonates minerals increase Na+, Ca2+, and HCO3, respectively. Group 1 water consists of CaHCO3 (46.67%), CaMgCl (33.33%) and NaCl (2.22%), respectively. Due to the dissolution of dolomite, shale, and evaporite formations in the south and southwest of the plain (Qom and Shemshak formation), the water type has changed to the CaMgCl and NaCl. According to Spearman’s table (Table 4), carbonate, silicate, and evaporite minerals are dissolved. The type of water in group 2 is Na–Ca–SO4, which contains approximately 18% of the samples. In group 2, the water type is NaCl (11.12%), CaMgCl (4.44%) and CaHCO3 (2.22%), respectively. High salinity in this group results from the evaporite minerals (halite, gypsum) and the release of pollutants from nearby industrial towns. According to Table 5, the salinity of the water has increased near industrial cities.

Controlling mechanisms of groundwater chemistry

The geochemical composition of groundwater is mostly influenced by water–rock interactions (Appelo and Willemsen 1987). Rock weathering and dissolution of host rock minerals and ion exchange are the main processes responsible for ion formation in groundwater (Liu et al. 2017). Gibbs diagrams (Gibbs 1970) provide a more comprehensive understanding of hydrochemical processes such as precipitation, rock weathering, and evaporation, which have been used in the groundwater of the Zanjan aquifer (Fig. 12). In Gibbs diagrams, the ratio of dominant cations (Na+/Na+ + Ca2+) and anions (Cl/Cl + HCO3) is plotted against the total dissolved solids (TDS). Figure 12 illustrates that approximately 87% of groundwater samples are in a rock weathering zone. In the study area, the groundwater chemistry of the Zanjan plain is primarily controlled by the chemical weathering of rock-forming minerals or water–rock interactions. The semi-arid climate leads to increased evapotranspiration in the study area. Therefore, evaporation should also be regarded as an effective concentration indicator for further enrichment of ions dissolved in groundwater. In semi-arid regions, the Na+/Cl to EC ratio is a useful indicator of salinity mechanisms. The Na/Cl ratio in groundwater will not change due to evaporation; however, TDS will increase, which is a helpful indicator of evaporation. The Na/Cl ratio should remain constant with increasing EC as long as evaporation is the dominant process (Jankowski and Acworth 1997). Most samples in Fig. 13 are above equilibrium, and the average of this ratio is approximately 2.5. This indicates that weathering of silicate minerals has resulted in an increase in Na+ in the groundwater. Water rock interactions and dissolution of sodium-containing minerals, such as granite, granodiorite, and andesite rocks, increase Na+ concentration in groundwater. The ion exchange reactions are more predominant than evaporation. Furthermore, Gibbs diagrams indicate that evaporation is not a dominant process in this study area; however, it should be considered, especially in group 2.

Fig. 12
figure 12

Gibbs diagram of water samples in the study area

Fig. 13
figure 13

Relationship between Na/Cl and EC in the study area

Oxidation pyrite and neutralization reactions

Several host rock alterations are associated with ore bodies, including silicification (quartz and chert), sericitization (quartz, sericite, and pyrite), and carbonate alteration (calcitic to ankeritic minerals). Argillaceous alteration assemblages are also associated with ore, including kaolinite, sericite, quartz, and pyrite (Karimzadeh Somarin 2006; Nabatian et al. 2014, 2015; Ghazban et al. 2015). Sulfide minerals and their oxidation products are the leading causes of AMD. Among the minerals that have the potential to produce AMD, pyrite is the most important. AMD production capacity is affected by the concentration, grain size, and distribution of pyrite minerals. Pyrite is considered as a complex chemical compound that is oxidized both abiotically and microbially under oxic conditions (Nordstrom and Alpers 1999). The pyrite oxidation reaction is primarily carried out in two ways (Eqs. 5, 6).

$${\mathrm{FeS}}_{2(\mathrm{s})}+\frac{7}{2}{\mathrm{O}}_{2\left(\mathrm{g}\right)}+{\mathrm{H}}_{2}{\mathrm{O}}_{(\mathrm{l})}\to {\mathrm{Fe}}_{(\mathrm{aq})}^{+2}+2{\mathrm{H}}_{(\mathrm{aq})}^{+}+2{\mathrm{SO}}_{4 (\mathrm{aq})}^{-2},$$
(5)
$${\mathrm{FeS}}_{2 \left(\mathrm{S}\right)}+14{\mathrm{Fe}}_{(\mathrm{aq})}^{+3}+8{\mathrm{H}}_{2}{\mathrm{O}}_{(\mathrm{l})}\to 25{\mathrm{Fe}}_{(\mathrm{aq})}^{+2}+16{\mathrm{H}}_{(\mathrm{aq})}^{+}+{2\mathrm{SO}}_{4 (\mathrm{aq})}^{-2}.$$
(6)

Pyrite's oxidation reaction is highly dependent on pH conditions. Three major components are required for these reactions: pyrite, oxygen, and water. This reaction is carried out (pH < 4.5) under suitable acidic conditions (Eqs. 5, 6). The following reactions occur above pH 4.5, which may result in the production of goethite (Eqs. 79) and oxidation of galena (Eq. 10) (Stumm and Morgan 1981). The pH of the samples in the study area varies between 7.2 and 8. Thus, hematite and goethite minerals are produced, and galena is oxidized.

$${\mathrm{FeS}}_{2 (\mathrm{S})}+\frac{15}{4}{\mathrm{O}}_{2 (\mathrm{g})}+{\frac{5}{2}\mathrm{H}}_{2}{\mathrm{O}}_{(\mathrm{l})}\to {\mathrm{FeOH}}_{(\mathrm{S})}+2{\mathrm{SO}}_{4 (\mathrm{aq})}^{-2}+4{\mathrm{H}}_{(\mathrm{aq})}^{+},$$
(7)
$${\mathrm{S}}_{(\mathrm{aq})}^{-2}+\frac{7}{2}{\mathrm{O}}_{2 \left(\mathrm{g}\right)}+{\mathrm{H}}_{2}{\mathrm{O}}_{2 (\mathrm{l})}\to 2{\mathrm{SO}}_{4 (\mathrm{aq})}^{-2}+2{\mathrm{H}}_{(\mathrm{aq})}^{+},$$
(8)
$${\mathrm{Fe}}_{(\mathrm{aq})}^{+2}+\frac{1}{4}{\mathrm{O}}_{2 (\mathrm{g})}+\frac{3}{2}{\mathrm{H}}_{2}{\mathrm{O}}_{(\mathrm{l})}\to {\mathrm{FeOOH}}_{(\mathrm{s})}+2{\mathrm{H}}_{(\mathrm{aq})}^{+},$$
(9)
$${\mathrm{PbS}}_{(\mathrm{S})}+{\mathrm{O}}_{2 (\mathrm{g})}\to {\mathrm{Pb}}_{(\mathrm{aq})}^{+2}+{\mathrm{SO}}_{4 (\mathrm{aq})}^{-2}+2{\mathrm{H}}_{2}{\mathrm{O}}_{(\mathrm{l})}.$$
(10)

During sulfide oxidation, neutralization reactions are vital to determining the composition of AMD. Weathering silicate minerals such as plagioclase (albite Eq. 11, anorthite Eq. 12) and orthoclase (Eq. 13) may contribute to the neutralization of AMD acid (Blowes et al. 2003; Jambor 2003; BCAMDTF 1989; Lottermoser 2007; Ghazban et al. 2015).

$${\mathrm{CaAl}}_{2}{\mathrm{Si}}_{2}{\mathrm{O}}_{8 \left(\mathrm{S}\right)}\left(\mathrm{anorthite}\right)+2{\mathrm{H}}_{\left(\mathrm{aq}\right)}^{+}+{\mathrm{H}}_{2}{\mathrm{O}}_{\left(\mathrm{l}\right)}\to {\mathrm{Ca}}_{\left(\mathrm{aq}\right)}^{+2}+{\mathrm{Al}}_{2}{\mathrm{Si}}_{2}{\mathrm{O}}_{5}{\left(\mathrm{OH}\right)}_{4 \left(\mathrm{S}\right)}\left(\mathrm{kaolinite}\right),$$
(11)
$${\mathrm{NaAlSi}}_{3}{\mathrm{O}}_{8 \left(\mathrm{S}\right)}\left(\mathrm{albite}\right)+{\mathrm{H}}_{\left(\mathrm{aq}\right)}^{+}+\frac{9}{2}{\mathrm{H}}_{2}{\mathrm{O}}_{\left(\mathrm{l}\right)}\to {\mathrm{Na}}_{\left(\mathrm{aq}\right)}^{+}+2{\mathrm{H}}_{4}{\mathrm{SiO}}_{4 (\mathrm{aq})}+{\mathrm{Al}}_{2}{\mathrm{Si}}_{2}{\mathrm{O}}_{5}{\left(\mathrm{OH}\right)}_{4 \left(\mathrm{S}\right)}\left(\mathrm{kaolinite}\right),$$
(12)
$${\mathrm{KAlSi}}_{3}{\mathrm{O}}_{8 \left(\mathrm{S}\right)}\left(\mathrm{orthocalse}\right)+{\mathrm{H}}_{\left(\mathrm{aq}\right)}^{+}+{\frac{9}{2}\mathrm{H}}_{2}{\mathrm{O}}_{\left(\mathrm{l}\right)}\to {\mathrm{K}}_{\left(\mathrm{aq}\right)}^{+}+2{\mathrm{H}}_{4}{\mathrm{SiO}}_{4 (\mathrm{aq})}+\frac{1}{2}{\mathrm{Al}}_{2}{\mathrm{Si}}_{2}{\mathrm{O}}_{5}{\left(\mathrm{OH}\right)}_{4 \left(\mathrm{S}\right)}\left(\mathrm{kaolinite}\right).$$
(13)

Acid neutralization reactions are carried out by carbonates (calcite pH = 6.5–7.5, siderite pH = 4.8–6.3), aluminum hydroxides (pH = 4–4.3), and iron hydroxides (pH = 2.5–3.5). Carbonates, aluminum hydroxides, and iron hydroxides, respectively, have the power to neutralize acids from high to low. Also, the order of neutralizing power of acid from highest to lowest includes carbonates, aluminum hydroxides, and iron hydroxides (Blowes et al. 2003; Jambor 2003; BCAMDTF 1989; Lottermoser 2007; Ghazban et al. 2015). In general, acid consumption due to carbonate dissolution is expressed as follows (Eq. 14):

$${\mathrm{XCO}}_{3 (\mathrm{s})}+{\mathrm{H}}_{(\mathrm{aq})}^{+}\to {\mathrm{X}}_{\left(\mathrm{aq}\right)}^{+2}+{\mathrm{HCO}}_{3 (\mathrm{aq})}^{-}.$$
(14)

X is a divalent cation, such as calcium or magnesium, but not iron or manganese, since these elements produce acid during hydrolysis. This indicates that carbonate minerals have a greater neutralizing capacity than silicate minerals, leading to a higher pH level in the resulting solution.

Combination diagrams

A combination diagram is an effective tool for identifying and controlling groundwater hydrogeochemical trends from different sources. The hydrogeochemical evolution of groundwater is controlled by several factors, including recharge water chemistry, aquifer materials, ion exchange, and an aquifer's retention time. Three major factors significantly affect groundwater quality, including dissolution of evaporite minerals, dissolution of carbonates, and weathering of silicates (Jalali et al. 2019; Adimalla et al. 2020).

Na+ concentrations in groundwater can be affected by ion exchange effects, which can alter the concentrations of Ca2+ and Na+ in groundwater (Li et al. 2013). Using chloro-alkaline indices, it is possible to understand how ions are exchanged between groundwater and its host environment during residence or transition (Cai et al. 2011; Wang et al. 2017). The relationship between (Na+–Cl) and [(Ca2+ + Mg2+)–(HCO3 + SO42−)] should be linear when cation exchange is the primary process affecting groundwater salinity, with slopes close to − 1 (Li et al 2014). These indices (CAI 1 and CAI 2) are both negative when Ca2+ and Mg2+ in the groundwater exchange with Na+ and K+ in the aquifer material. Reverse ion exchange will result if both of these indices are positive (Schoeller 1965, 1967; Wang et al. 2017). The values are expressed in meq/l (Eqs. 15, 16).

$$\mathrm{CAI }1=\frac{{\mathrm{Cl}}^{-}-({\mathrm{Na}}^{+}+{\mathrm{K}}^{+})}{{\mathrm{Cl}}^{-}},$$
(15)
$$\mathrm{CAI }2= \frac{{\mathrm{Cl}}^{-}-({\mathrm{Na}}^{+}+{\mathrm{K}}^{+})}{{\mathrm{HCO}}_{3}^{-}+{\mathrm{SO}}_{4}^{2-}+{\mathrm{CO}}_{3}^{2-}+{\mathrm{NO}}_{3}^{-}}.$$
(16)

Most of the groundwater samples that were CAI negative showed a baseline exchange reaction (Fig. 14). Therefore, the normal ion exchange process contributes to the high concentrations of alkali (Na+, K+) in groundwater, declining the concentrations of Ca2+ and Mg2+ in the groundwater.

Fig. 14
figure 14

Chloro-alkaline indices 1 and 2 (CAI 1 and CAI 2)

The composite diagram (Na+ + K+) versus Total Cations (TC) has been prepared to evaluate the impact of weathering of silicate rocks on groundwater quality and cation ratios (Stallard and Edmond 1983; Sarin et al. 1989; Awad and Hussein 2006). Figure 15-a shows that most samples are located above Na+ + K+ (0.5TC) line. According to this diagram, in most groundwater samples, cations are derived from cation exchange between Na+ and K+ with Ca2+ and Mg2+. Additionally, the dissolution of evaporite minerals and weathering of silicate minerals lead to an increase in Na+ and K+.

Fig. 15
figure 15

Relationships between major ions: a Na+ + K+ vs. TC, b Ca2+  + Mg2+ vs. HCO3 + SO42−, c Na+ vs. Cl, d SO42− vs. Cl, e SO42− vs. NO3, f Ca2+  + Mg2+ vs. HCO3

Due to this area's abundance of igneous rocks, silicate-weathering may occur due to these reactions (Eqs. 1719):

$$2{\mathrm{NaAlSi}}_{3}{\mathrm{O}}_{8(\mathrm{S})}(\mathrm{Albite})+9{\mathrm{H}}_{2}{\mathrm{O}}_{(\mathrm{l})}+2{\mathrm{H}}_{2}{\mathrm{CO}}_{3(\mathrm{aq})}\to {\mathrm{Al}}_{2}{\mathrm{Si}}_{2}{\mathrm{O}}_{5}(\mathrm{O}{\mathrm{H})}_{4(\mathrm{S})}\left(\mathrm{Kaolinite}\right)+2{\mathrm{Na}}_{(\mathrm{aq})}^{+}+2{\mathrm{HCO}}_{3(\mathrm{aq})}^{-}+4{\mathrm{H}}_{4}{\mathrm{SiO}}_{4(\mathrm{aq})}$$
(17)
$${\mathrm{CaAl}}_{2}{\mathrm{Si}}_{2}{\mathrm{O}}_{8(\mathrm{S})}\left(\mathrm{Anortite}\right)+2{\mathrm{CO}}_{2(\mathrm{g})}+3{\mathrm{H}}_{2}{\mathrm{O}}_{(\mathrm{l})}\to {\mathrm{Al}}_{2}{\mathrm{Si}}_{2}{\mathrm{O}}_{5}{(\mathrm{OH})}_{4(\mathrm{S})} \left(\mathrm{Kaolinite}\right)+{\mathrm{Ca}}_{\left(\mathrm{aq}\right)}^{+2}+2{\mathrm{HCO}}_{3(\mathrm{aq})}^{-}$$
(18)
$$2{\mathrm{KMg}}_{3}{\mathrm{AlSi}}_{3}{\mathrm{O}}_{10}{\left(\mathrm{OH}\right)}_{10(\mathrm{S})}\left(\mathrm{Biotite}\right)+14{\mathrm{CO}}_{2(\mathrm{g})}+15{\mathrm{H}}_{2}{\mathrm{O}}_{(\mathrm{l})}\to {\mathrm{Al}}_{2}{\mathrm{Si}}_{2}{\mathrm{O}}_{5}{\left(\mathrm{OH}\right)}_{4(\mathrm{S})}\left(\mathrm{Kaolinite}\right)+2{\mathrm{K}}_{(\mathrm{aq})}^{+}+6{\mathrm{Mg}}_{(\mathrm{aq})}^{+2}+14{\mathrm{HCO}}_{3(\mathrm{aq})}^{-}+4{\mathrm{H}}_{4}{\mathrm{SiO}}_{4(\mathrm{aq})}$$
(19)

Figure 15b illustrates Ca2+ + Mg2+ versus SO42− + HCO3 as a composite diagram, and the points located close to the 1:1 line indicate ions resulting from weathering and carbonate dissolution in these samples. If the samples tend to SO42− + HCO3, the weathering of silicates will have a more significant effect on water quality. Carbonate dissolution affects water quality more if samples are high in Ca2+ + Mg2+ (Datta and Tyagi 1996). The diagram indicates that most groundwater samples begin near line one. Generally, points tend to reach SO42+ + HCO3, which indicates both weathering of silicate minerals and dissolution of carbonate, followed by most weathering of silicate minerals. Most of the samples included in group 2 result from the weathering of silicate minerals and contain significant sulfate levels due to industrial wastewater (Torres-Martínez et al. 2020). To determine the source of salinity in groundwater, the Na+ versus Cl diagram was used (Fig. 15c). If the Na+/Cl ratio in this diagram is more than one, it indicates that the sodium ion in groundwater samples is due to silicate weathering (Stallard and Edmond 1983; Meybeck 1987). Na+/Cl is therefore associated with weathering of silicates, including sodium-containing feldspars minerals like albeit. Processes such as cations exchange, agriculture, and industrial activities have led to an increased concentration of dissolved ions, particularly Na+ and K+ (Naidu et al. 1985). Salinity and Na+ concentrations in group 2 samples are higher than in group 1.

Based on the diagram, some points are close to the 1:1 line of Na+ and Cl in some samples, which indicates the dissolution of evaporite minerals such as halite. The ion exchange reactions or human contaminants may produce a high chloride to sodium ratio (Jones et al. 1999). The composition diagram of Cl versus SO42− (Fig. 15d) illustrates that the origin of sulfate in group 2 differs from that in group 1. This diagram has a weak correlation between NO3 and SO42−. Figure 15e illustrates the NO3 versus SO42− diagram used to determine the origin of sulfate (Escolero 2005) in group 2 samples. Torres-Martínez et al. (2020) indicated that sulfates are increased in groundwater by a source other than lithology. Sources of this pollution include municipal sewage and industrial areas. Consequently, it can be concluded that wastewater and industrial areas are the sources of sulfates in the samples from group 2.

There is also possible that pyrite oxidation reactions cause this total sulfate increase (Eqs. 5, 6). In order to determine the source of Ca2+ and Mg2+ in groundwater, the molar ratio (Ca2+ + Mg2+)/HCO3 is commonly used. If it is only due to Mg2+ and Ca2+ dissolution from carbonate, the above ratio will be approximately 0.5 (Sami 1992). Low Ca2+ + Mg2+ ratios (< 0.5) result from cation exchange and/or HCO3 enrichment. High ratios are not associated with HCO3 decrease since HCO3 does not form carbonic acid (H2CO3) under alkaline conditions (Spears 1986). 93.33% of the data above the 0.5:1 line indicates the carbonate source of Ca2+ and Mg2+ (Fig. 15-f). The high molar ratios (Ca2+ + Mg2+)/HCO3 indicate that high alkalinities are balanced by alkalis such as Na+ and K+. Additionally, during ion exchange processes, Ca2+ and Mg2+ are absorbed, decreasing Ca2+ and Mg2+ and increasing Na+ and K+ in groundwater.

Saturation index

In groundwater, mineral equilibrium calculations can be used to estimate mineral reactivity and predict the presence of reactive minerals. SI is used as one of the essential geochemical parameters to identify common minerals in groundwater systems in hydrogeology and geochemistry (Deutsch 1997). According to SI values, saturation modes can be classified as saturation (equilibrium − 1 < SI < 0), unsaturated (dissolution; SI <  − 1), and supersaturated (precipitation; SI > 0). According to Fig. 16, the SI of the two water groups concerning the minerals was calculated by using PHREEQC software. Aragonite, calcite, dolomite, goethite, and hematite minerals are supersaturated in the groundwater samples. Anhydrite, gypsum, and halite are unsaturated.

Fig. 16
figure 16

SI of each group's water samples

Geochemical modeling

Through inverse geochemical modeling, it is possible to determine the geochemical reactions that affect groundwater hydrochemistry along the flow path. The groundwater flow path was determined based on hydrogeological factors (groundwater level and flow direction). The data for each group has been used to indicate the initial and final composition of the flow path. Based on the calculated model, the average of group 1 data was used as an initial composition, and the average of group 2 data as a final composition. Mineral phases were determined by using saturation indices in the model.

For the model, these phases were defined as the dissolution of albite, anorthite, gypsum, kaolinite, pyrite, galena, and CO2, and the precipitation of calcite, aragonite, dolomite, hematite, and goethite. In order to obtain an inverse model for the evolution of groundwater composition, four possible models were identified. Based on the water quality change occurring in the flow path, these models represent different possible combinations of reactants and products within the PHREEQC software. The results are presented in Table 6. Positive values indicate dissolution, while negative values indicate precipitation (Parkhurst and Appelo 1999).

Table 6 Results of mass transfer inverse geochemical models (mol/kg)

The inverse geochemical model for hydrogeochemical evolution between groups 1 and 2 can be expressed as follows:

$$\mathrm{Na}-\mathrm{Ca}-{\mathrm{HCO}}_{3}\mathrm{ water }\left(\mathrm{G}1\right)+\mathrm{anortite}+\mathrm{albite}+\mathrm{anhydrite}+\mathrm{gypsum}+\mathrm{Pyrite}+{\mathrm{CO}}_{2}\mathrm{ gas }\to \mathrm{Na}-\mathrm{Ca}-{\mathrm{SO}}_{4}\mathrm{ water }\left(\mathrm{G}2\right)+\mathrm{dolomiote}+\mathrm{calcite}+\mathrm{hematite}+\mathrm{goethite}+\mathrm{kaolinite}$$

The results of geochemical modeling depend on the conceptual model, the basic concepts and principles' accuracy, the input data's accuracy, and the level of understanding of geochemistry processes (Güler and Thyne 2004). According to the mass equilibrium model, defining some phases are required to obtain the observed changes in water chemistry and calculate the hydrochemical evolution of the Zanjan plain. Mineral phases have been identified based on geological descriptions and analyses of rocks and sediments in the area. Silicate minerals (albite and anorthite), evaporite minerals (anhydrite and gypsum), pyrite, and CO2 (g) dissolve in group 1 water, which results in the precipitation of carbonate minerals (calcite and dolomite), iron oxides (hematite and goethite), and kaolinite in group 2 water.

The predominant geochemical process in the recharge zone (group 1) is the dissolution of carbonate and igneous minerals, including adding Ca2+, Na+, Mg2+, and HCO3 ions to groundwater. Ca2+ and SO42− are added to the groundwater by dissolving evaporite minerals (gypsum, anhydrite). However, oxidation of pyrite increases the sulfate ion concentration in all samples. During the groundwater flow direction of group 1 water toward the central part of the plain, the concentration of main ions increases, leading to the formation of group 2 water. Also, Sewage discharges from Zanjan's industrial towns cause salinity to increase, thus producing group 2. According to Figs. 4, 5, and Gheorghe's (1978) classification, the vicinity areas of group 2 have moderate to high transmissivity. These areas, including group 2, have a transmissivity ranging from 100 to 1000 m2/day. Thus, pollution from urban and industrial areas can rapidly reach the aquifer. Also, the negative value of ΔV indicates excessive water extraction from the aquifer, which leads to poor groundwater quality.

Other researchers also did this; for example, Samani et al. (2015) investigated the hydrogeochemical evolution of the Ajabshir Plain aquifer. This study assessed three different hydrogeochemical facies, including sodium, calcium, and bicarbonate facies. Using the HCA method, the samples of the study area were divided into three groups. The samples of group 3 were found to have been obtained due to weathering of anorthite, a rise of salt water, and mixing of salt water and fresh water. Geogenic factors that affect groundwater quality are discussed in this study. In the Zanjan aquifer study, samples were divided into two groups. Along with this, geogenic and anthropogenic factors were considered.

In addition, Ledesma-Ruiz et al. (2015) assessed the hydrogeochemical evolution of the Zona Citrícola in northeastern Mexico. Four samples were identified in the study area based on the HCA method. Group 1 is located in the recharge zone, groups 2 and 3 are located in the transition zone, and group 4 is located in the discharge zone. Their analysis revealed that there had been three factors contributing to the change in groundwater quality from group 1 to group 4, including the dissolution of evaporite minerals and dedolomitization, the dissolution of CO2 (g) in the soil, and the release of nitrates from human and animal wastewater and chemical fertilizers. The study investigated geogenic and anthropogenic factors by nitrates from chemical fertilizers and human and animal wastewater. In contrast, the Zanjan aquifer has investigated geogenic and anthropogenic factors, including nitrate pollution, industrial wastewater, and mining activities.

Conclusion

The measured hydrogeochemical signatures indicate that groundwater quality can be affected by some factors, mainly including the geological formations of the aquifer and anthropogenic factors. In order to identify the quality status of the Zanjan aquifer, groundwater samples were divided into two groups using the HCA method. The Piper diagram indicates that CaHCO3 and NaCl were the predominant water types in Group 1 and Group 2, respectively. Based on the results, the concentrations of HCO3, SO42−, Fe, Pb, Zn, and NO3 ions exceeded drinking water guideline values. Due to the increase in transmissivity, pollution from urban and industrial sources and mining activities has entered the aquifer. This may explain the high levels of Zn, Pb, and Fe ions observed in group 2. Sulfate concentration was high in all samples due to AMD, urban and industrial pollution entry into the aquifer. Since carbonates and silicate minerals can quickly buffer acid production, no acid rock drainage has been found in the study area. If mining activities are continued, pyrite oxidation will not be neutralized, and in the near future, it can endanger the ecosystem and human health. Based on CAI-1 and CAI-2 values, magnesium and calcium ions are often adsorbed from the aquifer materials, whereas sodium and potassium are released in the groundwater. Groundwater quality declined due to the negative water balance (-25.27 MCM/year) of this aquifer caused by overexploitation of groundwater. The continued exploitation of groundwater in this manner will lead to irreparable problems, including the degradation of groundwater quality. In order to understand the extent of the situation and make decisions regarding the sustainable management of groundwater resources in the study area, the study will provide valuable information to authorities.