Introduction

SWI is a phenomenon that widely occurs in many parts of the world due to the hydraulic gradient decreasing induced by sea level rise and the over-exploitation of freshwater resources (Werner et al. 2013; Sun et al. 2021). SWI not only leads to soil salinization, which endangers animal and plant habitats but also reduces industrial and agricultural productivity, bringing adverse impacts on human health (Chang et al. 2019). At present, the over-extraction of freshwater with population growth and economic development has reduced the freshwater hydraulic head and may lead to further inland advancement of the saltwater (Gao et al. 2022).

In recent years, to prevent SWI and protect freshwater resources, some researchers have devised progress on diversified practical engineering, including reducing freshwater extraction (such as replenishment of freshwater) (Lu et al. 2013), extracting seawater (Stein et al. 2020), inhibiting saltwater inflow path (Botero-Acosta and Donado 2015; Christy and Lakshmanan 2017), and combination of the above (Ebeling et al. 2019; Lu et al. 2019). The construction of subsurface physical barriers by injecting impermeable materials into subsurface aquifers has been reported as a technically feasible method to prevent SWI (Abdoulhalik and Ahmed 2017; Fang et al. 2023). Therefore, subsurface barriers have been used to prevent SWI in many coastal countries since the 1980s (Abdoulhalik and Ahmed 2017; Zheng et al. 2020). Such as, physical barriers for preventing SWI were used in Sardinia as early as the Roman Empire (Hanson and Nilsson 1986); in China, to prevent and decrease the freshwater flow, subsurface physical barriers were constructed in the Shandong Province (such as Laizhou, Qingdao, and Rizhao) (Kang et al. 2021). Subsurface barriers can be categorized into three types: (i) cutoff wall, a “wall” at the upper part of aquifer, freshwater discharge at the wall bottom; (ii) subsurface dam (Fig. 1), with an opening in its upper part of the aquifer, freshwater discharge at the upper part of aquifer; and (iii) fully penetrating barriers, spanning from the top to the bottom of aquifers. Cutoff walls and subsurface dams are the preferred and most practical technologies out of the three options to combat SWI (Chang et al. 2020). Over the past 10 years, several numerical and experimental studies have illustrated that subsurface dams and cutoff walls have a significant impact on the dynamics of freshwater flow and effectively prevent SWI (Luyun et al. 2009; Fang et al. 2020). Luyun et al. (2009) discovered that the height of a subsurface dam has a significant influence on SWI and the duration required for residual saltwater removal. They found that only subsurface dams with heights exceeding that of the saltwater wedge (SW) were effective in preventing SWI and that increasing the dam height resulted in an increase in the time required to remove residual saltwater. Chang et al. (2019) found that the subsurface dam’s minimum effective height in preventing SWI can be just a little lower than the thickness of the SW. Additionally, tides can induce complicated patterns of pore water flow in aquifers. The existence of a SW and an upper saline plume (USP) in aquifers as a result of density-driven and tide-induced saltwater circulation has been well-established (Santos et al. 2021). Freshwater bypasses the saltwater circulation, flowing into aquifers where it mixes with seawater (Heiss and Michael 2014). A freshwater-saltwater mixing zone forms along the perimeter of USP and SW (Abarca et al. 2013). Therefore, Shen et al. (2020) showed that the cutoff wall’s effectiveness in preventing SWI is undermined in the presence of tides. However, they also found that the subsurface barriers change the characteristics of pore water flow.

Fig. 1
figure 1

Schematic diagrams of numerical model. The subsurface dam and the PC-Walls (permeable CH2O walls); DOC is dissolved organic carbon, the MSL is the mean sea level, the SW (saltwater wedge) before and after subsurface dam construction are shown. Reaction expressions: aerobic respiration (Ar), nitrification (Ni) and denitrification (Dn)

NO3 contamination is another major limiting factor for freshwater utilization in coastal areas worldwide. Since the mid-twentieth century, NO3 pollution in freshwater has been reported on a large scale worldwide. For instance, Edmunds and Gaye (1997) conducted a study in an area of northern Senegal near the town of Louga measuring around 1600 km2. Their results showed that NO3 content over 50 mg L−1 was present from unsaturated Quaternary sands in this region. In the USA, Burow et al. (2010) conducted statistical analyses on NO3 content in 5101 wells, revealing that concentrations of NO3 exceeding 10 mg L−1 were widely present in 427 wells. In China, the mean concentration of total dissolved nitrogen in freshwater upstream of the Wang River watershed reached 34.36 mg L−1 (Kang and Xu 2017). Previous studies have suggested that subsurface barriers may impact NO3 pollution in coastal freshwater. In the Wang River watershed, China, Kang and Xu (2017) indicated that the construction of a cutoff wall led to a significant increase in NO3 concentration upstream. Sun et al. (2021) investigated that upstream NO3 increased evidently after subsurface barrier construction, NO3 discharge decreased, and NO3 accumulated area was dependent on the barrier’s height. Fang et al. (2022) investigated the impact of subsurface barriers on NO3 pollution in upstream freshwater under tidal influence. Their findings indicated that the combined impact of tides and physical barriers led to higher levels of NO3 pollution than either factor alone.

