1 Introduction

Groundwater, an integral element of the Earth’s water cycle, plays a pivotal role in sustaining terrestrial ecosystems and driving the growth of industries, agriculture, and human societies, with its importance particularly pronounced in arid regions [1,2,3]. Groundwater systems encompass six crucial dimensions: water quantity, spatial distribution of water movement, flow volume or velocity, chemical composition, temperature, and system behavior variability [4]. Among them, the chemical composition of groundwater emerges as a vital factor due to its profound influence on regional groundwater availability, particularly for potable use. Environmental factors, including geology and lithology, climate conditions, hydrological processes, land use and land cover, groundwater extraction and management and so on, govern the six facets and can be quantitatively explained. In a changing world, groundwater systems are expected to be poised for rapid alterations [5,6,7,8,9,10]. Therefore, a comprehensive understanding of groundwater hydrochemical evolution driven by the environmental factors is imperative to ensure the sustainable management and utilization of the groundwater resource.

The sensitivity of groundwater hydrochemical composition to environmental factors results in a dynamic process known as hydrochemical evolution [11]. Groundwater's hydrochemical components, derived from atmospheric precipitation, rock weathering, and evaporation crystallization, undergo dynamic changes as groundwater flows through subsurface systems, reacting with surrounding rocks, minerals, and environmental substances. These changes resulted in alterations in hydrochemical types and increased total dissolved solids [12]. Climate and hydrogeological attributes dictate the diversity in groundwater recharge, discharge, hydrochemistry, and groundwater dynamics [6, 7, 13, 14]. As global population expansion, urbanization, industrialization, and fertilizer usage surge, anthropogenic activities exert substantial impacts on groundwater systems, often leading to ecosystem degradation and heightened human health risks [15,16,17,18]. Human activities leave a discernible mark on groundwater quality, making studying hydrochemical components an integral facet of groundwater hydrology research. Analyzing shifts in groundwater hydrochemical components not only unveils the formation and evolution of groundwater hydrochemistry but also offers insights into the paths and characteristics of groundwater circulation [19,20,21].

There have been numerous studies on the hydrochemical evolution processes of groundwater in plain aquifers and large basins. The North China Plain is one of the largest plains in China, where shallow groundwater is mainly influenced by water–rock interactions, ion exchange, and anthropogenic activities [17, 19, 22, 23]. Studies in the Surat Basin in Australia [24], the Dunhuang Desert Oasis [25], the Qinghai-Tibet Plateau [26], and the Xiangxi River Basin [27] have all demonstrated that changes in geological conditions may significantly alter the recharge-runoff-discharge processes and hydrogeochemical evolution of groundwater. Changes in lithology [24], faults [24,25,26,27,28], anticline structures [20], permafrost [23, 26], and aquifer structure [27] significantly impact hydrochemical properties, leading to observable groundwater hydrochemical evolution. In certain cases, geological factors and boundary conditions influence more than climate or topographical features [14]. However, previous studies have largely focused on singular geological units, such as plains, basins, and coastal regions, neglecting the complex interactions between environmental factors when a groundwater flow system spans multiple geological units. This complexity necessitates a comprehensive evaluation of groundwater hydrochemical evolution. Currently, our understanding of this intricate relationship between environmental factors and groundwater hydrochemical evolutions remains incomplete.

Understanding these environmental controls on groundwater evolutions is crucial for assessing groundwater quality, managing water resources sustainably, and mitigating the impacts of anthropogenic activities on groundwater systems. Hydrochemical and isotopic analyses, monitoring and modeling approaches are often employed to study groundwater hydrochemistry and evaluate the effects of environmental factors on groundwater quality [29, 30]. In this study, we employ hydrochemical analyses, multiple isotopic methods, and inverse hydrochemical modeling to investigate the integrated impact of geological, topographic, climatic, and anthropogenic factors on the groundwater hydrochemical evolution along the river corridor of the Fen River which meanders through valleys, canyons, basins, Karst spring areas, and coal mining regions before joining the Yellow River. The objectives include (1) to demonstrate the complex hydrochemical evolution of groundwater under various environmental factors, and (2) to illustrate the joint influences of environmental factors on groundwater hydrochemical evolution. The findings will deepen the understanding of the complexity of groundwater hydrochemical evolution and contribute to the sustainable management of groundwater resources.

2 Study area and methods

2.1 Physical geography conditions

The Fen River, with a length of 716 km, is the second largest tributary of the Yellow River. The Fen River catchment covers an area of about 39,000 km2 and is located between 35°17′24′′N-38°57′58′′ N and 110°24′22′′E-113°39′53′′E, with elevation ranging from 237 to 2736 m (Fig. 1). The study area has a semi-arid and semi-humid monsoon climate. The annual average temperature is between 6 and 13 °C. The annual average precipitation is around 465 mm. The 60% of annual rainfall concentrates from July to September (the rainy season). The catchment is long from north to south and narrow from east to west, with a general trend of higher elevations in the north and lower in the south. The main land use types in the river corridor of Fen River are farmland and construction land. The catchment overlaps the three major coal fields of Xishan, Huoxi, and Qinshui, as well as karst spring areas including the Leimingsi, Lancun, Jinci, Guozhuang, Hongshan, Huo, Longzici, Xin’an, and Gudui springs. In recent decades, the flow of the Fen River has decreased significantly. To meet the needs of industrial production and daily life, 3.2 × 108 m3/yr of water is diverted from the Yellow River [31, 32].

