Introduction

Groundwater is considered as a life-sustaining resource on the support of socioeconomic growth, ecosystem functions, and particularly, human health (e.g., Steube et al. 2009; Ghimire et al. 2021; Amrani et al. 2022; Bucton et al. 2022; Zhai et al. 2022). Otherwise, climate change plays a crucial feature on the contribution to groundwater quantity due to the precipitation irregularity and, thus, the variation of groundwater recharge, particularly in arid and semi-arid regions (e.g., Gemitzi et al. 2017; Kahsay et al. 2018; Nyembo et al. 2021; Ashraf et al. 2022; Chi et al. 2022; Mensah et al. 2022). In recent decades, the supply of groundwater, mainly freshwater, is insufficient to answer the requirement in different sectors, including agriculture which is considered as the main consumer of groundwater resources with more than 60% of freshwater is used for irrigation purposes (Aliyu et al. 2017; Kawo and Karuppannan 2018). Water quality assessment is a critical worldwide concern to understand the necessary management changes which should be applied for short term and long term and will influence all socioeconomic sectors and threaten the durability of water resources and agricultural lands (Kavurmacı and Karakuş 2020; Bera et al. 2021; Dhaoui et al. 2022; Tzemi and Mennig 2022).

A sustainable socioeconomic development depends on the availability of freshwater resources (Ghazaryan et al. 2020) considering that the application of groundwater with low quality for irrigation purposes can lead to economic losses, destroying the ecosystem and harmful diseases for human-being (Schwarzenbach et al. 2010). Indeed, a sustainable groundwater resources management will be crucial to avert economic losses, particularly, in arid and semi-arid environments. Therefore, the efficiency of resources management will be conditioned by protection of water quality (Kavurmacı and Karakuş 2020).