So far, some studies have demonstrated the availability of physical barriers in controlling SWI. However, these barriers may also lead to increased NO3 contamination in upstream freshwater. To our knowledge, a solution to this problem has not been found. There remains a lack of effective methods for controlling SWI and reducing NO3 contamination in sandy coastal aquifers under tidal influence. First, we validated the model on SWI based on a lab experiment by Fang et al. (2021) and calibrated the chemical reactions model based on previous in situ observations (Kim et al. 2017). Then, we conducted numerical simulations to compare the effectiveness of cutoff walls and subsurface dams. Lastly, we proposed a new method for controlling SWI and reducing NO3 contamination in coastal aquifers. This study offers guidance to improve freshwater quality and reduce NO3 contamination.

Methodology

Mathematical and numerical model setup

Groundwater flow was simulated using the variably saturated and variable-density pore water flow governed by the Richards’ equation (Eq. (1)), and the solute transport equation is used for describing the solute transport process (Eq. (2)):

$$P\left(\frac{{C}_{m}}{\rho g}+{S}_{e}S\right)\frac{\partial P}{\partial t}+\nabla \cdot \rho \left(\frac{-{k}_{s}}{\mu }{k}_{r}\left(\nabla P+\rho g\nabla z\right)\right)={Q}^{*}$$
(1)
$$\frac{\partial }{\partial t}\left(\theta {C}_{i}\right)+\nabla \cdot \rho \left({C}_{i}q\right)=\nabla \cdot \left(D\nabla {C}_{i}\right)+{r}_{i}$$
(2)

where ρ is fluid density (kg m−3), Ci is the concentration of solute (mM), i = salt, CH2O, O2, NO3 and NH4+, P is the pressure (Pa), z is the elevation head (m), θ is the water content (-), ks is the saturated hydraulic permeability (m s−1), kr is the relative permeability (m s−1), q is the Darcy velocity (m s−1), Cm is the specific moisture capacity (m−1), g is the acceleration of gravity (9.81 m s−2), Q* represents a stress source term (kg m−3 s−1), D is the hydrodynamic dispersion coefficient (m2 s−1), and ri is the reaction rate for solute (mM s−1).

$${k}_{s}=\frac{\mu K}{\rho g}$$
(3)
$${k}_{r}={S}_{\text{e}}^{0.5}{(1-{\left[1-{S}_{\text{e}}^{1/m}\right]}^{m})}^{2}$$
(4)
$${C}_{\text{m}}={\frac{{\alpha }m}{1-m}}{\left({\theta }_{s}-{\theta }_{r}\right)}{S}_{\text{e}}{}^{1/m}{\left(1-{S}_{\text{e}}{}^{1/m}\right)}^{m}$$
(5)
$$\theta ={\theta }_{r}+{S}_{e}{}({\theta }_{s}-{\theta }_{r})$$
(6)
$${S}_{e}=\frac{1}{{\left(1+{\left|\alpha P\right|}^{n}\right)}^{m}}$$
(7)
$$m=1-\frac{1}{n}$$
(8)

where θs and θr are the saturated water content and relative water content (-), respectively; K is the hydraulic conductivity (m s−1), where n (-), which is related to m in Eq. (8), and α (m−1) are the fitting parameters that describe the shape of both the moisture and relative permeability functions, obtained by van Genuchten (1980).

The simulated 2D beach aquifer in our study consists of a backshore that is 40 m wide and a 35-m-wide beach face with a slope of 10% (Fig. 1). The thickness of the beach domain was 12 m. At the landward vertical boundary (AE), we assigned a constant hydraulic head that was 1.5 m below the beach surface. Our simulation considered a simple sinusoidal tide with a mean sea level of 10 m, a tidal range of 1 m, and a 12-h tidal period:

$$h\left(t\right)={h}_{msl}+A{\text{sin}}\left(\frac{2\pi t}{T}\right)$$
(9)

where h(t) is the tidal head at the time t (s); hmsl is the mean sea level (m); A is tidal amplitude (0.5 m); and T is the tidal cycle (semi-diurnal tide). The AB, DE, and CD boundaries were set to zero-flux boundary.

A seepage face (BC) boundary is realized by the following formula (Xin et al. 2010):

$$-{\text{n}}\cdot \rho \frac{-{k}_{s}}{\mu }{k}_{r}\left(\nabla P+\rho g\nabla Z\right)=\rho {R}_{b}\left(H-{H}_{b}\right)$$
(10)
$${R}_{b}=\frac{{k}_{s}}{L}$$
(11)
$$\begin{array}{c}\begin{array}{cc}C={C}_{\text{i}}& {\text{n}}\cdot {\text{q}}<0\end{array}\\ \begin{array}{cc}-{\text{n}}\cdot {\text{D}}\nabla C=0& {\text{n}}\cdot {\text{q}}\ge 0\end{array}\end{array}$$
(12)

Boundaries AB, CD, and DE:

$${\text{n}}\cdot \left(D\nabla {C}_{i}\text{-q}{C}_{i}\right)=0$$
(13)

where Rb is the conductance term (s−1), defined as the ratio of the saturated hydraulic conductivity (ks) with a coupling length scale (L, m). And it was set at a high value allowing water to readily move in and out of the interface; Hb is the external head representing sea level (m), H is the total head (m), and n is the unit vector normal to the interface (pointing outward).