Fig. 1
figure 1

Location of study area and sampling sites

2.2 Geological conditions

The Fen River graben formed in the middle of the Tertiary to the Quaternary. To the west of this graben lies the Lvliang Mountain range (mainly composed of Lvliang anticline), representing the watershed between the Fen River and the Yellow River, with NNE–SSW orientation and an average 2000–2500 m elevation. To the east of the graben is the Taihang Mountain (formed by the Taihang anticline), representing the boundary between the North China Plain and the Fen River catchment, with NNE–SSW orientation and an average elevation between 1500 and 2000 m. The rocks in the study area are mainly sandstone, shale, dolomite, limestone, and gneiss (Fig. 2).

Fig. 2
figure 2

Geological map of the study area

The Fen River originates from Guancen Mountain and flows south through the upstream mountain valley. The Fen River enters the Taiyuan Basin to the south after passing through a winding limestone gorge to the east. Taiyuan Basin is a typical Cenozoic intermountain subsidence basin, which is narrow and elongated in the north-south direction. The overall terrain is higher in the north and lower in the south, with a stepped topography from the mountainous region to the basin’s center. There is a significant difference in the terrain and landforms between the east and west sides of the basin, with the east side having a gentle terrain and the west side directly contacting the basin through a fault, resulting in a significant height difference. The central part of the basin is a flat and wide alluvial plain of the Fen River. The exposed strata around the basin include Carboniferous-Permian coal-bearing strata, Cambrian-Ordovician carbonates, and Triassic clastic rocks. Large karst water systems, such as Lancun Spring and Jinci Spring, and fissure water systems are distributed around the basin.

The Fen River flows into the Linfen Basin through the Linghuo Canyon, between the Taiyuan and Linfen Basin. The Linfen Basin is located in the southern section of the Fen River Graben and is a Cenozoic faulted basin. The overall terrain gradually descends from northeast to southwest, with a small and flat alluvial plain in the central part of the basin. The presence of sand and gravel in the shallow aquifer system in the basin is conducive to pore water storage, and pore water recharge mainly comes from precipitation infiltration and lateral recharge from the mountainous areas [33]. The Hong Mountain Spring is located in the southern part of the Linghuo Canyon, partially exposed on the river terraces of the Fen River. The Longzici Spring domain is located on the eastern foothills of the Lvliang Mountains' southern section on the west side of the Linfen Basin. The karst aquifer is composed of Cambrian-Ordovician carbonate strata.

The Xishan coalfield is located on the Jiaocheng fault at the western boundary of the Taiyuan Basin, with an annual yield of about 30 million tons. The Huoxi coalfield extends from Fenyang in the north to the Hejin Plain in the south, from the eastern foot of the Lvliang Mountain in the west to Huo Mountain in the east, with an annual output of about 50 million tons of coal and an average coal seam of thickness of 140 m. High-sulfur coal is mainly distributed in the north. The Qinshui coalfield is located in a coal-bearing basin of the Carboniferous-Permian period on the southeastern part of the Fen River catchment, covering an area of nearly 30,000 km2.

2.3 Field surveys and measurements

Surface water and groundwater samples were collected along the fluvial corridor during the dry and rainy seasons in 2020, including shallow pore water, fissure water, karst water, and river water totaling 114 sets of samples, with groundwater primarily sampled from domestic wells at depths ranging from 30 to 400 m (Fig. 1). River water samples were sampled near the center of the river. Before collecting, the water table depth was measured, and stagnant water in the well casing was excluded before sampling. Then, water temperature, pH, electrical conductivity (EC), and oxidation–reduction potential (ORP) were measured on-site. Filtered samples (through 0.45 μm filters) were immediately filled into four 20 mL bottles and sealed. Another sample was collected into a 100 mL high-density polyethylene bottle, which was titrated for \({\text{HCO}}_{3}^{ - }\) on the sampling day. In addition, the chloride anion resin (DOWEX, 200–400 mesh) was used to collect \({\text{NO}}_{3}^{ - }\) from water samples. The remaining samples were stored at 4 ℃ in the laboratory until analysis.

