Introduction

Water is the lifeline of all living organisms in the world. Water sustains and connects different ecosystems, nurtures flora, provides shelter to countless species. Human species success over other species is partly attributed to its capability to use this precious resource to the fullest. Unfortunately, the same human interference is making water unsuitable for sustenance and therefore, seriously affecting all life forms. Worldwide there are various incidents of contaminants polluting fresh water sources. The adulteration process, toxicity level of pollutants and the affected population are of particular interest to the researcher as those phenomena have a widespread effect. The unscientific use of abundant resources of endangered mangrove ecosystem in various parts of the world is attracting scientific communities attention, as a mangrove ecosystem holds utmost significance in delicate ecological inter-relations (Clarke et al 2015; Kabir and Iva 2014; Hoq 2007; Hossain et al 2013; Das et al 2016). It is absolutely crucial to develop scientific models to simulate those hazards of modern-day living in order of to diminish their effect. In the face of global warming and climate change there is a surge of severe cyclonic storms and accompanying high tidal waves submerging the inland in saline water. The salinization of groundwater, fertile farmland and freshwater lakes are of major concern (Rabbani et al 2013). Excess salt in soil prevents the plant to take in water via osmosis as the the flow of water gets reversed. Plant growth is severely crippled resulting in low yield. Sometimes salt-tolerant weeds take over the farmland. Salinity in soil also disrupts the nitrogen cycle, soil respiration and discomposing capability of microbes. Severe salinization leads to desertification and consequently poverty and migration of a large number of people dependent on the land (Hassani et al 2020). Overall the effect of slow and continuous invasion of salt in rice field is long-lasting unless some external measures are taken to minimize the impact of salinity. The severity of soil salinization and the aftermath has triggered a vast amount of deliberation from various fields (Morshed et al 2020; Mandal et al 2019; Yusuf et al 2020; Habibi et al 2021; Singh et al 2018; Patle et al 2017). Some are exclusively focused on physical and chemical properties of soil (Bresler et al 1982; Gurung and Azad 2013). There are detailed case studies from noted non-profit organizations (Tre et al 2016; Vargas et al 2018). Assimilation of hands-on knowledge with mathematical modeling is the need of the moment. In this direction, it is important to study the flow of saline water through seepage. The traditional way of measurement of soil salinity is by measurement of electrical conductivity. The construction and study of a suitable mathematical model can offer a reliable alternative.

Modeling using mathematical equation has some diverse applications (Das et al 2021b, a, c). The dynamics of contaminant flow in soil is investigated using different types of mathematical models. Modeling of soil salinity using artificial satellite data is a combination of field survey and remote sensing technology. Researchers like Asfaw et al (2018), Al-Ali et al (2021) and Alqasemi et al (2021) have utilized this ultra-modern technology to locate areas of notable salinity and the extent of salinization. Indiscriminate use of chemical fertilizers has resulted in nitrate infiltration in ground water, soil and crop. Marinov and Marinov (2014) proposed a coupled model using partial differential equation which describes the physical transfer of the water and nitrogen compounds in a soil-water-plant-groundwater system. It estimates the potential vulnerability of the study area to nitrogen pollution.The study showed that optimizing nitrate fertilization schedule in sync with the corn life cycle reduces groundwater contamination. Wahid et al (2007) discussed different natural and external factors influencing hydrology of Sundarban mangrove ecology. They used mathematical modelling to simulate water flow and salinity level in the river system of the area. Marusic (2013) reviewed some scientific work in the field of river pollution. The article demonstrates versatile use mathematical modeling of hydrodynamics and pollutant dispersion in ‘river-type’ systems. The mathematical tools are systems of algebraic equations, ordinary differential equations, partial differential equations which are solved by numerical methods. Li et al (2015) used simulation software to model the one-dimensional flow of the soil water and water intake of plant root in an arid wetland with shallow saline groundwater. The study established the importance of controlled irrigation before farming season. Pochai and Pongnoo (2012) have developed a mathematical model using partial differential equation of saline water flow in rice field near marine shrimp farm. The numerical solution of the model shows salinity concentration of soil at different positions. Here two mathematical models describe the flow of water through porous soil adjacent to shrimp farm and dispersion of soil respectively. The two-dimensional advection–dispersion equation is used in the dispersion model. The numerical results are provided for the dispersion model using finite difference method.

Most of the scientific studies conducted on salinity progression are area specific and based on data collected in the affected area. Some are based on application of simulation software or numerical methods. Analytical solution, though difficult to obtain, can offer an alternative look in the model in question and may provide useful prediction in case of alteration in parameters or layout of studied area. It can also propose significant adaptations which can diminish the effect of contaminants in soil. With those objectives we derive analytical solution of the model system proposed by Pochai and Pongnoo (2012) with modification in boundary conditions, using separation of variable method (Strauss 2007). Keeping in mind the impact of temperature on diffusion coefficient, we study the change in salinity level under different temperature. An adjustable factor in the layout of the model is length of boundary wall between shrimp farm and the paddy field. We investigate the impact the altered length of boundary on farm salinity level.