Groundwater quality is influenced by several natural and/or anthropogenic factors, such as hydrogeology, rock weathering, ion exchange phenomena, evaporation processes, groundwater flow, and anthropogenic activities (e.g., Agoubi et al. 2012; Kharroubi et al. 2012; Isawi et al. 2016; Alabjah et al. 2018; Telahigue et al. 2018; Abul Qasim et al. 2022; Elmeknassi et al. 2022), as well as by climate change (e.g., D'Alessandro et al. 2017; Burri et al. 2019; Hu et al. 2019; Goswami et al. 2022; Ouhamdouch et al. 2022).

Several studies on water quality assessment have been developed using different techniques to investigate water quality, mainly based on physical properties, chemical relations, and water quality indices (WQI), some of them applied in semi-arid regions (e.g., Ben Alaya et al. 2013; Pazand and Javanshir 2014; Abd El-Aziz 2017; Prasad et al. 2019; Tian and Wu 2019; Al Maliki et al. 2020; Ghazaryan et al. 2020; Sehlaoui et al. 2020; Yurtseven and Randhir 2020; Aladejana et al. 2021; Jaydhar et al. 2022; Naik et al. 2022; Tampo et al. 2022).

Different conventional or traditional water quality indices, such as soluble sodium percentage (SSP), sodium adsorption ratio (SAR), magnesium adsorption ratio (MAR), permeability index (PI), Kelly ratio (KR), and residual sodium carbonate (RSC), are used to assess the groundwater suitability for irrigation purposes (e.g., Khan et al. 2015; Safiur Rahman et al. 2017; Tanvir Rahman et al. 2017; Beyene et al. 2019; Ghazaryan et al. 2020; Khmila et al. 2021; Ayyandurai et al. 2022; Mukherjee et al. 2022; Rostammiri et al. 2022). Besides, different authors have applied geostatistical methodologies to assess water suitability for irrigation supplies (e.g., Sutadian et al. 2017; Boufekane and Saighi 2019; El Bilali and Taleb 2020; Jahin et al. 2020; Solgi and Jalili 2021).

The traditional hydrochemical and statistical methods use the Boolean logic, considering exact or crisp values representing the boundaries between various classified groups. The conventional water quality index values are, then, ranged between 0 and 1 (e.g., true or false), and thus, for the same water sample, more than one water quality classes could be assigned with the application of previous indices, contributing to an imprecision for water quality classification (Icaga 2007). Thus, it is important to apply some advanced methods to assess groundwater quality more accurately than the traditional methods.

In the last decades, in order to overcome this subjectivity, the shortcomings, and the environmental uncertainty in groundwater quality assessment procedure, artificial intelligence (AI) models are extensively applied concerning to their flexibility and simplicity (e.g., Mujumdar and Sasikumar 2002; Rezaei et al. 2013; Meyers et al. 2017; Nadiri et al. 2017, 2019; Agoubi et al. 2018; Rajaee et al. 2019; Bedi et al. 2020; Das and Pal 2020a, 2020b; Jha et al. 2020; Lu and Ma 2020; Ruidas et al. 2021, 2022; Arabameri et al. 2022; Osiakwan et al. 2022; Pal et al. 2022; Pham et al. 2022). Indeed, fuzzy logic (FL) techniques are highly used and show a higher capability in capturing complex environmental problems related to groundwater (e.g., McKone and Deshpande 2005; Agoubi et al. 2016; Duhalde et al. 2018; Tafreshi et al. 2018; Jaiswal and Ballal 2020; Jha et al. 2020; Arasteh and Farjami 2021; Kord and Arshadi 2022), proving their strength to overcome non-linearity, ambiguity, and uncertainty of environmental issues (Agoubi et al. 2016; Tirupathi et al. 2019). Moreover, several previous research works have applied and verified the importance of fuzzy logic techniques to converge an ambiguous decision into a state of acceptance (Cho and Lee 2020). Fuzzy logic has ability to convert vagueness, uncertainty, and variability to a mathematical structure and is widely used in groundwater quality evaluation, usually combined with geostatistical tools and GIS approaches (e.g., Ostovari et al. 2014; Khashei-Siuki and Sarbazi 2015; Li et al. 2018; Jafari and Nikoo 2019; Shwetank and Chaudhary 2019; Jha et al. 2020; Pathak and Bhandary 2020). FL is, then, considered as an important tool to convey the results to the beneficiaries in a more understandable and reliable linguistic format (Raman et al. 2009; Alavi et al. 2010; Agoubi et al. 2016; Vadiati et al. 2016; Shwetank and Chaudhary 2019; Ahmad et al. 2020).

Tunisia region is threatened by water scarcity problems mainly associated to its arid and semi-arid climate. It is also characterized by an unstable climate with irregularity in rainfall spatial distribution and quantity, mainly represented by alternating of intensive rainy and drought periods, contributing to a global increase in groundwater resources. Indeed, in the Menzel Habib area (southeastern Tunisia) groundwater resources are mainly applied for agricultural supplies, and groundwater assessment quality will be crucial for a sustainable water resource management.

Thus, the current study is aimed at assessing the groundwater quality suitability for irrigation purposes from Menzel Habib aquifer system using a combined application of different water quality indices and Fuzzy Irrigation Water Quality Index (FIWQI) determined by fuzzy logic techniques.

Materials and methods

Groundwater from the aquifer system

The Menzel Habib region is located on the North of Africa, on the southeastern of Tunisia, northwest the city of Gabès between latitudes 3,761,904.56 and 3,798,891.65 N and longitudes 523,087.79 and 589,234.20 E (Fig. 1a). The region is characterized by an arid climate and a complex geology, which includes formations from Triassic to Quaternary ages.

Fig. 1
figure 1

Menzel Habib area: (a) geographical location; (b) simplified geological map of the aquifer system, including the spatial distribution of groundwater samples from shallow (P) and deep (G) aquifers

The aquifer system is composed by three different layers starting from the shallow aquifer which is logged in sandy-loam formation with plio-quaternary age and characterized by a depth ranging between 10 and 65 m. The Senonian aquifer, which corresponds to the first deep aquifer, occurs in marl levels with limestone layers, while the Cenomanian–Turonian layer is logged in the limestone and marl-limestone formations (Fig. 1b).

Groundwater from Menzel Habib aquifer system is mainly destinated to agricultural needs. However, the extremely high salinity of the Cenomanian–Turonian groundwater layer (Ben Cheikh 2013) does not allow the exploitation of this water to agricultural activities. Groundwater samples are extracted from two aquifer layers from the Menzel Habib aquifer system corresponding to the shallow (Plio-Quaternary) and deep (Senonian) aquifers. The groundwater quality assessment from shallow and deep aquifers will be considered in this study.

A total of thirty-six groundwater samples were extracted from water supply boreholes and wells used for agricultural needs from the Menzel Habib aquifer system. Twenty-five samples were collected from the shallow aquifer (P1 to P25; Fig. 1b) and eleven samples from the deep aquifer (G1 to G11; Fig. 1b). After pumping the boreholes for a minimum period of 15 min, groundwater samples were collected, stored, and transferred to the laboratory in polyethylene bottles. Physico-chemical parameter, notably, electrical conductivity (EC), was determined in the field using a multi-parameter analyzer (C933 multi-parameter). On the laboratory, groundwater samples were filtered using a 0.45 μm Millipore filter and prepared to analytical determinations. By the titration method with hydrochloric acid (HCl), bicarbonate (HCO3) water contents were determined. Selected cations (Na, K, Ca, and Mg) and anions (F, Cl, Br, and SO4) water contents were measured through an ionic liquid chromatography Metrohm 850 Professional IC. The quality and efficiency of hydrochemical data were proved through the calculation of ionic charge balance and were within ± 5% error. All the laboratory analyses were developed at the Integrated Laboratory of Water Sciences, Higher Institute of Water Sciences and Techniques of Gabès (Tunisia).

Irrigation water quality parameters

Groundwater quality assessment is crucial to evaluate the suitability of water resources for crop irrigation. Each crop needs water with predefined physicochemical parameters. Several and combined indices to assess groundwater quality for irrigation practices will be applied on the Menzel Habib region.

The evaluation of water quality for irrigation purposes is conditioned by water quality indices that are fixed by different organizations and agencies (Ayers and Westcot, 1994; El Bilali and Taleb 2020), with possible implications, such is a poor growth and associated quality if the water does not satisfy crop requirements (Moharir et al. 2019). In the present study, electrical conductivity (EC), sodium adsorption ratio (SAR), soluble sodium percentage (SSP), magnesium adsorption ratio (MAR), permeability index (PI), and Kelly ratio (KR) were considered as water quality indexes. All the ion contents are expressed in meq L−1 and applied on the following Eqs. (1) to (5):

  1. (1)

    SAR (Richards 1954):

    $$SAR=\frac{Na}{\sqrt{\frac{Ca+Mg}{2}}}$$
  2. (2)

    SSP (Kopittke et al. 2006):

    $$SSP=\frac{Na}{Ca+Mg+Na}\times 100$$
  3. (3)

    MAR (Szabolcs and Darab 1964):

    $$MAR=\frac{Mg}{Ca+Mg}$$
  4. (4)

    PI is expressed in % (Ragunath 1987):

    $$PI=\frac{Na+\sqrt{{HCO}_{3}}}{Ca+Mg+Na}\times 100$$
  5. (5)

    KR (Kelly 1963):

    $$KR=\frac{Na}{Ca+Mg}$$

Fuzzy logic

Fuzzy logic was developed by Lofti A. Zadeh in 1965 considering the fuzzy subset theory. Fuzzy subsets are a mathematical way of representing the imprecision of natural language and could be considered as a generalization of classical set theory (Zadeh, 1965; Ross, 2005; Baghel and Sharma 2013; Shwetank and Chaudhary 2019). Fuzzy logic is also called “linguistic logic” because its truth values are words from everyday language (e.g., “rather true, almost false, far, so far, near, big, and small”). Fuzzy logic aims to study the representation of imprecise knowledge and approximate reasoning (Gacôgne 1997; Shwetank and Chaudhary 2019) and tries to model vague notions of natural language to compensate for the inadequacy of classical set theory in this domain.

In classical set theory, the membership of an element to a subset is Boolean. Fuzzy subsets allow to know the degree of membership of an element to the subset. A fuzzy subset A of a universe of discourse U is characterized by a membership function (Zadeh 1965):

$${\upmu }_{\mathrm{A}}:\mathrm{U}\to \left[\mathrm{0,1}\right]$$

where μA is the level or degree of membership of an element of the discourse universe U in the fuzzy subset.

In fuzzy logic concepts, the data is normally represented by linguistic variables. A linguistic variable is a variable whose values are words or phrases commonly used in a natural language or an artificial language (Zadeh 1975). A linguistic variable is defined by:

$$\left(X,U,T\left(X\right),{\mu }_{x}\right)$$

where X denotes the name of the variable, U is the universe of discourse associated with the variable X (also called the reference frame), T(X) = {T1, T2… Tn} is the set of linguistic values of the variable X (also called linguistic terms or linguistic labels), and finally, μx is the membership function associated with the set of linguistic terms.

A fuzzy inference system (FIS) also aims to transform input data into output data from the evaluation of a set of rules. The inputs come from the fuzzification process, and the sets of rules are normally defined by the expert’s knowledge (Vadiati et al. 2019; Agoubi et al. 2016; Priya 2013) and the standards proposed by Ayers and Westcot (1994). A FIS consists of three steps (Malik et al. 2021): (a) fuzzification, (b) inference, and (c) defuzzification.

The first step is fuzzification consisting in the characterization of the linguistic variables of the system. It is a transformation of the real inputs into a fuzzy part defined on a representation space linked to the input. This spatial representation is normally a fuzzy subset. During the fuzzification step, each input and output variable is associated with fuzzy subsets which could have several shapes (e.g., trapezoidal, triangular, and Gaussian). Trapezoidal shape of membership functions is used in this study considering the advantageous because it is asymmetric (Castillo and Melin 2008), although the gradient of the membership values develops over the same slope value and will classify the water quality variables more accurately (Al Mamun et al. 2019). The function could be indicated as:

$$f\left(x,a,b,c,d\right)=\left\{\begin{array}{c}0 x<a or d<x \\ \frac{a-x}{a-b} a\le x\le b \\ 1 b\le x\le c \\ \frac{d-x}{d-c} c\le x\le d\end{array}\right.$$

where x is considered as the variable that will be fuzzified; a, b, c, and d are defined the linguistic variables which are used to split the parameters into different classes (Fig. 2).

Fig. 2
figure 2

Illustration of trapezoidal of fuzzy membership function

The second step is the inference engine, which is a mechanism for condensing the information of a system through a set of rules defined for the representation of any problem. Each rule delivers a partial conclusion that will be aggregated with the other rules to provide a conclusion (aggregation). The rules constitute the fuzzy inference system and are constructed using different operators such as “AND, OR, NOT.”

The third step is defuzzification, corresponding to the reverse of fuzzification, and will transform the fuzzy outputs of the inference into a non-fuzzy value as the final answer of the fuzzy inference system (FIS).

Fuzzy rules are generally represented by “IF … THEN” and allow to define the relation between the input and output variables. More precisely, a fuzzy rule is defined as follows (Agoubi et al. 2016):

$$if x is A then y is B$$

where A and B are linguistic variables defined in a universe of discourse X and Y. The first part of the rule “x is A” will be the antecedent, while the second part of the rule “y is B,” will be the consequent.

The Mamdani approach in fuzzy toolbox of MATLAB software is used to develop fuzzy inference system (FIS) to classify groundwater for irrigation purposes. SAR, SSP, KR, PI, MAR, and electrical conductivity (EC) are considered as the inputs, and the Fuzzy Irrigation Water Quality Index (FIWQI) will be the output (Fig. 3).

Fig. 3
figure 3

Structure of fuzzy model

Results and discussion

Geochemistry of groundwater and water quality indicators

A statistical summary of groundwater physio-chemical parameters from Menzel Habib shallow and deep aquifer, considering maximum, minimum, standard deviation, and mean values, is presented in Fig. 4. For the shallow aquifer, the chemical element contents range between 879 and 2876 mg/L for SO4 (mean: 1507 mg L−1), 490 and 3265 mg L−1 for Cl (mean: 1415 mg L−1), 67 and 189 mg L−1 for HCO3 (mean: 137 mg L−1), 319 and 2065 mg/L for Na (mean: 946 mg L−1), 176 and 895 mg L−1 for Ca (mean: 367 mg L−1), 110 and 342 mg L−1 for Mg (mean: 170 mg L−1), and 18.27 and 53.01 mg L−1 for K (mean: 28.94 mg L−1) (Fig. 4a). However, for the deep aquifer (Fig. 4b), the chemical element contents range between 1074 and 2704 mg/L for Cl (mean: 1848 mg L−1), 880 and 2785 mg L−1 for SO4 (mean: 1838 mg L−1), 60 and 237 mg L−1 for HCO3 (mean: 160 mg L−1), 521 and 1902 mg L−1 for Na (mean: 1152 mg L−1), 179 and 826 mg L−1 for Ca (mean: 495 mg L−1), 135 and 285 mg L−1 for Mg (mean: 197 mg L−1), and 17.59 and 52.62 mg L−1 for K (mean: 29.25 mg L−1). Nevertheless, the Br and F groundwater contents are very low for both aquifers. Consequently, a spatial variation can be observed on the major anions and cations from groundwater samples. The dominance of groundwater ions is classified as the following order: from shallow aquifer SO4 > Cl > HCO3 > Br > F for anions (Fig. 5a) and Na > Ca > Mg > K for cations (Fig. 5a); from deep aquifer Cl > SO4 > HCO3 > Br > F for anions (Fig. 5a) and Na > Ca > Mg > K for cations (Fig. 5b).

Fig. 4
figure 4

Descriptive statistics of chemical elements from Menzel Habib (a) shallow aquifer; (b) deep aquifer

Fig. 5
figure 5

Mean values for groundwater major (a) anions, (b) cations

The main source of groundwater ion composition for both aquifers could be evaluated using the saturation indices of different minerals (Fig. 6a). As a result, negative saturation indices are registered for halite, anhydrite, and gypsum, while positive ones characterize dolomite and calcite. Thus, the main hydrogeochemistry origin should be associated to the dissolution of evaporites and dissolution/precipitation of carbonates (Farid et al. 2012; Patel et al. 2016; Argamasilla et al. 2017; Bahir et al. 2018; Mejri et al. 2018; Dhaoui et al. 2021, 2022; Sunkari et al. 2021). Some groundwater samples are represented by an adsorption of Na and release of Ca, while others are characterized by adsorption of Ca and release of Na (Fig. 6b). That leads to confirm that cationic exchange and inverse cationic exchange with soil and aquifer materials could also be identified as main origins of major ions (Abid et al. 2009; Ahmed et al. 2013; Kammoun et al. 2018; Dhaoui et al. 2021, 2022).

Fig. 6
figure 6

(a) Saturation index of different minerals; (b) Ca + Mg-(HCO3 + SO4) versus Na + K-Cl

Considering groundwater quality parameter standards for irrigation purposes (Table 1), different water quality indices will be calculated for shallow and deep aquifer system concerning groundwater ion contents combined with physical parameters. Groundwater quality is classified into four classes based on the indices: excellent, good, permissible, and unsuitable (Table 1).

Table 1 Irrigation water quality parameters

The SAR groundwater quality index is considered as one of the foremost parameters to review the water quality suitable for irrigation. For Menzel Habib aquifer system groundwater, SAR varies between 4.08 and 19.3 (Fig. 7a) which reflect that 36% of groundwater samples have an excellent quality and 64% with a good quality.

Fig. 7
figure 7

Boxplot of groundwater quality parameters: (a) SAR; (b) SSP (%); (c) KR; (d) PI (%); (e) MAR (%); (f) EC (μS cm.−1)

The SSP groundwater parameter is an important parameter to assess the suitability of water to irrigation considering that an excess of sodium water content could affect the plant growth. In the present study, the SSP values range between 35.78 and 71.53% (Fig. 7b). Additionally, the SSP allows to detect that 17% of the groundwater samples are of good quality, while 83% are permissible and, consequently, deemed for irrigation purposes.

The KR groundwater quality parameter varies from 0.56 to 2.47 (Fig. 7c), allowing that 25% of groundwater samples have an excellent quality, 11% are of good quality, and 14% permissible. Otherwise, 50% of groundwater samples are unsuitable for irrigation purposes. The obtained results indicate that Menzel Habib groundwater is polluted by alkali hazard, according to defined criteria (Karanth 1987).

Indeed, the groundwater quality indices (SAR, SSP, and KR) may evaluate the sodium adsorption degree by the soil in water with its negative or positive influence on crop yields. Besides, Ca groundwater content is lower than Na content (Fig. 5b) because of the ionic substitution, including cationic exchange and reverse cationic exchange, could have occurred (Tanvir Rahman et al. 2017). This substitution could enhance a breakdown of physical structure of the soil irrigated by this water, with the magnesium and calcium replacement by the high concentration of sodium yielding to sodic enrichment in the soil, thus, soil structure destroying, dispersion of clay, permeability and plant growth reducing as discussed by other researchers (Nagarajah et al. 1988; Subba Rao et al. 2012, 2021; Olofinlade et al. 2018), in which the soil could not support crop yields due to the soil permeability reduction. As a result, the plant roots could not receive nutrients issued from the soils because they could not properly absorb water.

Sodium, calcium, magnesium, and bicarbonate soil contents will affect the soil permeability, which could be related to PI groundwater quality indices for irrigation purposes. In the study area, the PI values range between 38.47 and 72.74% (Fig. 7d). Consequently, 64% of the groundwater samples are classified as with a good quality, while 36% are considered permissible for irrigation purposes.

The MAR indices can also characterize groundwater quality concerning the excess of magnesium over calcium water content. In the aquifer system from Menzel Habib, groundwater MAR values range between 34.19 and 56.01% (Fig. 7e). The application of MAR index classifies the groundwater samples into two groups. The first group, containing 92% of the groundwater samples, is considered suitable for irrigation (MAR < 50%), while the second group, with 8% of the groundwater samples, is classified as unsuitable for irrigation. Groundwater exceeding the allowed standard (MAR > 50%) will promote an increasing in soil alkalinity and an adverse effect on crop yields. The continuous application of unsuitable groundwater will cause negative risks, a consequent need of interventional plans.

Calcium and Mg have different behavior in the soil. The high Mg content will negatively affect the soil structure, particularly associated with a high water salinity and high density of sodium. Generally, high Mg water contents will result in a highly exchangeable Na (Fig. 6b) in the irrigated soils (FAO, 2008). This situation could negatively influence the soil quality and contribute to poor yield crop. Consequently, soils irrigated by high salinity water will be infertile owing to the deposition of sodium carbonate (Keesari et al. 2016).

To provide a more efficient management of groundwater suitability for irrigation purposes, EC (Fig. 7f) and SAR parameters were plotted on the diagram of Richards, considering the USSL (United States Salinity Laboratory) classification (Fig. 8). The irrigation water, with respect to EC according to Richards diagram, are classified as C1, excellent water for irrigation (could be applied in all type of soils); C2, good water for irrigation (could be applied in all plants provided a medium degree leach forms); C3, permissible water for irrigation (cannot be used on soils with limited drainage, other plants could tolerate); C4, doubtful for irrigation due to very high salinity; and C5, unsuitable for irrigation associated to an extremely high salinity. Relatively to SAR parameter, water for irrigation could be classified as S1, excellent water for all type of soils (SAR < 13); S2, good water for irrigation (SAR: 13–22); S3, water doubtful for irrigation (SAR: 22–32); and S4, unsuitable water for irrigation (SAR > 32). The soil irrigated with S2 and S3 water types will require a special management concerning to possible production of sodium oxide hazardous.

Fig. 8
figure 8

Groundwater samples plotted in the Richards diagram

The Richards diagram revealed that three groundwater samples from Menzel Habib aquifer system fall within the C4S2, nine fall within C5S2, one is classified in C4S3, five in C5S3, and the other groundwater samples are characterized by a SAR ratio more than 10 and an extremely high salinity (Fig. 8). The high levels of Na and EC registered for almost groundwater samples, could be derived from ionic leaching, weathering of rocks and anthropogenic activities, particularly, related to agricultural activities.

Indeed, almost groundwater samples from the study area should not be applied under natural conditions (e.g., plant non-tolerant for salinity, without drainage network; Ayers and Westcot 1994; FAO 1997). Nevertheless, this groundwater type could be applied in areas that require soil management or with permeable soil and containing crops that are tolerant to salinity. Therefore, a particular soil treatment in areas with a high leaching and high organic matters associated to good drainage conditions will be required to the crops growing using this quality of water. It could also be used on the soil with calcium-enriched soil water. The need to gypsum/soil modification is required to apply and use these water resources for irrigation purposes (Mukherjee et al. 2022).

FIWQI

The calculation of groundwater quality parameters from Menzel Habib aquifer system will be crucial to get accurate decisions to manage groundwater in this region. There is an uncertainty and overlap in decision-making considering groundwater quality of some analyzed groundwater samples. Thus, in the study area, groundwater samples are characterized by values on the range limits, which could lead to a confusion on the decision in situations that can be classified in more than one groundwater quality class for irrigation purposes. Hence, the groundwater quality of Menzel Habib area was assessed applying more accurate fuzzy logic approaches.

Sodium absorption ratio, EC, SSP, MAR, PI, and KR, as representative groundwater quality indicators, are considered as the inputs of the fuzzy index process. Then, the resulted membership functions are considered and constructed (Fig. 9). The obtained FIWQI has a score that ranges from 0 to 1 (Fig. 10), and it is the output resulted from defuzzification for the considered groundwater samples. The fuzzy toolbox of MATLAB software was used to create the appropriate rules for groundwater classification where some rules are shown in Fig. 11.

Fig. 9
figure 9

Inputs membership functions

Fig. 10
figure 10

FIWQI classification of groundwater from Menzel Habib aquifer system

Fig. 11
figure 11

Sample of rules created in fuzzy toolbox in MATLAB software

Therefore, fuzzy logic method has clearly modified groundwater classification by creating three new water quality groups, excellent to good, good to permissible, and permissible to unsuitable (Table 2), compared with the Richards diagram classification (excellent, good, permissible, and unsuitable; Fig. 8). Consequently, from Menzel Habib aquifer system, 3% of groundwater samples are characterized by “good quality,” 3% of “good to permissible quality,” and 33% of “permissible quality” for irrigation purposes. About, 36% of groundwater sampled points are considered as “permissible to unsuitable quality” for irrigation; however, 25% are classified as “unsuitable quality” for irrigation purposes. The created fuzzy index shows superiority and improvement over the classification given by the diagram of Richards. This is notably relevant in groundwater samples characterized by similar quality, reflecting and promoting a more robust decision, precisely on groundwater samples with values located between two different groups. Overall, using Richards diagram classification, making the decision was taken according to crisp values, while the FIS showed flexible limits based on linguistic terms related to groundwater quality threshold values that is located between two different groups. This methodology will allow for more reliable and consistent information concerning groundwater quality for irrigation supplies. The fuzzy logic method is, then, greater than other indices as discussed by Priya (2013), Agoubi et al. (2016) and Mohamed et al. (2019) where it has the ability to reflect the state of groundwater quality and could be a useful approach for groundwater quality modeling as it is an alternate approach to problems where the limits are diffuse or imprecise.

Table 2 FIWQI vs. USSL classification

Conclusion

Using different traditional water quality indices (SAR, SSP, KR, PI, and MAR) and Richard’s diagram, the fuzzy logic techniques have been applied to assess groundwater quality for irrigation purposes. Based on hydrochemical analysis results, different sources of salinization were detected, notably, the dissolution of evaporites, the precipitation of carbonates, the inverse cationic exchange, and the inverse cationic exchange. Therefore, groundwater samples were classified using the traditional indices and the Richards diagram where almost of them are characterized by a low suitability for irrigation use.

Then, a Fuzzy Irrigation Water Quality Index (FIWQI) is developed basing on the combination of conventional water quality indices in a global one. This index allows to classify the groundwater samples into seven categories: 3% of groundwater samples were classified as “good,” 3% were categorized as being “good to permissible,” 33% were considered “permissible,” 36% were classified as being “permissible to unsuitable,” and 25% were classified as being “unsuitable” for irrigation purposes. The proposed model was validated with satisfactory results on groundwater samples for Menzel Habib area. The resulted FIWQI is more adequate to Menzel Habib aquifer system than Richard’s diagram, and the conventional water quality indices where the creation of new groundwater quality classes, classified as excellent to good, good to permissible, and permissible to unsuitable, will be more relevant on the groundwater classification for irrigation purposes by avoiding the uncertainties and imprecision associated in decision-making processes.

Depending on these obtained results where the quality of almost groundwater samples is unsuitable for the soil and, thus, for a sustainable crop production, an appropriate remediation is required in Menzel Habib area, notably, by the treatment of groundwater resources before using for irrigation or the use of specific crop tolerant to the water high salinity. These recommendations will be useful in this local area and will benefit other regions that have similar issues.