The samples were analyzed at the Key Laboratory of Agricultural Water Resources, Chinese Academy of Sciences. ICP-OES (PerkinElmer, Optime 5300DV) and ion chromatography (Shimadzu LC-10A) determined the concentrations of cations and anions. The analytical precision was reported to be ± 1 mg/L. The electrical charge balance of all samples was less than 5%. The trace elements, including Al, Ag, As, Ba, Be, Bi, B, Cd, Cu, Co, Cs, Cr, Fe, Ga, Hg, Li, In, Mo, Mn, Ni, Rb, Pb, Sr, Se, Sb, Ti, Tl, V, U, and Zn, were determined using ICP-MS (PerkinElmer, Elan DRC-e). The accuracy was reported to be ± 1 μg/L. The δ2H andδ18O of samples were measured using a liquid water isotope analyzer (LGR lwia-24d, Los Gatos Research). Results were expressed as per mil (‰) difference from the Vienna Standard Mean Ocean Water Standard (VSMOW). The precisions were reported to be ± 1‰ for δ2H and ± 0.1‰ for δ18O, respectively. Nitrogen isotopes of \({\text{NO}}_{3}^{ - }\) were analyzed using a stable isotope mass spectrometer (Isoprime100, Elementar, Germany). Results of δ15N were expressed as per mill (‰) difference referred to as air. The precision was ± 0.5‰. The charge balance of all samples' cations and anions does not exceed 5%, making the data suitable for analysis.

2.4 Contribution of evaporation to salinity

The deuterium excess, d-excess [34], remains unchanged during mineral dissolution. In contrast, the deuterium excess decreases during evaporation. Therefore, the impact of evaporation can be determined by establishing the relationship between d-excess and evaporation residual ratio (f) as below [35]:

$$d{\text{-excess}}\; = \;888.36 \times f^{ - 0.07788} - 8 \times 984.17 \times f^{ - 0.01199} + 7000,$$

where d0 is 15‰, and S0 is the initial salinity, defined as 0.05 g/L according to rainfall samples.

The salinity change due to evaporation is:

$$\frac{{S}_{0}}{f}-{S}_{0}.$$

The contribution of evaporation to salinity of water samples (S) can be presented as:

$$\frac{\frac{{S}_{0}}{f}-{S}_{0}}{S}.$$

3 Results

3.1 Hydrochemical characteristics

The surface water and groundwater pH values in the study area are higher in the dry season than in the rainy season. The pH values of surface water are slightly higher than that of groundwater. The average pH is between 7.3 and 8.3, indicating weak alkaline water (Tables S1, S2, in Supplementary Materials). The total dissolved solids (TDS) represent the total salinity of the dissolved substances in water. The higher TDS generally suggests a higher degree of water–rock interactions. Excessive use of agricultural fertilizers and sewage discharge can cause an increase in TDS. Brackish waters (TDS > 1000 mg/L), of which approximately 83% are pore water, are distributed in the study area. The average TDS of river water, pore water, karst water, and fissure water are 737 ± 345 mg/L, 1079 ± 1037 mg/L, 793 ± 444 mg/L, and 569 ± 345 mg/L, respectively. The average TDS of water doesn’t show significant seasonal differences.

The surface water and groundwater in the study area exhibit diverse chemical types (Fig. 3). The Fen River water is mainly HCO3-Ca·Na, SO4·HCO3-Ca·Na, and SO4·Cl-Ca·Na types. The karst water is mainly HCO3-Ca·Mg, HCO3·SO4-Ca·Mg, and SO4-Ca·Mg types. The Karst springs with high \({\text{SO}}_{4}^{2 - }\) contents mainly occur around the Huoxi coalfield in the north part of the Linfen Basin. Shallow groundwater in Taiyuan Basin has a variable water type, including SO4·Cl-Ca·Mg, HCO3-Ca·Mg, HCO3·Cl-Na, and SO4·Cl-Na types, indicating complex groundwater flows and hydrochemical evolution. Groundwater in the Linghuo Canyon and the north of the Linfen Basin is primarily SO4·HCO3-Na·Mg type, while it becomes HCO3-Na and HCO3-Na·Mg type in the southern part of the Linfen Basin. There is no significant seasonal variation in water types.

Fig. 3
figure 3

Piper plot of all water samples

Overall, the order of average ionic concentration in the groundwater is Na+ > Ca2+ > Mg2+ > K+ and \({\text{HCO}}_{3}^{ - }\) > \({\text{SO}}_{4}^{2 - }\) > Cl > \({\text{NO}}_{3}^{ - }\). In groundwater, Na+, Ca2+, and Mg2+ ions mainly come from the dissolution of reactive minerals, such as Halite, Dolomite, Calcite, and Gypsum [36]. The limit value of \({\text{SO}}_{4}^{2 - }\) in groundwater is 250 mg/L according to the Standards for Drinking Water Quality of China (2022 edition). However, the average concentration of \({\text{SO}}_{4}^{2 - }\) in groundwater during dry and rainy seasons is 335 mg/L and 310 mg/L, respectively. The concentrations of Cl and \({\text{NO}}_{3}^{ - }\) are relatively high, with average concentrations of 126 mg/L and 31 mg/L, respectively. The concentration of \({\text{NO}}_{3}^{ - }\) in some samples also exceeds the national standards (about 44.3 mg/L).

3.2 Isotopic composition characteristics

Precipitation is the starting point of the water cycle in basins. Stable isotopic composition in local precipitation is the basic data for analyzing groundwater sources. Based on the isotopic composition of Taiyuan precipitation, the local meteoric water line (LMWL) is obtained as δD = 7.14δ18O + 1.38 [37]. The distribution of river water and groundwater near the LMWL indicates the atmospheric precipitation origin of waters in the study area (Fig. 4).

