Introduction

The efficacy of the drilling operation is highly dependent on the drilling fluid, which accounts for 15–18% of the total costs associated with oil well drilling (Ytrehus et al. 2023). Based on their chemical properties and phase type, drilling fluids are typically classified as water-based or oil-based (Karakosta et al. 2021; Alkalbani and Chala 2024). Various compounds, polymers, and additives are combined with drilling mud to maintain properties such as mud weight, gel strength, viscosity, and filtration (Inemugha et al. 2019; Abed and Rasaei 2024; Davoodi et al. 2024; Li et al. 2024). The pH range for water-based mud (WBM) drilling is typically between 7 and 12 but may vary depending on well conditions (Blkoor et al. 2021). It is essential to maintain the proper pH to prevent chemical reactions that can contribute to corrosion and ensure clay stabilization (Ahmed et al. 2021). The pH level has a direct impact on the solubility, reactivity, and effectiveness of various additives used in drilling mud formulations (Bardhan et al. 2024; Fadairo and Oni 2024). Deviations from the optimal pH range can impair the performance of these additives, potentially resulting in reduced drilling fluid properties and compromised wellbore stability (Kong et al. 2024; Zhendong et al. 2024). Therefore, maintaining the appropriate pH in drilling mud additives is critical. Inorganic compounds, especially heavy metals, in the water that return from the oil well to separate cuttings are considered an environmental risk (Hu et al. 2024). The concern stems from the potential for these inorganic compounds to have negative ecological and human health consequences due to their persistence and inherent toxicity (Gautam et al. 2023; Sharma et al. 2023; Verma et al. 2023; Wu et al. 2024). Heavy metals, such as lead, cadmium, and mercury, have the ability to accumulate in aquatic ecosystems, resulting in long-term environmental consequences (Brindhadevi et al. 2023). The discharge of water containing elevated levels of heavy metals into natural water bodies endangers aquatic organisms and, as a result, disrupts the ecological balance. Furthermore, heavy metals can bioaccumulate in the food chain, eventually reaching human populations via consuming contaminated aquatic organisms (Dong and Li 2024; Saidon et al. 2024). The intricate interplay of inorganic compounds, particularly heavy metals, highlights the importance of stringent environmental management practices and regulatory frameworks to mitigate the potential negative impacts associated with them (Edo et al. 2024).

Several methods can be used to recover and remove heavy metals from polluted environments. These techniques include oxidation and reduction methods, various filters, electrochemical techniques, evaporation, ion exchange, demineralization, and deionization (Alkhadra et al. 2022; Balasubramaniam et al. 2022; Antony et al. 2024; Tang et al. 2024). The low cost and significant ecological benefits are two of the most significant advantages of microbial methods for managing the concentration of heavy metals in polluted environments (Kurella et al. 2023; Tedesco et al. 2024). The use of microbial methods completely depends on the situation of a polluted environment, which leads to using in-situ and ex-situ bioremediation methods (Ciampi et al. 2024; Yuan et al. 2024).

Advanced techniques such as atomic absorption spectrometry (AAS) and inductively coupled plasma mass spectrometry (ICP-MS) aid in detecting trace amounts of heavy metals in biological and environmental samples (Halmi et al. 2019; Jenikova et al. 2022).

Bacteria can readily absorb minerals due to the structure of their cell surface. During ion absorption, various elements, including nitrogen, oxygen, sulfur, and phosphorus, may also be absorbed into bacteria’s cell walls (Mu et al. 2021; Baek et al. 2022). In most instances, the absorption of nitrogen, oxygen, sulfur, and phosphorus has no direct effect on the absorption of heavy metals. These elements’ absorbing mechanisms and pathways are distinct and independent. Nitrogen, oxygen, sulfur, and phosphorus are essential nutrients for biological systems and are typically absorbed by plants, microorganisms, and other organisms via specific metabolic and nutrient absorption processes (Guerra-Renteria et al. 2019; Li et al. 2020). Microorganisms have negatively charged groups, such as phosphoric acid anions and carboxyl anions, on the surface of their cell walls. In addition, heavy metals contain cationic groups that enable them to interact with the bacteria cell wall. Microorganisms accumulate heavy metal ions through adsorption, which does not require metabolic energy. However, the absorption process in living cells depends on energy metabolism (Hu and Chen 2023). Table S1 lists several studies regarding mineral absorption by microorganisms. On the other hand, incorporating lemon oil or ethylenediaminetetraacetic acid (EDTA) can increase mineral elimination rates by 26.3–31.5% if absorption is slow and inefficient (Ning et al. 2019). In other words, this indicates that lemon and EDTA can be used as a catalyst to increase bacterial cell wall mineral absorption.