First of all, a stream function model is built in addition to the potential flow model and the soil salinity model already available. The analytical results of potential flow model and stream function model are obtained. This two solutions are used to obtain the analytic solution of dispersion model. The analytic solutions are compared with numerical solutions in the next section. Following this, change in temperature and layout is proposed and their influence on salt infiltration is demonstrated using illustrations and data. The paper ends with a brief discussion in the final section.

Model formulation and mathematical analysis

Fig. 1
figure 1

Diagram of cross section of soil below the field and shrimp farm

Here the vertical rectangular cross section (Fig. 1) of the soil underneath the shrimp farm and adjacent rice field separated by a guard wall is considered. The depth of cross section is 50 m, the width of shrimp farm, guard wall and rice field are 40 m, 5 m and 55 m, respectively. Salt water in marine shrimp farm get soaked into the ground. It seeps through pores of the soil and becomes the groundwater. The groundwater moves through the aquifer as seepage flow. Velocity of the groundwater motion is defined as the rate of volume (\(m^3/s\)) divided by the cross section (\(m^2\)) consisting of the soil and pores of the soil matrix.

Method

Assuming the fluid to be incompressible, Stoke’s flow is applicable, as the velocity of the seepage flow is minimal. Using Darcy’s Law of porous medium (Yeh et al 2015) in steady state, we present the following two equations

$$\begin{aligned} p_{x}= & {} -k\frac{\partial \mathcal {H}}{\partial x}\\ p_{z}= & {} -k\frac{\partial \mathcal {H}}{\partial y} \end{aligned}$$

where \( p_{x}\) and \( p_{z} \) are specific discharge in direction of x and z axes, respectively. k is hydraulic conductivity of porous media and \( \mathcal {H} \) is the hydraulic head. Now we consider \(-k \mathcal {H} \) as the hydraulic potential \( \Phi \) and get the following set of equations

$$\begin{aligned} p_{x}= & {} \frac{\partial \Phi }{\partial x} \end{aligned}$$
(1)
$$\begin{aligned} p_{z}= & {} \frac{\partial \Phi }{\partial z}. \end{aligned}$$
(2)

Using the incompressibility property of groundwater we get the equation of continuity

$$\begin{aligned} \frac{\partial p_{x}}{\partial x} +\frac{\partial p_{z}}{\partial z}=0 \end{aligned}$$
(3)

which after substitution from Eqs. (1) and (2) becomes

$$\begin{aligned} \frac{\partial ^2\Phi }{\partial x^2}+\frac{\partial ^2\Phi }{\partial z^2}=0. \end{aligned}$$
(4)

Lines of equal hydraulic heads are called equipotential lines and the flow takes place in the perpendicular direction of those lines. Those perpendicular lines are called streamlines. Together equipotential lines and streamlines construct the flownet which gives us a complete picture of nature of laminar flow. The relation between potential flow function \( \Phi \) and stream function \( \Psi \) is given by

$$\begin{aligned} \begin{aligned} p_{x}&=\frac{\partial \Phi }{\partial x}=&\frac{\partial \Psi }{\partial z}\\ p_{z}&=\frac{\partial \Psi }{\partial x}=&-\frac{\partial \Phi }{\partial z} \end{aligned} \end{aligned}$$
(5)

which also gives another Laplace equation

$$\begin{aligned} \frac{\partial ^2\Psi }{\partial x^2}+\frac{\partial ^2\Psi }{\partial z^2}=0. \end{aligned}$$
(6)
Fig. 2
figure 2

Methodology flowchart

The Neumann boundary conditions of potential flow equation becomes Dirichlet boundary condition. To calculate the salinity level (\(\mathcal {C}(x,z)\)) mathematically we first solve the potential flow equation and the steam function equation separately using the separation of variable method. Next we introduce the advection–dispersion equation for salinity model as proposed by Pochai and Pongnoo (2012). The equation is

$$\begin{aligned} \mathcal {D}\Big [\frac{\partial ^{2}\mathcal {C}}{\partial x^{2}}+\frac{\partial ^{2}\mathcal {C}}{\partial z^{2}}\Big ]+p_{x}(x,z)\frac{\partial \mathcal {C}}{\partial x}+p_{z}(x,z)\frac{\partial \mathcal {C}}{\partial z}=0 \end{aligned}$$
(7)

where \(\mathcal {C}(x,z)\) is salinity at (xz). We convert \(\mathcal {C}(x,z)\) to \(\mathcal {C}(\Phi ,\Psi )\) using chain rule and system (5). The modified equation is solved using separation of variable method. The steps followed in this article can be illustrated by the Fig. 2.

Solution of potential flow model

Following Pochai and Pongnoo (2012) we can treat the groundwater flow as a potential flow satisfying Laplace Equation