Fig. 4
figure 4

Isotopic compositions in different waters, a the rainy season, b the dry season

The average values of δ18O and δD of groundwater in the dry season are − 9.7‰ and − 72‰, with mean values of − 9.7‰ and − 72‰ for pore water, − 9.9‰ and − 71‰ for karst water, − 9.7‰ and − 72‰ for fissure water. The average values of δ18O and δD of groundwater in the rainy season are − 10.0‰ and − 73‰, with mean values of − 9.6‰ and − 71‰ for pore water; − 10.9‰ and − 76‰ for karst water; − 9.9‰ and − 73‰ for fissure water. The average values of δ18O and δD of the Fen River water are − 8.7‰ and − 64‰ in the dry season, − 9.6‰ and − 69‰ in the rainy season. The isotopic changes present active responses to rainfalls with depleted heavier isotopes in rainy seasons. The surface water and groundwater points are below the LMWL, indicating the influence of evaporation. The effect of evaporation on the isotopic composition of surface water is stronger than groundwater. The influence of evaporation on pore water is more significant than the other types of groundwater.

4 Discussion

4.1 Water–rock interactions

Hydrogeochemical processes of groundwater involve various interactions between water and rocks, leading to changes in the chemical composition of the water and the rocks themselves [26, 38,39,40,41]. The Gibbs plot [42] is a valuable tool for assessing sources of hydrochemical compositions in natural water and shows that the ion components in surface water and groundwater within the study area primarily originate from the weathering dissolution of rocks (Fig. 5). The data points to the right of the rock domination domain, where the Na+/(Na+ + Ca2+) ratio exceeds 0.6, indicate potential impacts from dedolomitization, ion exchange or human activities [36, 43, 44]. Mineral saturation indices provide insights into the dissolution saturation of minerals like calcite, dolomite, and gypsum, demonstrating the source of weathering dissolution of rocks (Fig. 6h).

Fig. 5
figure 5

Gibbs plot

Fig. 6
figure 6

Plots of ion ratios and mineral saturation indexes. Quantitative relations between ions are displayed in subplots (a)–(g). Mineral saturation indexes of main reactive minerals are shown in subplot (h)

The stoichiometric relationship between ions can further reveal the details of water–rock interactions [31]. Examining the equivalent ratio of \({\text{HCO}}_{3}^{ - }\) and Ca2+ provides insights into calcite and dolomite dissolution. A 1:1 ratio signifies calcite dissolution, while a 2:1 ratio indicates dolomite dissolution. In the upstream of Fen River and the western Taiyuan Basin, pore water and karst water predominantly cluster around the 1:1 ratio line, whereas fissure water, other pore water, and additional karst water align more closely with the 2:1 ratio line. Cation exchange and dedolomitization processes could decrease Ca2+ concentrations, positioning samples below the 2:1 line. During the rainy season, enhanced flushing, leaching, and gypsum dissolution contribute additional Ca2+, leading to sample points above the 1:1 line (Fig. 6a). The dissolution of calcite and dolomite typically results in an equivalent ratio of \({\text{HCO}}_{3}^{ - }\) to Ca2+ + Mg2+ of 2:1. However, in many pore, karst, and fissure waters, the observed ratios fall below 2:1 (Fig. 6c), indicating that other than carbonate minerals, minerals such as gypsum contribute excess Ca2+ or Mg2+ ions through dissolution. In addition, if Ca2+ and Mg2+ originate solely from calcite, dolomite, and gypsum dissolution, the balance between the sum of Ca2+ and Mg2+ and the sum of \({\text{HCO}}_{3}^{ - }\) and \({\text{SO}}_{4}^{2 - }\) will be established. However, water points, excluding the karst water, fall below the 1:1 line (Fig. 6d), indicating additional inputs of Ca2+ and Mg2+ from other hydrogeochemical processes such as cation exchange processes. The presence of cation exchange is evidenced by the Na+/Cl ratio. Halite dissolution releases equal molar amounts of Na+ and Cl, yielding a ratio close to 1. Most samples with elevated Na+ contents exhibit a ratio greater than 1 (Fig. 6f), supporting the cation exchange reactions.

Examining the equivalent ratio of Ca2+ and Mg2+ reveals the relative contribution of calcite and dolomite dissolution. A Ca2+: Mg2+ ratio exceeding 10:1 signifies calcite dissolution, while a 2:1 ratio indicates calcite and dolomite dissolution in equal molar contents and a 1:1 ratio corresponds to dolomite dissolution. Karst water primarily aligns with the 2:1 line, underscoring the substantial presence of calcite and dolomite in karst formations of the study area. Fissure water and surface water distribute between 1:1 and 2:1, while most pore water is positioned above the 1:1 line (Fig. 6b). The dissolution of anhydrite (or gypsum) or pyrite, providing \({\text{SO}}_{4}^{2 - }\) into groundwater, can extract Mg2+ from dolomite and precipitate calcite, leading to dolomite metasomatism by calcite. The prevalence of high \({\text{SO}}_{4}^{2 - }\) contents in groundwater and the dominance of dolomite minerals support the occurrence of dedolomitization. It should be noted that both cation exchange and dedolomitization processes could pull data points to the right of the rock domination domain in the Gibbs plot (Fig. 5).