However, when essential nutrients are introduced, the cell’s capacity to absorb metal ions increases. During the catabolism and anabolism processes, bacteria produce organic acids that dissolve heavy metals in the soil, immobilizing heavy metals on the cell walls of bacteria. According to several studies, microorganisms can produce organic acids and dissolve Cd in the soil if given sufficient nutrients and energy. Specifically, the study found that the rate of leaching was only 9% in the absence of nutrients, but it increased to 36% when glucose and other nutrients were added (Chang et al. 2019; Ke et al. 2020; Sharma 2021). Citrobacter can absorb significant quantities of toxic metals by producing unbound inorganic phosphate and can absorb minerals differently (Liu et al. 2023; Shiri-Yekta et al. 2023). Through oxidation–reduction reactions, the ability of microbes to metabolize heavy metals is significantly enhanced when heavy metals combine with oxygen or hydrogen. Prokaryotic microorganisms, for instance, can alter the oxidation state of heavy metals, thereby modifying their properties and rendering them less toxic. Aerobic microorganisms can convert Hg2+ to Hg0 before evaporation (Merkel et al. 2021; Sazykin and Sazykina 2023). Although Hg(0) is fairly toxic, it cannot compare to the toxicity of Hg(II) and Hg(I), which can produce organomercury compounds such as methylmercury and dimethylmercury. This and similar compounds enter the trophic chain and can bioaccumulate, accumulating mercury in fish (Wang et al. 2022). Corynebacterium can absorb and reduce Cr6+ in water to Cr3+. The Cr6+ form is more toxic than the Cr3+ form. It was discovered that the toxicity of Cr3+ is due to its specific antagonism with iron absorption (DesMarias and Costa 2019; Liu et al. 2022). Bacillus licheniformis R08 uses the same process to convert Pb2+ to Pb0 (Margaryan et al. 2021; Zhang et al. 2022). Rapidly manifesting symptoms result from exposure to organic lead, which is likely more toxic than inorganic lead due to its lipid solubility. Organic lead compound poisoning symptoms primarily affect the central nervous system and include insomnia, delirium, cognitive deficits, tremors, hallucinations, and convulsions (Frolova et al. 2021).

Previous research (Rasti et al. 2021) investigated the organic matter discharged in the drilling area of the Hawizeh Marshes using in-situ bacteria. In this study, the intention was to reduce the total hardness of the drilling field by decreasing the amount of heavy metals in the water-based drilling mud through halophilic bacteria. It is the first time this species of bacteria has been used to reduce total hardness. Additionally, using this species in ex-situ bioremediation processes represents a pioneering effort in the field. The ultimate objective is to reduce the cost of sustainable forestry and protect the environment from hazardous chemicals. This research was conducted under laboratory conditions to prevent variations in pH, temperature, and mineral composition, which might otherwise lead to alterations in environmental conditions. The investigation was undertaken over a period spanning from 2021 to 2023 within the confines of the Hawizeh Marshes.

Materials and methods

Sampling

A sample was collected from the water tank just prior to reinjection into the well in the Hawizeh Marshes region of southwest Iran, in close proximity to Ahwaz, during the continuous circulation of water-based mud (Fig. 1). Sampling was conducted in the best possible way, with the assistance of personnel from the drilling company and the use of containers supplied by the drilling company. The characteristics of the drilling fluid employed in the well up to 2771 m are displayed in Table S2.

Fig. 1
figure 1

The location of the sampling site (31.576849, 47.746551) is in the Hawizeh Marshes (Rasti et al. 2021)

Addition of microorganisms to wastewater