AE boundary was freshwater with Csea = 0 g L−1, and the ocean boundary (BC) seawater concentration was 35 g L−1. Oxygenous saltwater entering the BC boundary contains constant O2 concentration. At the landward boundary, freshwater carrying NO3 and NH4+ flows into the aquifer, NO3 occurs in the upper 5 m below the groundwater level of the inland boundary, and NH4+ occurs in the bottom 5.5 m of the inland boundary (parameter values see Table 1). The CH2O concentrations are constant at the sea boundary (Anwar et al. 2014; Zheng et al. 2020).

Table 1 Model parameters (Anwar et al. 2014; Kim et al. 2017; Zheng et al. 2020)

The sandy aquifer, with a hydraulic conductivity of 15 m day−1, had α and n set to 14.5 m−1 and 2.68, respectively (van Genuchten 1980). The subsurface barrier width is 16 cm with K = 15 × 10−3 m day−1. Moreover, the maximum length of the grid is 0.5 m and the minimum is 0.1 m. A more refined grid was adopted for the flooded area, with a time step of 100 s. To avoid the numerical instabilities, we ensured the Courant and numerical Péclet number did not exceed 1 and 4.

Solute reaction model

The reaction network (Fig. 1) consisted of three reaction processes: nitrification (Ni), denitrification (Dn), and aerobic respiration (Ar) (Bardini et al. 2012; Spiteri et al. (2008a, b).

Ar rate is described by,

$$\mathrm{If}\;C_{{\text{O}}_2}>0.008\;\mathrm{mM},\;R_{Ar}=k_f\cdot C_{{\text{CH}}_2\text{O}};\;\mathrm{otherwise},\;R_{Ar}=k_f\cdot C_{{\text{CH}}_2\text{O}}\cdot\frac{C_{{\text{O}}_2}}{k_{{\text{O}}_2}}$$
(14)

where \({C}_{{\text{O}}_{2}}\) and \({C}_{{\text{CH}}_{2}{\text{O}}}\) represent O2 and CH2O concentrations (mM), respectively; the \({k}_{f}\) is the oxidation constant of CH2O (3.0 × 10−9 s−1), and \({k}_{{\text{O}}_{2}}\) is the limiting O2 concentration (0.008 mM).

The Ni rate is described by the following:

$${R}_{Ni}={k}_{Ni}\cdot {C}_{{\text{NH}}_{4}^{+}}\cdot {C}_{{\text{O}}_{2}}$$
(15)

where \({C}_{{\text{NH}}_{4}^{+}}\) represents NH4+ concentration (mM); the \({k}_{Ni}\) is the rate constant for nitrification (4.8 × 10−4 mM−1 s−1).

The Dn rate is described by,

$$\begin{array}{l}\mathrm{If}\;C_{{\text{O}}_2}\;>\;0.008\;\mathrm{mM},\;R_{Dn}=0;\\\mathrm{If}\;C_{{\text{O}}_2}<0.008\;\mathrm{mM},\;\mathrm{and}\;C_{\text{NO}_3^-}>0.001\;\mathrm{mM},\;R_{Dn}=k_f\cdot C_{{\text{CH}}_2\text{O}}\cdot\left(1-\frac{C_{{\text{O}}_2}}{k_{{\text{O}}_2}}\right);\\\mathrm{If}\;C_{{\text{O}}_2}<0.008\;\mathrm{mM},\;\mathrm{and}\;C_{\text{NO}_3^-}\;<\;0.001\;\mathrm{mM},\;R_{Dn}=k_f\cdot C_{{\text{CH}}_2\text{O}}\cdot\left(1-\frac{C_{{\text{O}}_2}}{k_{{\text{O}}_2}}\right)\cdot\frac{C_{NO_3^-}}{k_{\text{NO}_3^-}}\end{array}$$
(16)

where \({C}_{{\text{NO}}_{3}^{-}}\) is NO3 concentration (mM); \({k}_{N{O}_{3}^{-}}\) is the limiting NO3 concentration (0.001 mM). The reaction rates of CH2O, O2, NO3, and NH4+ can be calculated from Eqs. (1720):

$${r}_{C{H}_{2}O}=\frac{d{C}_{C{H}_{2}O}}{dt}=-{R}_{Ar}-5{R}_{Dn}$$
(17)
$${r}_{{O}_{2}}=\frac{d{C}_{{O}_{2}}}{dt}=-{R}_{Ar}-2{R}_{Ni}$$
(18)
$${r}_{N{O}_{3}^{-}}=\frac{d{C}_{N{O}_{3}^{-}}}{dt}={R}_{Ni}-4{R}_{Dn}$$
(19)
$${r}_{N{H}_{4}^{+}}=\frac{d{C}_{N{H}_{4}^{+}}}{dt}=-{R}_{Ni}$$
(20)

The solute reaction fitting was validated by comparing the simulation results with field data from Kim et al. (2017). This reaction network and parameters were evaluated during this validation process. In addition, the same expression has been used in some studies (Spiteri et al. 2008a, b; Heiss et al. 2017; Kong et al. 2023).

This study set the initial condition to zero for freshwater flow and salt transport, allowing it to reach a quasi-steady state. Once this steady state was reached, we simulated all solutes (CH2O, O2, NO3, NH4+) under the resulting salinity distribution. These solute concentration results were set as the initial condition for the reaction network.

Evaluating indexes

The availability of subsurface barriers is evaluated by λ:

$$\lambda =\frac{\Delta Toe}{To{e}_{0}}$$
(21)

where \(\Delta T{\text{oe}}\) represents the change in saltwater toe locations (m), with negative values indicating a decrease and positive values indicating an increase. \(\Delta T{\text{oe}}\) = Toei − Toe0, where Toei and Toe0 are the toe locations (m) after the construction of subsurface barriers, and it was measured by the position of 50 % salinity interfaces.

We used NO3 removal efficiency (RN) to assess NO3 reduction:

$${R}_{N}=\frac{{m}_{N{O}_{3}^{-}}}{{m}_{in}}$$
(22)
$${m}_{N{O}_{3}^{-}}={\int }_{0}^{t}{\int }_{\Omega }{r}_{N{O}_{3}^{-}}\theta d\Omega dt$$
(23)
$${m}_{in}={\int }_{0}^{t}{\int }_{l}{C}_{0N{O}_{3}^{-}}{f}_{b}dl$$
(24)

where \({m}_{N{O}_{3}^{-}}\) is the total mass of NO3 being removed from denitrification at given period, and min is the total mass of NO3 that is being transported into the aquifer at a given period, where Ω is the domain area, t is the tidal cycle time (12 h), fb is the sea boundary flux (m s−1), \({r}_{N{O}_{3}^{-}}\) is the reaction rate of NO3 (mM s−1), and l is the total length of the sea boundary layer (m).

The denitrification (mDn) and nitrification (mNi) mass of NO3 in the aquifer are as follows:

$${m}_{D{\text{n}}}={\int }_{0}^{t}{\int }_{\Omega }{R}_{D{\text{n}}}\theta d\Omega dt$$
(25)
$${m}_{Ni}={\int }_{0}^{t}{\int }_{\Omega }{R}_{Ni}\theta d\Omega dt$$
(26)

And the compound mass of NO3 (mN) retained in the aquifer is as follows:

$${m}_{N}=B\theta {\iint }_{A}{C}_{N{O}_{3}^{-}}\left(x,z,t\right)dA$$
(27)

where B is the unit width of the aquifer (m), and \({C}_{N{O}_{3}^{-}}\) is the NO3 concentration (mM) of the aquifer.

Results

Model calibration

The data of the flume experiments of Fang et al. (2021) pertains to steady flow over a homogeneous aquifer. Similar to the experiments of Fang et al. (2021), the aquifer model with a fixed water depth is 0.245 m, the domain is 0.45 m deep, and the length was 1.729 m. We conducted as follows: one case was the base case, the other case considered a subsurface dam, and salinity distribution was examined under the tide action. These settings are consistent with Fang et al. (2021) (please refer to Fang et al. (2021) and Table 1 for details).

Figure 2 shows the numerical simulation results for the experimental of Fang et al. (2021) cases. Simulated salinity distribution is matched the experimental in all cases well. The aquifer formation consists of two high salinity zones (USP and SW), with a freshwater discharge zone (FDZ) developed between two high salinity zones (Heiss et al. 2017; Gao et al. 2023). As shown in the experiments, the SW length was limited by the subsurface dam, e.g., the SW distance (Toe location), decreased from 0.75 to 0.4 m. In this numerical study, there was a small discrepancy in the salinity distribution compared to the experimental results, for example, the simulated SW length was 0.745 m, while the experimental was 0.75 m. However, the overall trend of the Toe consistently showed a decrease after the subsurface dam construction; in other words, the SW length decreased from 0.745 to 0.4 m. In addition, the numerical simulation results revealed a wider salt-freshwater mixing zone compared to experimental studies. This discrepancy is likely due to the limitations of the dye tracking method employed in the experiments. Due to the lack of high-resolution imaging, the expansion of the dispersion zone was not captured (Fang et al. 2021).

Fig. 2
figure 2

Experimental (a) (Fang et al. (2021) and these simulated (b) results of no-dam and dam. The horizontal dotted lines represent tidal range, solid white lines indicate numerical results for 50% salinity contours (isohalines) by Fang et al. (2021), and solid black lines indicate 50% salinity contours (isohalines) in these numerical results

To validate the solute reactions model, we simulated the results with the same parameters as Kim et al. (2017) (Table 1) and compared the differences between them. We considered Ar and Dn; the reaction kinetics and parameters were adopted from Kim et al. (2017).

Figure 3 shows the distribution of salinity and O2, and Fig. 4 shows the O2 from in situ measurement (Kim et al. 2017) and our modeled results. As expected, these simulated results accurately reproduced the observed solute distributions. This has a good consistency in both FDZ and mixing areas (Fig. 3), but the simulated salinities are lower than measured salinities (Kim et al. 2017) at x ≈ 143 m. The measured and modeled O2 concentrations were highest near the surface and decreased with increasing depth and seaward distance, but the Kim et al. (2017) results decreased more rapidly than our results (Figs. 3 and 4), e.g., at x = 148.3 m (Fig. 4a), the measured O2 decreased from 77.42 to 7.3 % with the depth increased from 0.6 to 2.2 m, while the modeled O2 decreased from 76 to 34 %; at x = 152.1 m (Fig. 4b), the measured O2 decreased from 81.37 to 7.47 % with the depth increased from 1.0 to 1.6 m, while the modeled O2 decreased from 81.4 to 69.6 %; and at x = 158.6 m (Fig. 4c), the measured and modeled O2 is not much difference (Fig. 4). It is almost likely that this model was simplified without including the fluctuation of the freshwater and sediment heterogeneity. Heterogeneity of coastal aquifers (Heiss et al. 2020; Kreyns et al. 2020) and fluctuations in water tables (Liu et al. 2016) are widespread, with important implications for the hydrodynamics of coastal systems and the NO3 transformation, for example, Heiss et al. (2020) reported that the salt and freshwater interfaces are more irregular under heterogeneous influences and the NO3 reaction is more complex. Moreover, Ni and sulfate reduction were not considered in this study (Kreyns et al. 2020). It is evident that the 2-D numerical model can be used to predict the biogeochemical processes in aquifers.

Fig. 3
figure 3

Measured (a) (Kim et al. 2017) and the simulated results (b) for salinity (a1, b1), O2 (a2, b2), and in (b1) and (b2), the 1-, 10-, and 20-ppt salinity isohalines are shown

Fig. 4
figure 4

Dissolved oxygen (O2) from in situ measurement (Kim et al. 2017) and our model

Influences of the subsurface barriers on SWI and NO3 contamination

The FDZ separated the circulating saltwater into two saline zones (Fig. 5, a1), USP and SW. After constructing the cutoff walls (Fig. 5, a2), the USP significantly increased compared to the condition without walls. As expected, the larger USP further pushed SW towards the ocean, and the SWI distance decreased from 24.2 to 20.5 m; this is mainly due to the construction of the cutoff walls, as the brine infiltrates first along the right side of the wall and subsequently rises on the left side of the wall, which leads to an increase in USP. Figure 5, a3, shows that the subsurface dams effectively prevented SWI; the SW length was limited by subsurface dam, e.g., the SW length decreased from 24.2 to 23 m after the construction of a subsurface dams.

Fig. 5
figure 5

ag The salinity distribution, O2, NH4+, NO3., Ar, Ni, and Dn in the aquifer with no-subsurface barriers, cutoff walls, and subsurface dams (the subsurface barriers located at 23 m with a depth of 4.3 m). The vertical white and black lines indicate the cutoff wall and subsurface dam. The black lines show the simulated 50 % saltwater isohalines, and 10 % and 90 % salinity contours are shown in a1–a3. The magenta lines show the simulated 0.008 mM O2 isohalines in f1–g3

O2 and salinity distributions are consistent in the aquifer because seawater is the only source of O2, and both O2 and salinity decrease with increasing depth and seaward distance (Fig. 5, b1–b3). The deep O2 was mainly consumed by Ar (Fig. 5, e4–e3) and Ni (Fig. 5, f1–f3). Ar distributed in the same pattern as the O2 since both CH2O and O2 are derived from seawater; the reaction rate was the highest in shallow areas where seawater infiltration occurs and reduced with depth. The presence of NH4+ and O2 from different water sources indicates that Ni is related to the size of the mixing zone (the area between 10 and 90 % salinity contours is defined as a mixed zone). Once O2 was completely consumed by Ar and Ni; this created reaction conditions for Dn (Fig. 5, g1–g3), and the remaining CH2O continued along circulating seawater and inflowed the freshwater-saltwater mixing zone along the outer edge of the seawater circulation cell where it encountered NO3. The transition from Ni to Dn occurred near the 0.008-mM O2 contour (Fig. 5, f, g). The Dn rate was the highest along the boundary of SW and decreased along USP to the high tide mark, forming an arc-shaped Dn zone on the interface of the freshwater-saltwater along the out edge of 0.008 mM O2 contour, while Ni took place near the 0.008 mM O2 contour (Fig. 5, f). Thus, the Ni and Dn zones were located on the inner and outer of the 0.008 mM O2 contour, respectively.

As anticipated, the insertion of subsurface barriers caused changes in both reaction and solute distributions. When the cutoff wall was located at x = 23 m, O2 and CH2O distributions followed the same pattern as salinity. Furthermore, saltwater infiltration increased at the USP exhibiting a clear retreat at the SW regions. NO3 and NH4+ along with terrestrial freshwater moved downward around the USP and discharged into the sea. Ni and Dn slightly increased at the out edge of the USP (Fig. 5), while they decreased at the edge of the SW. However, when the subsurface dam was located at x = 23 m, NH4+ climbed upward along the right side of the dam and diffused somewhat on the seaward side of the dam, whereas the subsurface dam limited the diffusion of NO3 at the bottom of the USP, resulting in significantly lower Ni and Dn values at the dams.

We further conducted a quantitative analysis of the impact of subsurface barriers on NO3 contamination in the aquifer. The insertion of cutoff walls improved the NO3 removal efficiency (RN), e.g., the RN is 5.60 % and smaller than that under the wall condition (6.25 %). However, the mN is 4.33 kg smaller than that under the wall condition (4.45 kg) retained in the sandy aquifer; this is because larger USPs pressurize NO3 deeper into the aquifer, resulting in an increased pathway to the sea along the outer edge of the USP and thus increasing the residual mass of NO3. When the dam was located at x = 23 m, and SW length was limited by the subsurface dam, RN decreased and the mass of NO3 retained in the aquifer decreased, e.g., the RN is 4.90 % and smaller than the no-subsurface dam condition (5.60 %), and the mN is 4.25 kg smaller than the no-subsurface dam condition (4.33 kg) retained; this is most likely due to the presence of the dam preventing the downward transport of NO3 and thus reducing the residual amount of NO3.

These suggested that cutoff walls and subsurface dams could mitigate SWI. Cutoff walls enhance both RN and mN, whereas subsurface dams decrease the retained mass of NO3 while also reducing RN.

Influences of the subsurface barriers of location on SWI and NO3 contamination

Figure 6 depicts the impact of subsurface barrier location on salinity and reaction distribution, while Fig. 7 shows the changes in Toe (Fig. 7a, b), RN (Fig. 7c, d), and mN (Fig. 7e, f) under different locations of subsurface barriers. Subsurface barriers with a depth of 4.3 m were placed at x = 17 m, x = 23 m, and x = 26 m. The location of these barriers had a significant impact on salinity distribution. As anticipated, the larger USP further pushes SW towards the ocean, and the USP reaches the largest when the wall is located at 23 m; this is because the walls in the inland direction are only able to resist saltwater intrusion if they reach great depths, whereas impermeable walls in the ocean direction alter the path of freshwater to the sea leading to an increase in SW. The length of saltwater intrusion decreases the closer the local lower dam is to the ocean (Fig. 7, a1–a3).

Fig. 6
figure 6

af The salinity distribution, Ni and Dn with cutoff walls, and subsurface dams (the subsurface barriers located at 17 m, 23 m, and 26 m, the depth of 4.3 m). The vertical white and black lines are the subsurface barriers, the black lines show the simulated 50 % saltwater isohalines, and 10 % and 90 % salinity contours are shown in a1–b3. The magenta lines show the simulated 0.008 mM O2 isohalines in c1–f3

Fig. 7
figure 7

The Toe, RN and mN under different subsurface barrier locations

The location of subsurface barriers had an impact on Ni and Dn. Denitrification was highest along the SW boundary, decreasing towards the USP’s high tide mark. It formed an arc-shaped zone at the interface of saline and freshwater around the outer edge of the 0.008 mM O2 contour. Ni occurred near the 0.008 mM O2 contour (Fig. 6, c–f). It is worth noting that Dn reached a peak when the walls were located at 23 m, and the dams were located at 26 m. This is almost likely because the reaction is dependent on the blending of freshwater and saltwater, which was considerably higher when the walls were positioned at 23 m and the dams at 26 m in comparison to other locations.

We calculated RN and mN for various subsurface barrier positions (Fig. 7) and conducted a quantitative analysis to evaluate their effect on NO3 contamination. Interestingly, when the cutoff walls are located at 23 m, the RN reaches the highest (6.25 %), but the mN reaches the highest (4.45 kg). And the RN increased and mN decreased with the distance increase between the dams and the ocean; when the dams at x = 26 m, the RN and mN reached 5.83 % and 4.17 kg, respectively.

Influences of the subsurface barriers of height on SWI and NO3 contamination

Figure 8 depicts the impact of subsurface barrier height on salinity and reaction distribution, while Fig. 9 shows the changes in Toe (Fig. 9a, b), RN (Fig. 9c, d), and mN (Fig. 9e, f) under different heights of subsurface barriers. We fixed the location of the subsurface barriers at x = 23 m and the subsurface barriers height from 2.3 to 4.3 m. The cutoff walls height impacted the salinity distribution significantly. As expected, the larger USP further pushed SW towards the ocean, and the USP reached the largest under the wall height of 4.3 m, e.g., as the cutoff walls height increased from 2.3 to 4.3 m, the SW distance decreased from 22.68 to 20.5 m (Fig. 9a); this is due to the fact that the deeper cutoff wall carries the brine deeper into the aquifer thereby increasing the USP. And in the subsurface dams at x = 23 m, the SW distance constant with the height of the subsurface dam increased from 2.3 to 4.3 m (Fig. 9b).

Fig. 8
figure 8

af The salinity distribution, Ni and Dn with cutoff walls, and subsurface dams (the subsurface barriers depth is 2.3 m, 3.3 m, and 4.3 m at x = 23 m). The vertical white and black lines indicates the cutoff walls and subsurface dams. The black lines show the simulated 50 % saltwater isohalines, and 10 %, and 90 % salinity contours are shown in a1–b3. The magenta lines show the simulated 0.008 mM O2 isohalines in c1–f3

Fig. 9
figure 9

The Toe, RN, and mN under different subsurface barriers depths

Variations in subsurface barrier heights resulted in changes to both Ni and Dn (Fig. 8, c1–f3). Dn was highest along the boundary of SW, decreasing towards the high tide mark of USP, producing an arc-shaped zone at the interface of freshwater and saltwater around the outer edge of the 0.008-mM O2 contour, as illustrated in Fig. 8, while Ni took place nearby the 0.008-mM O2 contour (Fig. 8). It is worth noting that the Ni and Dn were distributed consistent with the salinity; when the wall height increases, the Dn increased along the boundary of USP and decreased along SW. This is almost likely due to the wall, which increases the size of the USP, further pushing SW towards the ocean. For example, as the height of cutoff walls increased from 0 to 3.3 m, the RN increased from 5.60 to 6.31 % and decreased to 6.25 % when the height of the wall was 4.3 m (Fig. 9c). The Dn decreases with the increase of the height of the dam; this is because the dam limited CH2O and NO3 after the construction of dams, and the limitation enhanced with the height of the dam (Fig. 9d), e.g., as the height of the dam increased from 0 to 4.3 m, the RN decreased from 5.60 to 4.90 %. Interestingly, the mN increased with the wall height increase, e.g., as the wall height increased from 0 to 4.3 m, the mN increased from 4.33 to 4.45 kg (Fig. 9e). However, the mN decreased with the dam height increase (Fig. 9f), e.g., as the dam height increased from 0 to 4.3 m, the mN decreased from 4.33 to 4.25 kg.

The findings indicate that cutoff walls positioned within the intertidal zone can alleviate SWI and increase RN; however, beyond a certain height, RN declined. Nevertheless, following the construction of a cutoff wall, the USP increased significantly compared to the no-wall scenario, which could potentially result in secondary aquifer contamination. While subsurface dams are effective in addressing SWI, they significantly decrease NO3 removal efficiency. Therefore, we propose a novel approach — upper CH2O and lower subsurface dam (UCLD), which controls SWI and reduces NO3 pollution.

Influences of the UCLD on SWI and NO3 contamination

Previous studies have demonstrated the crucial role played by Dn in removing NO3 from freshwater waters to coastal (Kim et al. 2017). They have also identified DOC (CH2O) scarcity as a major impediment to efficient NO3 removal and highlighted that Dn is markedly augmented by increasing DOC (DOM, dissolved organic matter) inputs (Anwar et al. 2014; Heiss 2020). Therefore, we propose a novel approach that involves injecting CH2O into the NO3 distribution area to create a PC-Wall.

The CH2O concentration altered the chemical composition of groundwater in the beach aquifer. First, we fixed the depth of the subsurface dam of 4.3 m at x = 23 m and the PC-Walls with various concentrations (concentrations were 0.2 mM, 0.5 mM, and 1.0 mM, respectively) on the x = 35 m; the PC-Wall depth was 4.3 m (Fig. 10, a–c). Subsequently, a series of the PC-Wall location changes (the PC-Wall location at x = 35 m, 40 m, and 45 m with CH2O concentrations of 1.0 mM) were performed to assess the impact of CH2O location on Dn (Fig. 10, d–f).

Fig. 10
figure 10

af The Dn in the aquifer with different CH2O concentrations and locations (a, b, and c are the CH2O concentrations of 0.2 mM, 0.5 mM, and 1.0 mM at x = 35 m; d, e, and f are the PC-Walls location at 35 m, 40 m and 45 m with CH2O concentrations of 1.0 mM). The vertical red and black lines indicate the PC-Walls and subsurface dams. The magenta lines show the simulated 0.008 mM O2 isohalines

Figure 10 illustrates the impact of CH2O concentration and location on Dn reactions. As discussed in the previous section, a Dn zone takes shape on the freshwater-saltwater interface of the 0.008-mM O2 contour arc outline. The application of CH2O induces additional Dn effects, progressively increasing the Dn rate with increasing CH2O concentrations, e.g., as the CH2O concentration increased from 0 to 1.0 mM, the maximum Dn rate increased from 10 × 10−10 to 3 × 10−9 mM s−1. As PC-Walls penetrate deeper inland, the Dn region gradually expands; this expansion coincides with the location of the PC-Walls (Fig. 10, d–f), e.g., the Dn area extends to x = 45 m when the PC-Walls location at x = 45 m. This is because the CH2O provides reactants for Dn in the anaerobic region and large amounts of CH2O encounter more NO3 inland, leading to a significant increase in Dn.

In order to quantify the impact of CH2O on NO3 contamination in sandy aquifers, we performed calculations for mDn and mN at various CH2O concentrations and locations (Fig. 11). As expected, the mDn increased with the CH2O concentration (Fig. 11a), e.g., as the CH2O concentration increased from 0 to 1.0 mM, the mDn increased from 0.04 to 0.817 g m−1, a 1942.5 % increase; however, the mN decreased from 4.25 to 3.93 kg, a 7.53 % decrease. This is due to the fact that higher concentrations of CH2O provide more reactants, which in turn lead to further enhancement of Dn. In addition, the mDn increased with the PC-Wall distance from the sea boundary (Fig. 11b), and the mN decreased (Fig. 11c), e.g., as the distance increased from 35 to 45 m, the mDn increased from 0.817 to 1.664 g m−1, a 103.7 % increase; however, the mN decreased from 3.93 to 3.47 kg, a 11.7 % decrease. This is due to the fact that the CH2O injection location is closer inland; the more CH2O comes into contact with NO3 leading to a larger denitrification zone and further enhancement of Dn.

Fig. 11
figure 11

The mDn and mN under different CH2O concentrations and locations

There results indicated the importance of PC-Walls for NO3 pollution in beach aquifers; CH2O altered the chemical composition of groundwater. Thus, we proposed this new method (UCLD) that not only controls SWI but also promotes greater NO3 removal and significantly decreases the compound mass of NO3 retained in the aquifer.

Discussion

In this study, we first evaluated the impact of subsurface barriers on NO3 contamination levels and SWI distances within a sandy aquifer. We subsequently propose a hybrid technique for deploying subsurface dams and PC-Walls that can both control SWI and mitigate NO3 pollution.

Over the past few years, SWI has become widespread, prompted by population expansion and economic growth. Cutoff walls and subsurface dams are currently the most common strategies employed in numerous coastal countries to mitigate SWI, and several previous reports have addressed the effectiveness of subsurface barriers when deployed to hinder them (Kang et al. 2021). We investigated the impact of various cutoff wall locations and depths on salinity distribution and suggested that the most effective method for controlling SWI was achieved with a cutoff wall depth of 4.3 m at x = 23 m. This is a wall located at 23 m and a depth of 4.3 m, resulting in a larger USP and further pushing the SW towards the ocean. It is therefore clear that only installing cutoff walls at the tidal range can effectively resist SWI, this is consistent with Shen et al. (2020), which showed that the subsurface barrier inland on SWI was no longer evident compared to no-tide condition. It is worth noting that, after a cutoff wall was constructed, the USP was significantly larger than that of the no-wall condition; this is likely to lead to secondary contamination of the aquifer, for example, when a storm surge occurs nearshore, it transports salt deeper aquifer. Moreover, this study demonstrated the influence of subsurface dams on SWI in the unconfined nearshore aquifer, e.g., the Toe reduced from 24.2 to 23 m with the dam at x = 23 m, and the Toe reduced from 23 to 17 m with the dam moved from x = 23 to 17 m.

In addition to SWI, aquifers in coastal areas worldwide face serious NO3 pollution. Thus, we analyzed different cutoff wall and subsurface dam locations and depths on the NO3 pollution. The highest Dn was observed along the boundary of SW and decreased along USP toward the high tide mark, forming an arc-shaped Dn zone on the interface of the freshwater-saltwater along the out edge of 0.008 mM O2 contour. Ni took place nearby the 0.008-mM O2 contour. Ni and Dn were changed with the subsurface barrier location, and the depth varied. We analyzed different cutoff wall locations and depths on the NO3 pollution and suggested the removal of NO3 was the most significant when the wall location at 23 m, increased with the depth of the wall from 2.3 to 3.3 m and decreased under the wall height was 4.3 m. However, the mN increased with the wall height increase. Interestingly, our results demonstrated the RN decrease with the dam height increase, e.g., the RN decreased from 5.60 to 4.90 % with the dam depth increase to 4.3 m at x = 23 m, and mN only decreased by 1.85 %. A number of previous studies have been reported, for example, Sun et al. (2021) showed that upstream NO3 concentration increased remarkably after subsurface dam construction. Undoubtedly, this leads to a large amount of NO3 into the ocean and takes a turn for the worse for the marine environment.

Our study revealed a positive correlation between Dn rates and CH2O concentrations in the treatment area, with Dn areas expanding toward PC-Wall locations. On the one hand, CH2O provides the reactant for Dn, and a large amount of CH2O encountered more NO3; the Dn rate and area increase with CH2O concentration and CH2O diffusion area in an inland anaerobic environment. On the other hand, the CH2O driven by inland freshwater was discharged between the USP and SW, increasing the Ar and limiting the Ni, e.g., the mNi decreased from 0.369 to 0.345 g m−1 with a CH2O increase of 1.0 mM at x = 35 m. It is worth noting that, after a PC-Wall was constructed, the mDn was significantly larger than that of the no PC-Wall condition, e.g., the mDn increased 1942.5 % with the CH2O increase to 1.0 mM at x = 35 m. Interestingly, the construction of a PC-Wall resulted in a significant shift from dominant Ni to dominant Dn, e.g., the mDn was 0.04 g m−1 smaller than mNi (0.369 g m−1) at the no PC-Wall condition, and the mDn was 0.817 g m−1 larger than mNi (0.345 g m−1) at the PC-Wall (1.0 mM) condition. This finding bears significant implications for NO3 pollution treatment.

Thus, using subsurface dams to prevent the SWI, at the same time, coastal managers can make PC-Wall out of organic waste such as animal remains and plant leaves; this approach not only solved organic waste but also yields an important PC-Wall to promote more Dn. In a word, we proposed this new method (UCLD) that not only controls SWI but also promotes greater NO3 removal. However, the design of the PC-Walls and dams process should carefully consider the location and depth and thus balance the effectiveness and engineering cost.

Conclusion

Variable-density flow, solute transport, and biogeochemical modeling were utilized to examine the impact of cutoff walls, subsurface dams, and CH2O on both SWI and NO3-cycling in sandy coastal aquifers under tidal influence. We compared the relative effectiveness of cutoff walls and subsurface dams and also explored the potential of our new method. The key results of our study are presented below:

  1. (1)

    Construction of cutoff walls at the intertidal zone can help mitigate SWI and increase RN; however, as the walls reach increasing heights, the RN decreases progressively. While subsurface dams remain a useful option for addressing SWI, their effectiveness in reducing NO3 significantly declines.

  2. (2)

    A new approach, called the Upper PC-Walls and Lower Subsurface Dams (UCLD) approach, mitigates SWI while simultaneously reducing NO3 pollution. Subsurface dams are an effective method to manage SWI, while upper PC-walls significantly enhance NO3-removal efficiency.

  3. (3)

    A transition from dominance in Ni to dominance in Dn once a 1.0-mM PC-Wall was established. As the CH2O concentration increased from 0 to 1.0 mM, the mDn increased 1942.5 %, and as the distance increased from 35 to 45 m, the mDn increased from 0.817 to 1.664 g m−1, a 103.7 % increase, and the mN decreased from 3.93 to 3.47 kg. We should try our best to build the dams on the seaside and the PC-Walls inland, to better control SWI and decrease the NO3 pollution.