Dissolving carbonate minerals, anhydrite/gypsum, fluorite, and other minerals increases the Ca2+ content in water. At the same time, the essence of dedolomitization is that excess aquatic Ca2+ replaces Mg2+ of dolomite [45, 46]. After the dedolomitization, the content of Mg2+ in groundwater increased, while the content of Ca2+ decreased. The ion ratio relationship between Ca2+ and Na+ immediately changes, which shows that Na+/(Na+ + Ca2+) exceeds the statistical range in the Gibbs plot (Fig. 5). In this study, the points with excess Mg2+ in pore water and fissure water (Fig. 6b) are consistent with the points with the ratio of Na+/(Na+ + Ca2+) greater than 0.6 (Fig. 5), demonstrating dedolomitization processes. In the study area, dolomite is abundant in karst strata [47], which supports the occurrence of dedolomitization.

Ion exchange is one of common natural processes [48]. Na+ and K+ on the mineral surface are replaced by Ca2+ and Mg2+ in water due to the strong adsorption capacity, resulting in the molar ratio of (Mg2+ + Ca2+-\({\text{SO}}_{4}^{2 - }\)-\({\text{HCO}}_{3}^{ - }\))/(Na+ + K+-Cl) close to − 1. The water points of the dry and rainy seasons are mainly distributed along the line with a slope of − 1, indicating the occurrence of cation exchange (Fig. 6g). In addition, the Choro-alkaline indices (CAI 1 and CAI 2) are widely used to determine the direction and strength of cation exchange [20, 49]. If CAI 1 and CAI 2 are less than 0, it signifies a forward cation exchange, resulting in a decrease of Ca2+ and Mg2+ and an increase of Na+ and K+ in water. If CAI 1 and CAI 2 are greater than 0, a reverse cation exchange occurs. The outcomes of the Choro-alkaline index reaffirm the prevalent existence of cation exchange in the study area.

Specially, the cation exchange facilitates the high F content of groundwater. The decrease in Ca2+ and Mg2+ contents promotes the dissolution of fluorite, contributing to an increase in the F content [50]. The saturation index of fluoride reaches − 0.34, indicating its widespread dissolution in the formation. The widespread occurrence of fluoride in groundwater is one of the reasons for water shortage and supply stress in northern China [51]. In the corridor of the Fen River, the mean F concentration in pore water, karst water, fissure water, and surface water is 1.83 mg/L, 1.70 mg/L, 1.55 mg/L and 1.16 mg/L, respectively, exceeding the limit of 1 mg/L for groundwater quality. Moreover, the average F concentration of pore water can reach 2.33 mg/L in Taiyuan Basin.

4.2 Evaporation and precipitation

Evaporation is one of the important processes in the water cycle. In arid and semi-arid areas, evaporation may hinder vegetation from absorbing water, reduce soil fertility, and even cause salinization. However, quantifying the impact of evaporation on the hydrochemical evolution is difficult. Some studies have determined the contribution of evaporation to salinity based on the relationship between water isotopes and salinity [52, 53]. Evaporation processes reduce water while leaving solutes unaffected. Consequently, the TDS of evaporated waters escalates, representing an augmentation in salinity. The high mineralization of shallow groundwater in the EI-Oued of Algeria is related to evaporation, which results in the saturation of minerals such as carbonate and gypsum [54]. In the corridor of the Fen River, TDS of surface water, pore water, and fissure water are also commonly affected by evaporation (Fig. 7), with the contribution of evaporation to TDS ranging from about 0.2–4.8%. Fissure water experiences a more pronounced impact from evaporation compared to pore water and karst water, which is attributed to the relatively shallower depth of the fissure water-bearing medium and the water table depth. During the dry season, the average contributions of evaporation to TDS in surface water and groundwater are 1.2% and 1.1%, respectively, while they are both 1.6% during the rainy season. The impact of evaporation on groundwater salinity is greater in the rainy than in the dry season. On one hand, the shallow groundwater receives a large amount of recharge during the rainy season, leading to a rise in the groundwater table. On the other hand, there is strong evaporation during the summer, which coincides with the rainy season. While groundwater penetrating greater depths may attenuate the effects of evaporation, it is noteworthy that groundwater can retain the signature of evaporation effects over an extended period. This prevalent occurrence is particularly notable in deep soil water within the Loess Plateau [55].

Fig. 7
figure 7

TDS versus deuterium excess