In this investigation, four bacterial species were isolated in situ and added individually to wastewater. Each bacterium was collected and transferred to blood agar for growth. A bacterial sample was obtained in the incubator after 24 h at 35 °C to create McFarland standards. Then, 0.15 mL of McFarland standards were combined with 10 mL of wastewater and incubated for one week. The same procedure was applied to Aquibacillus halophilus, procured from a bacterial culture collection. It was added separately to serum physiology to create the McFarland standard, then added to effluent and incubated for seven days. Seven days later, a visual inspection revealed that the water’s color had changed. In the subsequent phase, the test was repeated while increasing the volume of wastewater and bacteria to 200 mL and 10 mL, respectively. After a week, the color changes of the wastewater were recorded. After two days, the evidence showed that no in situ bacteria could thrive in the moderately halophilic medium.

Why is Aquibacillus halophilus chosen?

The contaminated environment must be assessed before choosing bacteria from outside the environment. Based on several factors, including the minerals present in the drilling fluid and the location of the reservoir, which is surrounded by saline water, it is hypothesized that only halophilic species can survive in this environment. This hypothesis was further supported by the inductively coupled plasma-optical emission spectrometry (ICP-OES) results and total hardness measurements. Aquibacillus halophilus is a unique bacterium that can survive in highly salty environments. Based on the ICP-OES results and total hardness, an ex-situ bacterium, Aquibacillus halophilus, was chosen to thrive in wastewater because it can thrive in NaCl concentrations, with optimal growth occurring at 10% (w/v) NaCl. According to Amoozegar et al. (2014b, a), the ideal temperature and pH for its proliferation are 35 °C and 7.0, respectively (Amoozegar et al. 2014a; b). Aquibacillus halophilus is a gram-positive, moderately halophilic bacterium. The bacterial cells are rod-shaped and motile and can produce oval endospores in non-swollen sporangia. The strain number is IBRC-M 10775, obtained from the Iranian Biological Resource Center. Amoozegar et al. (2014a; b) isolated and identified this species from the Aran-Bidgol hypersaline lake in central Iran, which contains NaCl, Na2SO4, MgCl2, and MgSO4 with traces of carbonate ion (Amoozegar et al. 2014a, b; Lee and Whang 2019).

ICP-OES analysis

750 mL of water-based drilling fluid was sent to the Meyar Danesh Pars laboratory for ICP-OES and hardness measurements. Those experiments were done to determine the total concentration of heavy metals and to identify and quantify heavy metals from the investigated emplacement. The ICP (atomic emission spectrometer) laboratory of Danesh Pars is outfitted with a Perkin Elmer Company Optical Emission Spectrometer 8300 and a Sherwood Company flame photometer. The ASTM D1976 standard has been applied to identify water minerals.

Results and discussion

Sampling location

The investigation of the well in the Hawizeh Marshes is of utmost importance due to the profound environmental changes induced by drilling campaigns. This investigation was initiated because the oil company responsible for these activities recognized the need to address and mitigate the damages caused to the area.

Microbiological techniques for removing heavy metals from water-based drilling slurry

A case study on in situ bacteria will help us comprehend the diversity of bacteria and their ability to absorb heavy metals. Combining in-situ and ex-situ bacteria is indeed advantageous. Our team identified the four species of bacteria detected in a water-based drilling mud using a blood agar medium (Rasti et al. 2021). They were added separately to the drilling wastewater, but the appearance of the wastewater samples did not alter. In contrast, heavy metals such as lead, iron, and manganese were found in water-based drilling sludge (Fig. 2). The total hardness of the water-based drilling slurry was determined to be 19,100 parts per million (ppm). High salinity levels in the mud are responsible for the inability of four in-situ bacterial species to thrive in drilling wastewater. Due to membrane lysis or rupture, these in-situ bacteria cannot grow in water with high salinity (Sharghi et al. 2014). However, previous research has demonstrated that these bacteria could thrive in a blood culture medium, indicating they may be pathogenic.

Fig. 2
figure 2

The heavy metals detected in wastewater before bioremediation with halophilic bacteria (Aquibacillus halophilus)