$$\begin{aligned} \frac{\partial ^2\Phi }{\partial x^2}+\frac{\partial ^2\Phi }{\partial z^2}=0 \end{aligned}$$
(8)

with the following boundary conditions

$$\begin{aligned}&\left. \begin{array}{l} \frac{\partial \Phi }{\partial x}(0,z) =0 \\ \frac{\partial \Phi }{\partial x}(100,z) = 0\end{array}\right\} z\in [0,50] \end{aligned}$$
(9)
$$\begin{aligned}&\quad \frac{\partial \Phi }{\partial z}(x,50)=0 \,\forall x\in [0, 100] \end{aligned}$$
(10)
$$\begin{aligned}&\quad \Phi (x,0)={\left\{ \begin{array}{ll} 1, &{} 0\le x\le 40, \\ 9-\frac{x}{5}, &{} 40<x<45,\\ 0, &{} 45\le x\le 100 \end{array}\right. } \end{aligned}$$
(11)

The depth of pond is taken 1m according to the standard practice (Biswas and Kumar 2015). It is assumed that \(\Phi (x,0)\) is only first degree linear function of x in (40, 45). Assuming

$$\begin{aligned} \Phi (x,z)=f_{1}(x)g_{1}(z) \end{aligned}$$

substituting in (8) we get

$$\begin{aligned} \frac{f_{1}^{\prime \prime }}{f_{1}}=-\frac{g_{1}^{\prime \prime }}{g_{1}}=\kappa (\text {constant}). \end{aligned}$$

Considering the cases where \(\kappa =0\) and \(\kappa =\lambda ^{2}\), we find the solutions to be not feasible. Let us consider the case where \(\kappa =-\lambda ^{2}\), which gives the solution as

$$\begin{aligned} \Phi (x,z)=(A\cos \lambda x+B\sin \lambda x)(Ce^{\lambda z}+De^{-\lambda z}) \end{aligned}$$

where ABCD are arbitrary constants to be determined by boundary conditions. Condition (9) gives \(B=0\) and \(\lambda =\frac{n\pi }{100}, n=0, 1, 2, \dots \), which implies the solution is of the form

$$\begin{aligned} \Phi (x,z)=\cos \lambda _{n} x(C_{n}^{\prime }e^{\lambda _{n} z}+D_{n}^{\prime }e^{-\lambda _{n} z}). \end{aligned}$$

From (10) we get \(D_{n}^{\prime }=C_{n}^{\prime }e^{n\pi }.\) The general solution is

$$\begin{aligned} \Phi (x,z)=\sum _{n=0}^{\infty }C_{n}^{\prime }\cos \lambda _{n} x(e^{\lambda _{n} z}+e^{n\pi }e^{-\lambda _{n} z}) \end{aligned}$$

or,

$$\begin{aligned} \Phi (x,z)=\sum _{n=0}^{\infty }C_{n}^{\prime }\cos \frac{n\pi x}{100} \big (e^{\frac{n\pi z}{100}}+e^{n\pi }e^{-\frac{n\pi z}{100}} \big ) \end{aligned}$$
(12)

which implies

$$\begin{aligned} \Phi (x,0)=\sum _{n=0}^{\infty }C_{n}^{\prime } \big (1+e^{n\pi }\big )\cos \frac{n\pi x}{100}. \end{aligned}$$
(13)

A half-range Fourier Cosine Series \(\sum _{n=0}^{\infty }P_{n}\cos \frac{n\pi x}{100}\) is obtained by taking \(P_{n}=C_{n}^{\prime } \big (1+e^{n\pi }\big ).\) Solving for \(P_{0}\) and \(P_{n}\) with usual formula we get

$$\begin{aligned} \Phi (x,0)=\frac{P_{0}}{2}+\sum _{n=1}^{\infty }P_{n}\cos \frac{n\pi x}{100} \end{aligned}$$

where

$$\begin{aligned} P_{0}=0.85~ \text {and}~ P_{n}=\frac{40}{n^{2}\pi ^{2}}\cos \frac{2n\pi }{5}-\frac{40}{n^{2}\pi ^{2}}\cos \frac{9n\pi }{20}. \end{aligned}$$
(14)

Using these values to find \(C_{n}^{\prime }\), we obtain the solution of Potential Flow Model as

$$\begin{aligned} \Phi (x, z)=0.425+\sum _{n=1}^{\infty }\Big (\frac{40}{n^{2}\pi ^{2}}\cos \frac{2n\pi }{5}-\frac{40}{n^{2}\pi ^{2}}\cos \frac{9n\pi }{20}\Big )\frac{\cos \frac{n\pi x}{100} (e^{\frac{n\pi }{100} z}+e^{n\pi }e^{-\frac{n\pi }{100} z})}{(1+e^{n\pi })} \end{aligned}$$
(15)

Solution of stream function model

The stream function model is

$$\begin{aligned} \frac{\partial ^2\Psi }{\partial x^2}+\frac{\partial ^2\Psi }{\partial z^2}=0 \end{aligned}$$
(16)

with the following boundary conditions

$$\begin{aligned}&\left. \begin{array}{l} \Psi (0,z) =0 \\ \Psi (100,z) = 0\end{array}\right\} z\in [0,50] \end{aligned}$$
(17)
$$\begin{aligned}&\quad \Psi (x,50)=0 \,\forall x\in [0, 100] \end{aligned}$$
(18)
$$\begin{aligned}&\quad \Psi (x,0)={\left\{ \begin{array}{ll} 0.00074x^2-0.0046x, &{} 0\le x\le 40, \\ 1, &{} 40\le x<45,\\ 0.000412x^2-0.779146x+3.67146, &{} 45\le x\le 100 \end{array}\right. } \end{aligned}$$
(19)

It is assumed that \(\Psi (x,0)\) is only quadratic function of x in (0, 40) and (45, 100). Assuming

$$\begin{aligned} \Psi (x,z)=f_{2}(x)g_{2}(z) \end{aligned}$$

substituting in (16) we get

$$\begin{aligned} \frac{f_{2}^{\prime \prime }}{f_{2}}=-\frac{g_{2}^{\prime \prime }}{g_{2}}=\kappa ( \text {constant}). \end{aligned}$$

Considering the cases where \(\kappa =0\) and \(\kappa =\lambda ^{2}\), we find the solutions to be not feasible. Let us consider the case where \(\kappa =-\lambda ^{2}\), that gives the solution as

$$\begin{aligned} \Psi (x,z)=(A\cos \lambda x+B\sin \lambda x)(Ce^{\lambda z}+De^{-\lambda z}) \end{aligned}$$

where ABCD are arbitrary constants to be determined by boundary conditions. Condition (17) gives \(A=0\) and \(\lambda =\frac{n\pi }{100}, n=0, 1, 2, \cdots \), which implies the solution is of the form

$$\begin{aligned} \Psi (x,z)=\sin \lambda _{n} x(C_{n}^{\prime }e^{\lambda _{n} z}+D_{n}^{\prime }e^{-\lambda _{n} z}). \end{aligned}$$

From (18) we get \(D_{n}^{\prime }=-C_{n}^{\prime }e^{n\pi }.\)The general solution is

$$\begin{aligned} \Psi (x,z)=\sum _{n=0}^{\infty }C_{n}^{\prime }\sin \lambda _{n} x(e^{\lambda _{n} z}-e^{n\pi }e^{-\lambda _{n} z}) \end{aligned}$$

or,

$$\begin{aligned} \Psi (x,z)=\sum _{n=0}^{\infty }C_{n}^{\prime }\sin \frac{n\pi x}{100} \left( e^{\frac{n\pi z}{100}}-e^{n\pi }e^{-\frac{n\pi z}{100}} \right) \end{aligned}$$
(20)

which implies

$$\begin{aligned} \Psi (x,0)=\sum _{n=0}^{\infty }C_{n}^{\prime } \big (1-e^{n\pi }\big )\sin \frac{n\pi x}{100}. \end{aligned}$$
(21)

A half-range Fourier Sine Series \(\sum _{n=1}^{\infty }Q_{n}\sin \frac{n\pi x}{100}\) is obtained by taking \(Q_{n}=C_{n}^{\prime } \big (1-e^{n\pi }\big ).\) Solving for \(Q_{n}\) with usual formula we get

$$\begin{aligned} \Psi (x,0)=\sum _{n=1}^{\infty }Q_{n}\sin \frac{n\pi x}{100} \end{aligned}$$

where

$$\begin{aligned} Q_{n}=\frac{2}{n\pi }\left[ \frac{5.49}{n\pi }\sin \frac{2n\pi }{5}+\frac{14.8}{n^2\pi ^2}\cos \frac{2n\pi }{5}+\frac{3.99346}{n\pi }\sin \frac{9n\pi }{20}-\frac{8.24}{n^2\pi ^2}\cos \frac{9n\pi }{20}-\frac{14.8}{n^2\pi ^2}+(-1)^n\frac{8.24}{n^2\pi ^2}\right] . \end{aligned}$$
(22)

Using these values to find \(C_{n}^{\prime }\), we obtain the solution of Stream Function Model as

$$\begin{aligned} \begin{aligned} \Psi (x, z)=\sum _{n=1}^{\infty }\Bigg [\frac{5.49}{n\pi }\sin \frac{2n\pi }{5}+\frac{14.8}{n^2\pi ^2}\cos \frac{2n\pi }{5}+\frac{3.99346}{n\pi }\sin \frac{9n\pi }{20}-\frac{8.24}{n^2\pi ^2}\cos \frac{9n\pi }{20}-\frac{14.8}{n^2\pi ^2}\\+\,(-1)^n\frac{8.24}{n^2\pi ^2}\Bigg ]\frac{2\sin \frac{n\pi x}{100} (e^{\frac{n\pi }{100} z}-e^{n\pi }e^{-\frac{n\pi }{100} z})}{n\pi (1-e^{n\pi })} \end{aligned}\end{aligned}$$
(23)

Solution of soil salinity model

Now we consider Eq. (7) where \(\mathcal {D}\) is the Coefficient of Diffusion of NaCl(common salt) in water at \(25^\circ C\). The boundary conditions are

$$\begin{aligned}&\left. \begin{array}{l} \frac{\partial \mathcal {C}}{\partial x}(0,z) =0 \\ \frac{\partial \mathcal {C}}{\partial x}(100,z) = 0\end{array}\right\} z\in [0,50] \end{aligned}$$
(24)
$$\begin{aligned}&\quad \frac{\partial \mathcal {C}}{\partial z}(x,50)=0 \,\forall x\in [0, 100] \end{aligned}$$
(25)
$$\begin{aligned}&\quad \mathcal {C}(x,0)={\left\{ \begin{array}{ll} 25, &{} 0\le x\le 40, \\ 0, &{} 40<x<45, \end{array}\right. } \end{aligned}$$
(26)
$$\begin{aligned}&\quad \frac{\partial \mathcal {C}}{\partial z}(x, 0)=0, 45\le x\le 100 \end{aligned}$$
(27)

For shrimp cultivation the optimum salinity is 15–25 parts per trillion (ppt) (Biswas and Kumar 2015). In our model, the brackish water is obtained by pumping seawater into the pond and therefore we consider the salinity on pond bottom(\( \mathcal {C}(x,0) \)) as 25 ppt for \( 0\le x\le 40 \). The transformed equation is

$$\begin{aligned} \mathcal {D}\left[ \frac{\partial ^{2}\mathcal {C}}{\partial \phi ^{2}}+\frac{\partial ^{2}\mathcal {C}}{\partial \psi ^{2}}\right] +\frac{\partial \mathcal {C}}{\partial \phi }=0 \end{aligned}$$
(28)

Let

$$\begin{aligned} \mathcal {C}(\phi ,\psi )=f_{3}(\phi )g_{3}(\psi ). \end{aligned}$$

Then,

$$\begin{aligned} \mathcal {D}f_{3}^{\prime \prime }g_{3}+\mathcal {D}g_{3}^{\prime \prime }f_{3}+f_{3}^{\prime }g_{3}=0 \end{aligned}$$

which implies,

$$\begin{aligned} \mathcal {D}\frac{f_{3}^{\prime \prime }}{f_{3}}+\frac{f_{3}^{\prime }}{f_{3}}=-\mathcal {D}\frac{g_{3}^{\prime \prime }}{g_{3}}=\kappa (\text {constant}) \end{aligned}$$

with additional boundary conditions on \(\phi \) and \(\psi \) stated in previous two segments. It can be verified that for the cases \(\kappa =0\) and \(\kappa =-\lambda ^2\) a solution satisfying the boundary conditions is not possible. So, we proceed to the case when, \(\kappa =\lambda ^2\) which gives us two equations

$$\begin{aligned} \mathcal {D}\frac{f_{3}^{\prime \prime }}{f_{3}}+\frac{f_{3}^{\prime }}{f_{3}}=\lambda ^2\end{aligned}$$
(29)

and

$$\begin{aligned} \mathcal {D}\frac{g_{3}^\prime }{g_{3}}=-\lambda ^2.\end{aligned}$$
(30)

Solving Eq. (29) we get \(f_{3}(\phi )=Ae^{\alpha \phi }+Be^{\beta \phi }\), where \(\alpha =\frac{-1+\sqrt{1+4\mathcal {D}\lambda ^2}}{2\mathcal {D}}\) and \(\beta =\frac{-1-\sqrt{1+4\mathcal {D}\lambda ^2}}{2\mathcal {D}}\) where AB are arbitrary constants. Similarly solving Eq. (30) we obtain \(g_{3}(\psi )=P\cos \frac{\lambda }{\sqrt{\mathcal {D}}}\psi +Q\sin \frac{\lambda }{\sqrt{\mathcal {D}}}\psi \) where P,Q are arbitrary constants . These imply

$$\begin{aligned} \mathcal {C}(\phi ,\psi )=\Big (Ae^{\alpha \phi }+Be^{\beta \phi }\Big )\Big (P\cos (\frac{\lambda \psi }{\sqrt{\mathcal {D}}})+Q\sin (\frac{\lambda \psi }{\sqrt{\mathcal {D}}})\Big ). \end{aligned}$$
(31)

Using chain rule \(\frac{\partial \mathcal {C}}{\partial x}\) and \(\frac{\partial \mathcal {C}}{\partial z}\) are calculated. Applying the boundary conditions \(\frac{\partial \mathcal {C}}{\partial x}(0,z)=\frac{\partial \phi }{\partial x}(0,z)=\psi (0,z)=0\) it is proved that \(Q=0\) which means,

$$\begin{aligned} \mathcal {C}(\phi ,\psi )=\cos \left( \frac{\lambda \psi }{\sqrt{\mathcal {D}}}\right) \left( A^{\prime }e^{\alpha \phi }+B^{\prime }e^{\beta \phi }\right) . \end{aligned}$$

This form of solution satisfies the boundary conditions \(\frac{\partial \mathcal {C}}{\partial x}(100,z)=\frac{\partial \mathcal {C}}{\partial x}(50,z)=0.\) In the boundary line segment \(z=0\), \(40\le x <45\) the conditions are \(\mathcal {C}=\frac{\partial \phi }{\partial z}=0,\psi =1\). When applied, those conditions yield \(\cos (\frac{\lambda }{\sqrt{\mathcal {D}}})=0\) that is \(\lambda _{n}=(2n+1)\sqrt{\mathcal {D}}\frac{\pi }{2}, n=0,1,2,3\cdots .\) The solution for \(\mathcal {C}\) will come in terms of \(\phi \) and \(\psi \), both being infinite series we take only \(n=0\) for \(\lambda _{n} \). Taking \(\lambda =\sqrt{\mathcal {D}}\frac{\pi }{2}\) the solution takes the form

$$\begin{aligned} \mathcal {C}(\phi ,\psi )=\cos \Big (\frac{\pi \psi }{2}\Big )\Big (A^{\prime }e^{\alpha \phi }+B^{\prime }e^{\beta \phi }\Big ).\end{aligned}$$
(32)

where \(\alpha =\frac{-1+\sqrt{1+\mathcal {D}^2\pi ^2}}{2\mathcal {D}}\) and \(\beta =\frac{-1-\sqrt{1+\mathcal {D}^2\pi ^2}}{2\mathcal {D}}.\) In the boundary line segment \(z=0,45<x\le 100,\) the conditions are \( \frac{\partial \mathcal {C}}{\partial z}=\frac{\partial \Phi }{\partial z}=\Phi (x,z)=0 \) which gives the equation

$$\begin{aligned} A^{\prime }\alpha +B^{\prime }\beta =0 \end{aligned}$$
(33)

from Eq. (32). As \(\mathcal {C}=25, \phi =1,\) \(\frac{\partial \Psi }{\partial z}=0\) and \(\Psi =0.00074x^2-0.0046x\) in the line segment \(z=0, 0\le x\le 40\) Eq. (32) leads to

$$\begin{aligned} \cos \left( \frac{\pi 0.00074x^2-\pi 0.0046x}{2}\right) \Big (A^{\prime }e^{\alpha }+B^{\prime }e^{\beta }\Big )=25.\end{aligned}$$
(34)

We simplify the condition by integrating both sides from 0 to 40 with respect to x and obtain

$$\begin{aligned} \Big (A^{\prime }e^{\alpha }+B^{\prime }e^{\beta }\Big )=\frac{125\pi }{4}.\end{aligned}$$
(35)

Solving (33) and (35) we get

$$\begin{aligned} A^{\prime }=\frac{125\beta }{4\Big (\beta e^{\alpha }-\alpha e^{\beta }\Big )}\end{aligned}$$
(36)

and

$$\begin{aligned} B^{\prime }=-\frac{\alpha A^{\prime }}{\beta }.\end{aligned}$$
(37)

The solution for \(\mathcal {C}\) is given by the Eqs. (32), (36), (37), (15) and (23).

Solution of the model system taking 10 m guard wall length and 50 m rice field length

In this segment we state the solution without derivation of the same model system with 10 m guard-wall length and 50 m rice field length. The solution is obtained in the same way as in the previous subsections. The model with new boundary conditions and solution stated below is used later in the study of temperature and barrier length difference.

Potential Flow Model

$$\begin{aligned} \frac{\partial ^2\Phi }{\partial x^2}+\frac{\partial ^2\Phi }{\partial z^2}=0 \end{aligned}$$

with boundary conditions

$$\begin{aligned}&\left. \begin{array}{l} \frac{\partial \Phi }{\partial x}(0,z) =0 \\ \frac{\partial \Phi }{\partial x}(100,z) = 0\end{array}\right\} z\in [0,50] \\&\quad \frac{\partial \Phi }{\partial z}(x,50)=0 \,\forall x\in [0, 100] \\&\quad \Phi (x,0)={\left\{ \begin{array}{ll} 1, &{} 0\le x\le 40, \\ 5-\frac{x}{10}, &{} 40<x<50,\\ 0, &{} 50\le x\le 100 \end{array}\right. } \end{aligned}$$

Solution:

$$\begin{aligned} \Phi (x, z)=\frac{9}{20}+\sum _{n=1}^{\infty }\Big (\frac{20}{n^{2}\pi ^{2}}\cos \frac{2n\pi }{5}-\frac{20}{n^{2}\pi ^{2}}\cos \frac{n\pi }{2}\Big )\frac{\cos \frac{n\pi x}{100} (e^{\frac{n\pi }{100} z}+e^{n\pi }e^{-\frac{n\pi }{100} z})}{(1+e^{n\pi })} \end{aligned}$$
(38)

Stream Function Model

$$\begin{aligned} \frac{\partial ^2\Psi }{\partial x^2}+\frac{\partial ^2\Psi }{\partial z^2}=0 \end{aligned}$$

with the following boundary conditions

$$\begin{aligned}&\left. \begin{array}{l} \Psi (0,z) =0 \\ \Psi (100,z) = 0\end{array}\right\} z\in [0,50] \\&\quad \Psi (x,50)=0 \,\forall x\in [0, 100] \\&\quad \Psi (x,0)={\left\{ \begin{array}{ll} 0.00074x^2-0.0046x, &{} 0\le x\le 40, \\ 1, &{} 40\le x<50,\\ 0.000359x^2-0.07387x+3.79559, &{} 50\le x\le 100 \end{array}\right. } \end{aligned}$$

Solution:

$$\begin{aligned} \begin{aligned} \Psi (x, z)=\sum _{n=1}^{\infty }\left[ \frac{5.49}{n\pi }\sin \frac{2n\pi }{5}+\frac{14.8}{n^2\pi ^2}\cos \frac{2n\pi }{5}+\frac{3.79559}{n\pi }\sin \frac{n\pi }{2}-\frac{7.18238}{n^2\pi ^2}\cos \frac{n\pi }{2}-\frac{14.8}{n^2\pi ^2}\right. \\ \left. +(-1)^n\frac{7.18238}{n^2\pi ^2}\right] \frac{2\sin \frac{n\pi x}{100} (e^{\frac{n\pi }{100} z}-e^{n\pi }e^{-\frac{n\pi }{100} z})}{n\pi (1-e^{n\pi })} \end{aligned}\end{aligned}$$
(39)

Soil Salinity Model

$$\begin{aligned} \mathcal {D}\left[ \frac{\partial ^{2}\mathcal {C}}{\partial x^{2}}+\frac{\partial ^{2}\mathcal {C}}{\partial z^{2}}\right] +u(x,z)\frac{\partial \mathcal {C}}{\partial x}+v(x,z)\frac{\partial \mathcal {C}}{\partial z}=0 \end{aligned}$$

The boundary conditions are

$$\begin{aligned}&\left. \begin{array}{l} \frac{\partial \mathcal {C}}{\partial x}(0,z) =0 \\ \frac{\partial \mathcal {C}}{\partial x}(100,z) = 0\end{array}\right\} z\in [0,50] \\&\quad \frac{\partial \mathcal {C}}{\partial z}(x,50)=0 \,\forall x\in [0, 100] \\&\quad \mathcal {C}(x,0)={\left\{ \begin{array}{ll} 25, &{} 0\le x\le 40, \\ 0, &{} 40<x<50, \end{array}\right. } \\&\quad \frac{\partial \mathcal {C}}{\partial z}(x, 0)=0, 50\le x\le 100 \end{aligned}$$

Solution: The solution for \(\mathcal {C}\) is given by the Eqs. (32), (36), (37), (38) and (39).

Comparison with numerical simulation

Fig. 3
figure 3

3D plot of solution of potential flow Eq. (8)

Fig. 4
figure 4

3D plot of solution of stream function Eq. (16)

Fig. 5
figure 5

3D plot of average salinity(\( \mathcal {C}\)) in the cross section under consideration generated from solution of Advection-dispersion Eq. (7) taking coefficient of diffusion(\(\mathcal {D}\)) at \(25^\circ C\) from data by Richardson et al (1965)

In this section we validate the solutions for potential flow (\(\Phi \)), stream function (\(\Psi \)) and salinity (\(\mathcal {C}\)) given by the Eqs. (15), (23) and (32), respectively, by comparing the numerical approximate solution plot and the actual solution plot using Matlab R2018b. We observe that that, the two sets of solutions are exhibiting similar patterns, but there is moderate difference in actual values (Figs. 3, 4, 5).

Effect of temperature and extended barrier on farmland salinity

Shrimp farming in coastal estuarine area is considered a lucrative business in an otherwise economically marginalized area, especially in South Asia. There is a rapid unsupervised growth in shrimp farming which has some unintended effect on adjacent farmland in the form of salt accumulation. The co-existence of both essential means of livelihood will depend on careful analysis and management of salinity level. The tropical zone comes under severe heat in summer months with maximum temperature often touching \(45^\circ \)C. The extreme temperature influences the value of diffusion coefficient(\(\mathcal {D}\)) of salt in water. In our model, we consider different temperature and corresponding different values of \(\mathcal {D}\) from available data (Richardson et al 1965) and its effect on salinity of top soil of rice field.

Another important constituent of coastal shrimp farming is the guard wall around the pond. Though the peripheral dyke facing the sea is constructed and maintained with great care, the guard wall facing inland is not usually given proper attention. In our model, we study the impact of extended length of guard wall on field salinity level. The solution is recalculated after extending the guard wall length to 10m and reducing farmland length to 50m.

Fig. 6
figure 6

Salinity of top soil on rice field under different temperatures with guard wall length 5m

Fig. 7
figure 7

Salinity of top soil on rice field under different temperatures with guard wall length 10m

The salinity levels are displayed in Fig. 6 using the solution obtained. It is observed that there is negligible difference in salinity on field near the guard wall but salinity gradually decreases for higher temperature as distance from wall increases. At furthest end of field the difference of salinity at \(25^\circ \)C and \(45^\circ \)C is 2 ppt. This reduction is negligible as the level of salinity within study area remains intolerable for the plant species. In Fig. 7 the salinity level of farmland for 10m guard wall length is displayed. It can be observed that for both cases the salinity at the end of rice field are similarly elevated to the highest level due to the closed boundary. But in case of extended dyke we observe a significant drop of salinity in the internal cultivable land which is demonstrated in Fig. 8. Within the stretch of 50m to 90m there is a decrease of about \(17\%\) in average salinity of top level for three different temperatures, indicating neutral role of diffusion coefficient in salinity reduction. But the drop in salinity is more towards the guard wall than in far end.

Fig. 8
figure 8

.

This observation points to the fact that, even though part of rice field is added to the barrier between field and shrimp pond the resultant drop in salinity in the remaining land will set the way for conventional methods of improvement of salt infiltrated top soil. In practicality, an adjacent farmland can be of any length. Considering closed boundary as in the model the last 10 meters will have high salinity, but the quantity of arable or treatable land will increase substantially due to extended non-permeable barrier.

Fig. 9
figure 9

Contour plot of salinity of the cross section under pond and field at \(35^\circ \) temperature with guard wall length 5m

Fig. 10
figure 10

Contour plot of salinity of the cross section under pond and field at \(35^\circ \) temperature with guard wall length 10m

Comparing the contour plots in Figs. 9 and 10 we observe that though there is drop of salinity on the ground level due to extended wall there is increment of salinity in the depth of the cross section. The isoline of salinity at 17.74 ppt has moved towards the vertical boundary of the cross section from the bottom boundary indicating more flow of salt in horizontal direction for the case of extended wall.

Data from simulation

Tables 1 and 2 demonstrate the salinity data values at different grid points within the cross sections in the contour plots Figs. 9 and 10, respectively.

Table 1 Salinity values at different length and depth in the studied cross-section at \(35^\circ \)C with 5 m barrier length
Table 2 Salinity values at different length and depth in the studied cross-section at \(35^\circ \)C with 10 m barrier length

Discussion

In this paper, we attempted to provide analytical solution to a mathematical model which depicts a widespread phenomena negatively influencing rice production. Rice is the main staple food of a vast coastal area in Asia where salt is slowly invading the farmland. Evidently this infiltration will have long-term repercussions in the ecological and socio-economic profile of affected areas and beyond. The solution gives insight to infiltration patterns relative to boundary conditions and coefficient of diffusion of salt in seawater. The vertical data grid of salt level is very useful in visualizing the movement of salt water underneath the field. This model can quantify the effect of desalinating process like leaching inside the aquifer. The method ignores the heterogeneity in soil composition and provides a crude but acceptable solution. This solution can be improved using additional data and can reduce the need of field survey for a preliminary study. By applying the method for a number of parallel cross sections, we can obtain a data grid for salinity levels on the top soil. Arsenic pollution from irrigation water to soil is a grave problem in South Asia. This model can be applied to investigate the dynamics of arsenic infiltration in soil and also for other similar pollutants. Also, the present model can also be used to map the seepage flow of any contaminant like pesticide or fertilizer from farmland to shrimp pond.

A significant finding of the study is almost \(17\%\) reduction of average salinity of top soil with only 5m extension of guard wall between pond and rice field(from Table 1 and Table 2). It is observed that, the decline in percentage is almost same for all three temperatures in investigation. This asserts the importance of a properly constructed dyke between shrimp pond and farmland. The role of a strategically positioned dyke in controlling salt water infiltration in coastal groundwater is already established (Comte et al 2017). Our observation reiterates the validity of such stance.

The impact of temperature on the salinity level manifested via the diffusion of coefficient is noted to be moderate. The difference is non-existent near the guard wall and inconsequential at the far end (Fig. 8). In light of this observation, there is a need of identification of more decisive parameters responsible for the flow of saline water. It is also imperative that, the soil salinity model be modified suitably to test the impact of temperature.

In the studied model, there is scope of improvement in the form of incorporation of parameter depending on the permeability and porosity of soil of the cross section, which is a crucial factor in the flow of salt–water. Here natural ground water flow pattern is ignored by sealing the vertical boundaries. In future, we aim to study salinity flow with the added features which is favorable to a more realistic outcome. Salinity dissipating measures like leaching can be incorporated in advanced study.