Concentrated precipitation during rainy seasons often leads to pronounced seasonal variations in groundwater hydrochemistry. Although the mean TDS of karst water in the upstream reaches of the Fen River catchment is 505 mg/L, with no clear seasonal variation, the seasonal variation is significant in the middle and lower reaches of the catchment. Notably, the mean TDS values exhibit distinct differences between dry and rainy seasons in various karst springs. For example, the mean TDS values in the dry and rainy seasons are 709 mg/L and 785 mg/L in the Hongshan Spring, respectively; 1355 mg/L and 855 mg/L in the Guozhuang Spring; 918 mg/L and 632 mg/L in the Huo Spring; 1510 mg/L and 1012 mg/L in the Longzici Spring. Except for a slight TDS increase of the Hongshan Spring in the rainy season, the TDS values of the other springs decrease in the rainy season. The karst springs are either depression springs or contact springs. Plenty of rainfall in rainy seasons produces a rapid flow within the groundwater flow systems of springs, which immediately increases spring discharge and usually dilutes the TDS of spring water.

The groundwater in the corridor flows through the Taiyuan Basin, the Linhuo Canyon, and the Linfen Basin in turn. The mean TDS values of shallow groundwater in the Taiyuan Basin exhibit a 13% increase during the rainy season (944 mg/L to 1071 mg/L), and a 5% increase (1118 mg/L to 1179 mg/L) in the Linghuo Canyon. In contrast, the Linfen Basin shows a 14% decrease in TDS values during the rainy season (830 mg/L to 710 mg/L). Even though the groundwater hydrochemical types show no significant variation between dry and rainy seasons, there are noticeable changes in the concentrations of key ions. Generally, Na+, K+, Mg2+, and Cl concentrations gradually increase during the rainy seasons, while Ca2+, \({\text{HCO}}_{3}^{ - }\), \({\text{SO}}_{4}^{2 - }\), and \({\text{NO}}_{3}^{ - }\) decrease. In groundwater, the average contents of trace elements also exhibit varying degrees of increase during the rainy season, with Al, Fe, and Zn showing the most significant elevation. These diverse seasonal hydrochemical evolutions in groundwater are attributed to distinct unsaturated zone processes during the infiltration of precipitation.

4.3 Anthropogenic activities

China is one of the world’s largest agricultural production areas [56]. Excessive use of chemical fertilizer and animal manure is the most important source of \({\text{NO}}_{3}^{ - }\) in groundwater [57, 58]. Human activities have a great impact on the migration and transformation of nitrogen in the surface water–sediment-groundwater system [59]. High contents of \({\text{NO}}_{3}^{ - }\) in groundwater can trigger the activation and migration of arsenic, causing more serious mixed pollution [60]. In the river corridor, activities such as planting wheat, corn, and sorghum, discharge of untreated municipal sewage, and irrigation practices involving the use of sewage-contaminated water, along with the presence of breeding farms scattered throughout the region, contribute to the \({\text{NO}}_{3}^{ - }\) pollution in groundwater. Our data reveals that the \({\text{NO}}_{3}^{ - }\) concentrations in pore water range from 3 to 474 mg/L. At the same time, the range is 0 to 48 mg/L in karst water. Similarly, fissure water exhibits concentrations from 1 to 40 mg/L, and surface water varies from 2 to 59 mg/L. The karst and fissure water systems, found in marginal mountains or beneath unconsolidated sediments in valleys and basins, are less affected by the \({\text{NO}}_{3}^{ - }\) pollution sources.

The \({\text{NO}}_{3}^{ - }\)/Cl ratio has been used to highlight biological processes responsible for the distribution of nitrate concentrations [61]. Results indicate that shallow groundwater in the river corridor is mainly influenced by both fertilizers and sewage. Only a small portion is affected by nitrogen fertilizers alone (Fig. 8a). Previous research has shown the distinct isotopic characteristics of nitrogen from different sources. At the same time, there is no significant isotopic fractionation of nitrate during diffusion and advection processes in groundwater [61]. Thus the isotopic composition of nitrate (δ15N–\({\text{NO}}_{3}^{ - }\) and δ18O–\({\text{NO}}_{3}^{ - }\)) is commonly used to identify the sources of nitrate pollution [50, 62, 63]. Based on the dual isotopes in nitrate, we find that the majority of groundwater samples are distributed in the overlapping areas of manure and sewage (M&S) and soil nitrogen (SON) with some points situated in the regions associated with \({\text{NO}}_{3}^{ - }\) and \({\text{NH}}_{4}^{ + }\) fertilizers (Fig. 8b), highlighting the diverse sources of nitrate in groundwater.

Fig. 8
figure 8

Sources and processes related to nitrate in groundwater. a Cl versus \({\text{NO}}_{3}^{ - }\)/Cl, b δ15N versus δ18O, c δ18O-H2O versus δ15N-\({\text{NO}}_{3}^{ - }\), d \({\text{NO}}_{3}^{ - }\) versus δ15N-NO3

However, the isotopic composition of nitrate can be altered by nitrification and denitrification processes. Consequently, an accurate identification of nitrate sources can be difficult [64]. In the process of nitrification, one oxygen atom in \({\text{NO}}_{3}^{ - }\) originates from environmental H2O, while the other two come from atmospheric O2 [65]. The δ18O-NO3 value can be calculated as below [66]:

$$\delta^{18}{\text{O-NO}}_{3}^{-} = 2/3\delta^{18}{\text{O-H}}_2{\text{O}} + 1/3\delta^{18}{\text{O-O}}_2.$$

Using the δ18O value of atmospheric O2 (+ 23.5‰) and the δ18O value of groundwater in the study area (between − 11.53‰ and − 7.48‰), the theoretical δ18O-\({\text{NO}}_{3}^{ - }\) value is between 0.15‰ and 2.85‰. Approximately 41% of the water samples primarily sourced from the Linghuo Canyon and the Linfen Basin, fall within a range that is twice the standard deviation (Fig. 8c), suggesting extensive nitrification throughout the river corridor. The Taiyuan Basin is experiencing severe pollution from arsenic (As) and chromium (Cr), with average concentrations of 17 μg/L and 8 μg/L, respectively, in the pore water, and 13 μg/L and 1 μg/L in the fissure water. This contamination threatens the local aquifer's microbial environment and exerts a notable inhibitory effect on nitrification [67]. The observed weak nitrification in the Taiyuan Basin can be attributed, in part, to the detrimental effects of As and Cr pollution on the microbial ecosystem.

Denitrification typically occurs in reducing environments, with a pH range between 6 and 10 and a high \({\text{NO}}_{3}^{ - }\) content in groundwater. Denitrification leads to the enrichment of δ15N in \({\text{NO}}_{3}^{ - }\). Consequently, the ratio of δ18O-\({\text{NO}}_{3}^{ - }\) to δ15N-\({\text{NO}}_{3}^{ - }\) falls within the range of 1:1.3 and 1:2.1 [68,69,70]. Some sample points of the pore water are distributed along the denitrification line (Fig. 8b) with low \({\text{NO}}_{3}^{ - }\) content and high δ15N–\({\text{NO}}_{3}^{ - }\) values (Fig. 8d), which suggests robust denitrification processes.

Coal mining leads to groundwater pollution in the Fen River catchment. Precipitation dissolves CO2 in soil, producing \({\text{HCO}}_{3}^{ - }\). This process further facilitates the ingress of \({\text{SO}}_{4}^{2 - }\) into groundwater in coalfields [25], inducing a significant evolution of groundwater hydrochemistry. Coal mining activities induce the oxidation of pyrite and other sulfides in connection with coal. As a result, the connected groundwater is of low pH levels and elevated concentrations of \({\text{SO}}_{4}^{2 - }\) and Fe [27, 71]. In recent decades, coal mining activities in Xishan, Huoxi, and Qinshui coalfields in the study area have been active, resulting in a large amount of mine drainage and the degradation of the groundwater environment. Additionally, the Huo Mountain Fault (rising on the east and falling on the west) runs through this area, bringing the Carboniferous coal-bearing strata into contact with ancient gneiss. The fault serves as a channel for upwards transport of a \({\text{SO}}_{4}^{2 - }\)-rich groundwater in the coal-bearing strata. Consequently, the shallow groundwater in the southern region of the Taiyuan Basin, Linghuo Canyon, and the central part of the Linfen Basin exhibits the SO4·Cl-Ca·Mg type. These locations align with the distribution of high-sulfur coal in the northern sector of the Huoxi Coalfield. The \({\text{SO}}_{4}^{2 - }\) concentration in groundwater surpasses 350 mg/L, companied by an elevated Fe concentration reaching up to 1.2 mg/L. Notably, the \({\text{SO}}_{4}^{2 - }\) and Fe levels in this region exceed those observed in other areas of the study area. Coal mining has led to not only aquifer damage but also groundwater hydrochemical evolution and water quality degradation. Besides, long-term mine drainage has also depleted the storage of the karst water systems, as evidenced in the case of Jinci Spring [72].

4.4 Topography and geological structures

The river corridor contains four geological units: the upstream mountainous area, the Taiyuan Basin, the Linhuo Canyon, and the Linfen Basin. Different trends in groundwater hydrochemical evolution occur among the units (Fig. 9), indicated by changes in Cl and EC which are often utilized as a tracer for understanding groundwater systems [40, 73]. Hence, the influence of geological settings on the hydrochemical evolution of groundwater is suggested. (1) In the upstream mountainous area, the valley slope is relatively large, with an average slope of 3.7‰ (Fig. 1). The valley groundwater flows downstream quickly in the narrow fluvial corridor with a short groundwater residence time. Moreover, it was reported that the valley groundwater is recharged by the water of the Fen River with stable hydrochemical features [31]. Therefore, the groundwater hydrochemical evolution is insignificant in the upstream mountainous area. (2) In the Taiyuan Basin, the groundwater flow rate decelerates due to the flat terrain (the average slope about 1.8‰) and the impeding of mountains at the lower end of the basin. This prolonged groundwater residence time amplifies the impacts of hydrochemical processes, including water–rock interactions, evaporation, agricultural fertilization, and sewage discharge [52, 74]. As a result, there are increasing trends in Cl concentration and EC values in the direction of groundwater flow. (3) The slope of the Linghuo Canyon is as high as 5.0‰ with karst springs occur on the both sides of the canyon. The narrow and deep canyon allows discharging a small flow of groundwater from the Taiyuan Basin and contacting the karst water from deep strata. With recharges of karst water, the Cl concentration and EC values in groundwater significantly decrease. (4) With a flat terrain (an average slope of 1.0‰), a branch of Huo Mountain blocks the groundwater flow in the northern part of Linfen Basin where the contribution of evaporation to the salinity of groundwater reaches 4.5%, significantly higher than in other areas. The Cl concentration and EC values of shallow groundwater therefore rise again. After that, the Cl concentration and EC values decrease again in the southern part of Linfen Basin. In summary, the evolution of groundwater hydrochemistry in the river corridor exhibits discontinuities when groundwater flow crosses geological units. Additionally, we found that the slow flow of groundwater is accompanied by enhanced water–rock interactions and an increased influence of evaporation on groundwater hydrochemistry.