Saline water surrounds subterranean petroleum reserves (Agapkin and Kotov 2021; Ershaghi 2024). Drilling water has a high salinity, and the presence of halophilic bacteria is indicative of a salient medium (Rezaei Somee et al. 2018; Rezaei Somee et al. 2021; Gorriti et al. 2023; Novák et al. 2023). A medium with a moderate salinity level was used to identify halophilic bacteria in wastewater. In contrast, after one week of Aquibacillus halophilus bacterium addition, the hue of the effluent changed to a milky white (Fig. 3). The density of bacteria in the effluent was high, Aquibacillus halophilus did not interact with other bacteria, and it can proliferate without restriction. The four in situ bacteria can only grow on blood agar because they defend themselves against salty conditions within the cell. Drilling mud samples containing heavy metals and bacteria were sent to the Meyar Danesh Pars laboratory to determine the wastewater’s metal content and total hardness. As anticipated, the microorganisms were highly effective at absorbing heavy metals. The variations in minerals are depicted in Table 1. The initial concentration of 18 of the 30 identified heavy metals has significantly changed or decreased. In addition, the total hardness indicated after treatment was 3700 ppm. The measured total hardness was substantially lower than its original value of 19,100 ppm before bioremediation. Despite a substantial decrease in water hardness, the current total hardness is still above the standard limit for wastewater reuse. Following regulations, the total hardness should preferably be less than 800 ppm.

Fig. 3
figure 3

The color of the effluent changed a before Aquibacillus halophilus treatment and b one week after Aquibacillus halophilus treatment

Table 1 The percentage changes and the element concentrations in ppm before and after bacteria treatment

The most significant alterations in elemental concentrations are delineated in Fig. 2. These elements are categorized into three main groups. The first group comprises Ni, Mo, La, Co, Cr, and Cn, exhibiting relatively minor fluctuations. Nevertheless, certain studies have demonstrated that Pseudomonas species, such as Pseudomonas aeruginosa, possess a notable capacity to absorb Cr and Ni, reaching up to 30% and 90%, respectively (Oves et al. 2023; Priyadarshanee and Das 2024). The second group encompasses Mn and Se, demonstrating more pronounced variations than the preceding category. Notably, Pseudomonas spp. exhibit commendable capabilities in heavy metal absorption. Additionally, Bacillus spp., including Bacillus selenitireducens, represents a viable option for the absorption of Mn and Se (Guo et al. 2023; Huang et al. 2023; Oves et al. 2023). Finally, the third group consists of Bi, Cd, K, As, Sb, Si, and Na, which are significantly reduced after the addition of A. halophilus. A. halophilus, a halophilic bacterium, has demonstrated remarkable ability to remove a wide range of heavy metals, including Bi, Cd, K, As, Sb, and Si, despite their disparate chemical properties and periodic table group affiliations.

There are several reasons why A. halophilus did not exhibit a significant impact on the absorption of heavy metals, specifically Ni, Mo, La, Co, Cr, and Cn. Firstly, the type of bacteria and the metal ions in issue have a significant impact on the capacity of microorganisms to sequester heavy metals. It’s possible that A. halophilus, an acinetobacter species, lacks binding sites or specialized transporters that effectively interact with these particular heavy metals. Because metal absorption selectivity is frequently species-specific, A. halophilus’s cellular processes and innate metabolic pathways may be to blame for the absence of reactions seen (Abd Elnabi et al. 2023; He et al. 2023; Liu et al. 2024). Secondly, it’s possible that the experiment’s heavy metal concentrations weren’t ideal for getting A. halophilus to react noticeably. The degree of tolerance that different microbial species show for heavy metals varies, and concentrations that are too low might not cause a noticeable bioaccumulation reaction (Chakravorty et al. 2023; Huang et al. 2024). Conversely, concentrations that exceed the organism’s tolerance threshold might lead to toxicity, hindering the absorption process (Chakravorty et al. 2023; Khalid et al. 2023; Zhou et al. 2023; Alabssawy and Hashem 2024). Furthermore, the kinds of heavy metals tested and their chemical composition could be quite important. Heavy metals, in particular oxidation states or chemical forms, are frequently the target of microbial resistance mechanisms; if the metals were supplied in a form that A. halophilus could not access, this could account for the observed lack of effect (Yin et al. 2019; Jeyakumar et al. 2023; Mansoor et al. 2023). In conclusion, the interaction of microbial physiology, heavy metal concentrations, and chemical forms has a significant impact on the effectiveness of A. halophilus in absorbing heavy metals. Based on Fig. 2 and Table 1, this bacterium can selectively interact with and sequester heavy metals by using different mechanisms, such as biosorption and bioaccumulation, regardless of chemical group differences. In terms of environmental cleaning, A. halophilus can be used in bioremediation strategies, providing a sustainable and environmentally friendly solution. Economically, using such ex-situ microbial methods is consistent with cost-effective and efficient remediation strategies.