Fig. 9
figure 9

Changes in trends of EC and Cl along the flow direction

The direct geological influence on groundwater hydrochemistry stems from the control of lithology, while the indirect geological influence arises from the control of geological conditions on groundwater flow rates and mixing processes. The results of inverse modeling with PHREEQC software confirm the hydrogeochemical processes by finding sets of minerals (calcite, dolomite, gypsum, halite, fluorite and so on) and gases that quantitatively account for the evolution (Table S3 and Fig. S1). For example, in the Taiyuan Basin, groundwater from the eastern and western mountainsides triggers solutions of Calcite (1.30 mmol/L), Gypsum (0.16 mmol/L), Halite (4.36 mmol/L), and fluorite (0.04 mmol/L) and processes of ion exchange, resulting in a water-type shift from HCO3-Ca·Mg to SO4·Cl-Na. Notably, the Xiwenzhuang anticline as the upward flow paths has led to the infusion of high \({\text{SO}}_{4}^{2 - }\) geothermal spring water into shallow groundwater [75], contributing to a 143% higher TDS of shallow groundwater. After entering the Linghuo Canyon, \({\text{SO}}_{4}^{2 - }\) released from coal strata of the Huoxi coalfield accumulates in groundwater. Then, groundwater flow velocity slows down due to the obstruction of mountain blocks in the northern part of Linfen Basin. At the same time, the TDS of groundwater exceed 2.0 g/L. At the same time, about 2.73 mmol/L gypsum deposits under the influence of groundwater evaporation. In the southern part of Linfen Basin, the TDS of groundwater decreases below 1.0 g/L, which is considered the result of mixing between groundwater from the northern part of the basin and the groundwater from the watershed of a tributary to the east of P31 site (Fig. 1). We modeled the hydrochemical compositions of the mixture P33 by assigning P23 and P31 as the mentioned two end-members, respectively, and subsequently found the fraction of P31 close to 0.92. The dominance of groundwater from the tributary watershed explains the hydrochemical type transition from SO4·HCO3-Na·Mg (P23) to HCO3-Na in the southern part of Linfen Basin.

5 Conclusion

We demonstrate the complex hydrochemical evolution of groundwater under four types of environmental factors. The hydrogeochemical evolution of groundwater in the fluvial corridor of the Fen River is driven by environmental controls, encompassing hydrogeochemical processes (including mineral dissolution, cation exchange, and dedolomitization), climate factors (evaporation and precipitation), human activities (agricultural, domestic, and mining activities), and variations in geological settings (terrain changes, the mountain-blocking effect, and the distribution of faults, uplifts, karst spring areas, and coal-bearing strata). The variation in geological settings across different geological units and human activities are responsible for discontinuous hydrochemical evolutions of groundwater within the river corridor. The contribution of evaporation to groundwater salinity is significant ranging from ~ 0.2% to 4.8%. Furthermore, the contribution during the rainy season is approximately 43% higher than in the dry season. The joint effect among environmental factors exists. Flat terrain and the mountain-blocking effect enhance the degrees of water–rock interactions and groundwater evaporation by slowing down groundwater flow. The combination between karst spring areas and faults/uplifts, between coal-bearing strata and mining activities fosters the mixing of karst water/mine water with shallow groundwater, promoting dramatic hydrochemical evolution of groundwater.

We found that the four types of environmental controls can be equally important, which is usually ignored. Geological settings play a pivotal role in determining the types and degrees of hydrological and hydrogeochemical processes. Hydrological and hydrogeochemical processes directly force hydrochemical evolutions. Hydrochemical evolutions respond to human activities. Hydrochemical evolution's spatial pattern of a groundwater system can be elucidated through variations in geological settings. The temporal evolution of groundwater hydrochemistry is influenced by a specific combination of evaporation, precipitation and related water–rock interactions, which is regulated by local climate. Human activities can significantly impact the spatial and temporal patterns of hydrochemical evolution by introducing various chemical components or alerting groundwater flow at specific locations and times. We highlight the importance of considering all four environmental controls in understanding the hydrochemical evolution of groundwater systems.