Detection of heavy metals via ICP-OES analysis

The significant change in ICP-OES results demonstrates the superior performance of Aquibacillus halophilus bacteria. This study was conducted in a laboratory setting to specifically assess the impact of Aquibacillus halophilus on wastewater while mitigating the influence of any external factors (e.g., changes in pH, temperature, and mineral composition). Table 1 indicates that approximately thirty elements were analyzed by ICP-OES before and after treatment, except sodium, which has an inverted process. The alterations fall into three categories: Elements such as Na, B, Si, Sb, S, As, Ca, K, Mg, Sr, Zn, and Ba make up the first group with the most significant concentration reduction. The second group includes elements such as Al, Cd, Bi, Fe, Se, and Mn, whose concentrations have decreased to a lesser extent. The final group consists of elements whose concentrations have not altered, including W, Cu, Pd, Ti, Sn, Cr, Co, Be, La, Mo, V, and Ni. Table 1 demonstrates that the colloidal solution of these substances may have a negative ionic charge, preventing their absorption by bacterial cell walls. Either they are independently negatively charged or associated with negatively charged elements such as iron, oxygen, and chloride.

Although Ca and Mg elements typically govern total hardness (Kozisek 2020; Dey et al. 2024), numerous minerals in this drilling waste, including Na, Fe, and Mn, have affected the hardness of the water. After treatment with Aquibacillus halophilus, total hardness is observed to decrease significantly. After bacterial treatment, the total hardness dropped from 19,100 to 3700 ppm, a tremendous and significant reduction of more than 15,400 ppm. It demonstrates that Aquibacillus halophilus absorbs most minerals as a source of energy. This bacterium provides distinct advantages to this research over another research. While the optimal growth conditions for Aquibacillus halophilus are 35 °C and pH 7, this bacterium has a broad temperature range and can grow between 15 and 45 °C and pH 5 and 10 (Amoozegar et al. 2014a; b). Due to its wide temperature range, this bacterium can be utilized in various climates. The ability of this halophilic bacterium to substantially reduce the concentration of 18 heavy metals is a key difference between it and other species, as shown in Table 1. In addition, this halophilic bacterium substantially influenced the concentrations of Ca and Mg, resulting in decreases of 79% and 53%, respectively, and contributing to a remarkable reduction in total hardness. Notably, none of the microorganisms listed in Table 1 discovered in water samples could significantly reduce the total hardness at this level.

Assessing the growth effect of Aquibacillus halophilus on the ecosystem of Hawizeh Marshes

Bacteria play a crucial role in our environment, influencing various ecosystems and important processes (Singh and Yadav 2021; Chen et al. 2024). Understanding their behavior and distribution is vital for monitoring environmental health, identifying potential hazards, and ensuring the well-being of ecosystems and human populations (Gomte et al. 2024; Liao 2024; Mauck et al. 2024). Therefore, the primary conclusion derived from this discussion is that purifying and recycling effluent is the most effective way to aid the Hawizeh Marshes ecosystem. Improper management has caused the Hawizeh Marshes to dry completely (Hasab et al. 2020). According to Hasab et al. (2020), the average salinity in this region has increased to over 1800 mg/L, creating a high probability for the proliferation and spread of Aquibacillus halophilus bacteria. Due to the presence of carotenoids, increased salinity can result in a higher concentration of bacteria, causing the water to appear orange (Lazrak et al. 2024). In contrast, as salinity decreases, bacteria cannot obtain the necessary resources, leading to the lysis process in which bacterial cell walls rupture and bacteria are annihilated (Dawson et al. 2023). In other words, the proliferation of Aquibacillus halophilus can be effectively monitored and controlled through the control of wastewater salinity. In contrast, Aquibacillus halophilus is typically regarded as nonpathogenic or opportunistic. It is a halophilic bacterium typically found in saline environments, such as salt lakes and salted edibles. Typically, it is not associated with human or animal disease transmission (Amoozegar et al. 2014a; b). Therefore, it can be concluded that this bacterium not only aids in removing heavy metals from the environment but also poses no hazard to the environment or human health. On the other hand, the ability of halophilic bacteria to remove and reduce harmful chemicals from petroleum fields has also been investigated and reported recently. Table 2 presents a compilation of numerous examples of such research.

Table 2 An overview of research on halophilic bacteria in the petroleum field for the removal of toxic substances

The various varieties of halophilic bacteria that are effective at removing and reducing toxic substances under varying salinity conditions are detailed in Table 2. However, it should be noted that in this type of study, a number of variables, including oxygen concentration, pH, pressure, and temperature, play significant roles due to the variation in sampling depth and geological formation (Bailey and Ahmadi 2014; Matthiesen et al. 2015; Houben et al. 2018; Riedel 2019). It is evident from Table 2 that the majority of research conducted in recent years has been devoted more to eliminating specific kinds of distinct toxic substances like sulfide and phosphate (Ahmed et al. 2019). Moreover, findings from Table 2 indicate that halophilic bacteria can effectively grow and operate in diverse geological formations, demonstrating their ability to thrive across a broad range of geological conditions for the management of hazardous substances. Based on the literature review, so far, no study has found or reported on reducing the salinity of water-based mud using microbial methods. Conversely, most are focused on eliminating corrosive toxic substances (Table 2). Comparing the removal of toxic substances presented in Table 2 to the ability to reduce a wide variety of heavy metals (or total water hardness), as shown in Table 1, which highlights the significance of this research, is of equal importance. By implementing this research, we can make significant strides toward attaining sustainable development goals 6 and 14 in this region. The quality of the water utilized in the region will not only be improved through the purification of water sources but the fragile ecosystem, which has been deteriorating, can also be revitalized and restored.

Conclusion and future perspectives

In accordance with the goals of SDG 6 (Clean Water and Sanitation) and SDG 14 (Life Below Water), the study’s findings indicate that Aquibacillus halophilus exhibited a remarkable ability to effectively mitigate a broad spectrum of heavy metals while concurrently reducing the total hardness. The bacterium demonstrated its effectiveness in enhancing water quality despite its rapid growth. In addition, the robust growth of Aquibacillus halophilus at pH 7 indicates that the in-situ bacteria did not interfere with this halophilic bacteria while maintaining a stable pH level of 7, which is optimal for drilling operations. For effective reutilization in the well-logging field, the water’s total hardness must remain below 800 ppm. If not, additional chemical substances, such as caustic soda, would be required to reduce the overall hardness. However, using Aquibacillus halophilus provides an alternative strategy, potentially reducing reliance on such chemicals. Consider a scenario where, conventionally, 100% of materials are required to remediate effluent with a hardness of 19,100 ppm. By incorporating Aquibacillus halophilus, it is possible to reduce material consumption and total hardness by approximately 80%, as only 19.37% of materials, such as caustic soda, are needed to effectively treat water with a significantly reduced total hardness down to 3700 ppm. Water use in well logging is subject to certain restrictions, one of which pertains to the maximum allowable hardness of the water used during drilling operations, which is 800 ppm. With the dramatic reduction of water hardness from 19,100 ppm to below 3700 ppm, attaining a total hardness level of less than 800 ppm makes reusing wastewater significantly easier. This reduction indicates a significant decrease in the resources required for the purification process, contributing to SDG 6 by promoting sustainable practices and resource efficiency. In line with SDG 14’s objective to preserve aquatic life, this microbial technique reduces well-logging costs and protects the environment from hazardous substances, particularly heavy metals.