1 Introduction

Dyeing wastewater has brought attention throughout the years. Every year, a massive amount of dyes is released into the environment. Dyes are widely used in many industries, including textiles, leather, paper, and rubber. One kilogram of textile needs almost 200 L of water to be produced, which leads to the consumption of 1.6 million liters of water were used in the average-sized textile mill each day [1]. As a result of advancements in the printing and dyeing industries' processes, a massive amount of dyes is released into water streams. When water is polluted, decontamination of the polluted water becomes necessary, and a suitable decontamination method should be selected to achieve the objectives of decontamination.

Normally, dyes can be classified according to their nature as natural dyes or synthetic dyes. Natural dyes are those which can be extracted from animals and minerals, while those developed industrially are synthetic dyes. Synthetic dyes are classified chemically into ionic and non-ionic dyes, and according to their chemical structure, they are classified as azo, anthraquinone, indigoid, Nitroso, Nitro, and triarylmethane dyes [2, 3].

Dyes can be considered industrial waste when they are discharged into water bodies and have a very harmful impact on the environment. Dyes are complex organic compounds that include aromatics, amines, and heavy metal traces [4]. The toxicity of dyes is due to their structure and components. Their existence in water streams can affect aquatic life through the blocking of the transmission of sunlight and accumulation in fish tissues which by its turn can reach the humans and animals through the food chain causing dysfunction in organ, reproductive, and central nervous system [5].

The dyes are characterized by their degradation resistance due to their intricate chemical structures [3]. They are stable in a variety of environments, including aerobic digestion, heat, oxidizing agents, and light. Therefore, the selection of a treatment method is a crucial need. However, this choice depends on the characteristics of the wastewater. Each method has its limitations depending on the cost, feasibility, effectiveness, operability, consistency, environmental effect, sludge production, process difficulty, pretreatment necessities, and the development of possibly toxic by-products. The removal methods are classified as physical or physicochemical, chemical, biological, and electrochemical [6, 7]. Physical separation, dye breakdown, or decolorization via adsorption-biodegradation are all methods of dye removal. Electrochemical procedures have been used to treat wastewater containing dyes owing to their productivity and cost effectiveness.

The electrocoagulation (EC) method is an electrochemical technique with numerous applications that can minimize the presence of many types of pollutants, ranging from heavy metals to persistent organic pollutants. It is a clean method and environmentally friendly where the electron is the main reagent and no further reagents or chemicals are required, which in its turn minimizes the sludge production and reduces the hazardous chemicals used as coagulants in conventional effluent treatment processes [8, 9]. The selection of the electrode material, as well as the arrangement of the anode and cathode, are critical parameters. The electrode material should be nontoxic to human health and the environment. Because of their availability, low cost, nontoxicity, and efficiency, electrodes like iron, aluminum, stainless steel, mild steel, and graphite are the most commonly used electrode materials [10, 11].

New advancements in EC cells and electrode designs, such as the use of a combined Al–Fe electrode, have recently been published [12,13,14], alternatively, a rotated anode [15], a magnetic field combined with an iron electrode [16, 17], the use of ultrasound irradiation in conjunction with electrocoagulation [18, 19] as well as a new flow column reactor [20], a finny anode placed concentrically in a tubular cathode [21], a concentric aluminum tubes where the cathode electrode is put inbetween the anode electrode [22], in addition to the use of a plate electrodes where the interior plates are perforated while the outer plates are not [23]. Besides, the new net anode structure, where the perforated electrode allows the movement of gas and effluents which greatly enhances the removal efficiency.

In this research, a comparison is established between the removal differences of two reactive dyes like RR49 and RY15 using a new electrode shape made of an iron mesh structure. The dyes are of different structures like the differences in molecular weight, number of function groups and the chain length which could greatly affect the removal procedure. Section two illustrates the materials used in the study, the method of percent removal calculations, the configuration of the reactor, the procedure of the experimental work, and finally the description of the statistical analysis conducted on the results. Section three explains the effect of different variables on the percent removal of the dyes as: initial dye concentration, pH, type and quantity of interfering ions, speed of agitation effect, and temperature. To understand the mechanism of the removal of dyes well, the thermodynamic parameters, adsorption isotherms, EC kinetic studies, characterization of the formed flocs and the iron anode surface, and absorption spectral analysis were studied. ANOVA was applied on the results to differentiate between the significant and the non-significant factors on the process.

2 Materials and method

2.1 Materials

The selected dyes in the form of anionic dyes, such as Reactive Red 49 (RR49) and Reactive Yellow 15 (RY15), were supplied by Sigma-Aldrich with 99.90% purity. The dyes feature and chemical structures are summarized in Table 1 and Fig. 1. Sodium salts of sulphate, sulphite, nitrate, carbonate, chloride, and hydroxide, in addition to the hydrochloric acid were provided by Merck with 99.00% purity.

Table 1 The Chemical structure and characteristics of studied dyes
Fig. 1
figure 1

Dyes chemical structures

2.2 Analytical measurement

The dyes concentrations were determined by using a JENWAY UV/Visible spectrophotometer. The Beer-Lambert law A = (ε × ℓ × C) was used to create a calibration curve for different standard dye concentrations, where ε signifies the degree of molar absorption, ℓ denotes the cell length and C was the concentrations of the dyes. Data for a variety of conditions were collected, as well as the removal percentage of dyes (% Re) was calculated by means of Eq. 1

$$\% Re= \frac{{A}_{o}-A}{{A}_{o}} x 100$$
(1)

where \({A}_{o}\) is the primary absorbance of the dyes before EC, and \(A\) is the absorbance of dyes after time of EC.

2.3 Reactor configuration

In Fig. 2, a batch tubular EC cell consisting of three anodes and three cathodes was represented. Each anode was an iron net structure (mesh) with a surface area of 95.88 cm2. The anode was a net structure of iron metal wrapped in layers around a PVC tube. The PVC tube has internal dimension of 2.5 cm, a length of 11 cm, and a thickness of 0.35 cm. Each cathode is a stainless-steel tube measuring 1.5 cm in internal diameter, 10.5 cm in length, and 0.25 cm in thickness. The arrangement of the anode and cathode can be seen in the Figure. The electrode set is housed in a 2.0 L cylindrical reactor with a 1.5 L working volume. The batch system is made up of an electrochemical reactor and a magnetic stirrer, and two Avometers (Megger, UK) were used, where one operated as a voltmeter while the other acted as an ammeter and a DC power supply. In a monopolar mode, the electrodes were connected to the DC power supply. The current study was carried out at a current density of 208.59 mA/cm2.

Fig. 2
figure 2

Schematic representation of the EC set-up

2.4 Stock solution and electrodes preparation

A stock solution of RR49 and RY15 were made separately by dissolving 1 g of each dye in 1 L of reverse osmosis water from which different concentrations were prepared. The following steps were performed before each experiment to prevent the presence of impurities: the use of emery paper to remove any oxides and accumulated particles, rinsing the electrodes with distilled water, followed by dipping them in solutions of HCl (35%) to remove the oxides that have formed on the electrode surfaces. Finally, the electrode surfaces were repeatedly washed with deionized water. The cleaning procedure for the cell was as follows: the cell was cleaned with running the faucet for around five minutes and then soaked for another five minutes in distilled water; the latter stage was repeated three times. The cell was magnetically stirred after a dye solution was added then the electrodes were fixed inside the cell.

2.5 Statistical analysis

Analysis of Variance (ANOVA) was conducted using MS Excel statistical software data analysis to evaluate the variation in results obtained from each factor in relation to the overall variation in results, which may contain noise factors as well. One-way ANOVA was conducted to assure the optimum values of initial dye concentration, pH, supporting electrolyte type and concentration, rate of stirring, and temperature. The P-value indicates whether the factors are significant or not. The studied factors show a significant variation when the p-value is less than 0.05 [24].

3 Results and discussion

3.1 Primary dye concentration effect

Figure 3 demonstrates the impact of the primary dye concentration on the removal efficiency of both RR49 and RY15 dyes. The optimum concentrations were discovered to be Co = 80 and 60 mg/L where the percent removals were 91.8 and 48.9% for RR49 and RY15 respectively. The % Re for RR49 was higher than that for RY15 due to the structure effect of the dye. The movement of the RY15 dye is much slower than that of the RR49 due to its higher molecular weight with a long side chain in its structure unlike the RR49 dye besides that the higher molecular weight makes the solution more viscous which hinders the movement of ions, this phenomenon lowers the removal percentage of the dye corresponding to the RR49.

Fig. 3
figure 3

Effect of primary dye concentration on %Re

For the same dye species, the removal efficiencies were found to decrease as initial dye concentration increased. At larger concentrations, the dye molecules rapidly electro-coagulated close to the sacrificial anode at the beginning and the adsorption capacity of metallic hydroxide flocs becomes saturated early. Furthermore, increasing dye concentration increases dye molecule association, which decreases dye molecule adsorption ability on Fe(OH)3 due to the unavailability of the polar functional groups consumed in dye association [25], or possibly because dye concentrations become too high in comparison to the number of flocs generated, so diffusion resistance increases and the rate of EC is reduced [26].

3.2 pH effect

Figure 4 illustrates the influence of pH on RR49 and RY15 removal efficiencies using iron anode in net structure. The best removal efficiency was observed at pH 2.06 for RY15, where the removal was 96.45%, while at pH 5.9 for RR49, where the removal was almost 92%. It was found that working with pH 2 led to the presence of enormous quantities of precipitated coagulated particles in the solution, and consequently, the solution was very turbid. Therefore, it was decided to perform the experiments in an acidic medium at pH 3.5, at which the acidity was available but with a clearer solution for the ease of determination of the absorbance of the dyes.

Fig. 4
figure 4

Influence of pH on %Re of dyes

Through the electrolysis process, ferrous ions are produced from the anodic Fe electrode which may interact OH ions produced at the cathode form ferrous hydroxo complexes with hydroxide ions and polymeric species. Based on the Predominance-zone diagram (PZD) (Fig. 5), Fe(OH)n complexes were formed, the majority of which were Fe(OH)2+ and Fe(OH)2+according to the pH of the medium [27, 28]. Soluble and insoluble hydroxides are formed, which may interact with or adsorb the dyes from the solution or contribute to coagulation by neutralizing the negatively charged colloidal particles in the solution, allowing these particles to agglomerate via Van der Waals attractive forces.

Fig. 5
figure 5

PZD in relation to pH for iron species in aqueous solution

The mechanism for removal could be through either complexation, charge neutralization, entrapment, and adsorption depending on the type of coagulant and dosage and the nature of the pollutant itself. However, pH and other water matrix effects can have a significant impact on the EC process. The removal mechanism is a complex process because all the mechanisms could happen at the same time, increasing the removal efficiency [29].

Figure 6 explains the effect of time on the removal efficiencies of RR49 and RY15. Taking a closer look at the figure, three steps in the EC process at optimum pH, optimum concentration, and 20 ˚C can be concluded as follow:

  1. I

    The first step is forming Fe+2 ions which appear within (10 and 15) minutes for RR49 and RY15 respectively.

  2. II

    The second step was the formation of Fe+3 ions that occurred at (22 and 26) minutes for RR49 and RY15 respectively.

  3. III

    The maximum percent removal of the dyes was achieved within 30 min and kept constant to 35 min to obtain % Re (91.82 and 75.55) for RR49 and RY15 respectively.

Fig. 6
figure 6

Effect of time on the %Re of dyes

3.3 The effect of the type and quantity of interfering ions

The effect of adding supporting electrolytes such as sodium carbonate (Na2CO3), sodium sulfate (Na2SO4), sodium nitrate (NaNO3), sodium sulfite (Na2SO3) and sodium chloride (NaCl) were studied. Figure 7 depicts the removal efficiency of the dyes from the solution. The best % Re was obtained when using the NaCl as interfering ions for both dyes (≈98%). For RR49, any type of supporting electrolyte led to almost the same percent removal with slight differences, except for sodium nitrate which gave the minimum %Re. Moreover, as can be seen, sodium nitrate was very inefficient as a supporting electrolyte with RY15. This may be due to the inhibition of electro-dissolution at both sacrificial anodes which requires higher applied potentials for oxidation [30, 31]. Alternatively, the medium containing chloride ions is much favored despite the anodic material is due to its corrosive power which enhances the release of ions from electrode surfaces [32, 33]. Thus, lower voltage is needed for electro-dissolution in case of using chloride than in case of using sulfates or nitrates containing electrolytes [32].

Fig. 7
figure 7

Effect of supporting electrolyte on %Re of dyes

To determine the optimum quantity of NaCl to use, different quantities (0.1, 0.2, 0.3, 0.4, 0.5, and 0.8 g) were used to study the consequence of its concentration on dye removal during the electrocoagulation process. Figure 8 depicts time effect on the % Re of dyes at various NaCl concentrations.

Fig. 8
figure 8

Time effect on % Re at different quantities of NaCl (g/L) under optimum conditions, a RR49, b RY15

Reviewing the figure, 0.5 g of NaCl gave the best % Re for both dyes and the removal was fast at the first 5 min of EC compared to the other quantities, where the removals were 76.7% and 60% for RR49 and RY15 respectively. However, both dyes gave the same % Re after 30 min of EC where the removal was almost 98.5% for RR49 and RY15.

A comparison between the behaviors of both dyes with the optimum quantity of NaCl is presented in Fig. 9. It is clear that both dyes gave almost the same % Re after 30 min of EC almost complete removal. However, the difference between the dyes appears at the first 5–10 min where the RR49 dye showed higher removal than the RY15 dye. It was attributed to the long side chain in RY15 dye molecules besides its higher molecular weight than the RR49 dye.

Fig. 9
figure 9

Effect of time on % Re at 0.5 g NaCl for RR49 and RY15

3.4 Agitation effect

The primary purpose of agitation is to transport the coagulant matter produced by electrode solution in the reactor. Stirring makes the solution homogeneous to avoid regional differences within the solution [34].

Figure 10 demonstrates the effect of the speed of stirring (300, 400, 500, 700, and 900 rpm) on removal efficiency. Net structure of iron needs high stirring to attain complete mixing and the system becomes more homogenous because the high stirring speed increases the formation of Fe(OH)3 flocs to attach, thus precipitation becomes easier. The highest removal efficiency was achieved at 900 rpm for RR49 and RY15 the percent removal was almost the same at the stirring speeds 500–900 rpm, and consequently, it is recommended to use the speed of 500 rpm for the energy-saving sake.

Fig. 10
figure 10

Effect of speed of agitation on % Re of dyes

3.5 Temperature effect

Figure 11 explains the temperature effect on the RR49 and RY15 removal efficiency. Mobility of ions in solution, collision rate, the activity of the adsorbent surface and the dissolution rate of the electrodes all are affected by changing the temperature where the rise in the temperature leads to a rise in all of the aforementioned properties of the solution besides the growth in the solution conductivity owing to the decrease in the viscosity [20, 35]. This increase was to an optimum value which were 20 °C and 30 °C for RR49 and RY15 respectively. Additional growth in the solution temperature had a negative impact on the efficiency of removal of both dyes due to the development of unstable flocs or the increase in their solubility [36].

Fig. 11
figure 11

Temperature effect on the %Re of dyes

3.6 Thermodynamic parameters

Thermodynamics is used to decide if a process is chemical or physical, endothermic, exothermic, and spontaneous or non-spontaneous. Change in standard Gibbs free energy (ΔGo), change in standard enthalpy (ΔH°), and change in standard entropy (ΔS°) of the process were determined by conducting batch experiments at different temperatures using the equations defined by Shaker et al. [37].

Table 2 represents the thermodynamic parameters for removing RR49 and RY15. The calculated negative values of the standard Gibbs free energies (ΔG0) at different temperatures reveal the spontaneous practicability of the adsorption process. Comparing the two dyes, the removal of RR49 favors the lower temperature 293 K while that for RY15 it favored the higher temperature at 303 K. Accordingly, the removal of RY15 was more spontaneous than RR49.

Table 2 Thermodynamic parameters of RR49 and RY15 removal

The adsorption system's randomness was indicated by a positive entropy change value. According to the values of the enthalpy change, the removal of RR49 dye was exothermic while that of RY15 was endothermic.

3.7 Adsorption isotherms

Four adsorption isotherms were used to analyses the experimental data: Langmuir, Freundlich, Dubinin–Radushkevich (D–R), and Temkin as described by Shaker et al. [38]. Both dyes adsorption was best fitted by Langmuir isotherm for monolayer adsorption. The dimensionless constant separation factor RL of Langmuir determines whether the adsorption is favorable or not or a linear one. The RL value (RL > 0) approves the adsorption process's favorability as represented in Table 3.

Table 3 The studied adsorption isotherms for RR49, and RY15 removal

3.8 EC kinetic studies

It is one of the most fascinating and difficult areas of chemistry that deals with reaction mechanisms. Reaction kinetics research provides a wealth of information about the nature and course of reactions and determines the hydraulic retention time of a reactor. The order of a reaction can helps us understanding it at the molecular level [38].

The kinetic mechanism of the RR49 and RY15 adsorption to in-situ produced Fe(OH)3 (flocs) throughout the EC process was attained by using the pseudo-first-order and the pseudo-second-order models as explained by Moneer et al. [39]. The kinetic results proved that the removal of RY15 dye explained by the pseudo-first-order model with a good correlation coefficient (> 0.97) although for RR49 dye the correlation coefficient in a pseudo-second-order model (0.99) was the best choice (Table 4).

Table 4 The kinetic studied models used for RR49 and RY15 removal

3.9 Characterization of the formed flocs and the iron anode surface

The types of functionalities of the dyes and adsorbed species were determined utilizing the Fourier transform infrared (FTIR) spectra to deduce the kind of adsorption of the dye and its products. The weak transitions at 893.07 and 881.50 cm−1 for RR49 and RY15 respectively were possibly due to FeO vibrations. The bands at 1048.35 and 1021.34 cm−1 for RR49 and RY15 respectively signify the presence of FeOOH. For the peaks at 587.34 and 738.76 cm−1 correspond to Fe2O3. The FTIR data indicates the development of various iron oxides through EC [40,41,42]. Figure 12 represents the adsorption of RR49 and RY15 onto the flocs.

Fig. 12
figure 12

FTIR of the formed flocs by EC technique a RR49, b RY15

Taking a closer look at Fig. 12, Fe(OH)3 appeared at adsorption bands (3428.58 and 1636.65 cm−1) for RR49 and (3395.79 and 1632.80 cm−1) for RY15 that were comparable to that of a pure Fe(OH)3 (3400 and 1640 cm−1) [43] where the band at 3400 cm−1 was due to the adsorption of water molecules while that at 1640 cm−1 was due to the bending mode of OH group. The alteration of pure Fe(OH)3 absorption bands spectrum from the original position is due to the intersection of bands of Fe(OH)3 with the flocs [44]. There were many absorption bands found where the weak broad band stretching vibrations of N–H were assigned at, 3428.58 and 3395.79 of cm−1 for RR49 and RY15 respectively which confirms azo bond cleavage of the dye. The C-H was appearing at peaks 2915.5 and 2932.86 cm−1 for RR49 and RY15 respectively. The weak intensity sharp bands which appear at 1636.65 and 1632.8 cm−1 RR49 and RY15 respectively refers to C = O. For C = C stretching rings found at peaks 1439.91 cm−1 and 1470.77 cm−1 for RR49 and RY15 respectively. For the C = C stretching 1370.47 and 1125.5 cm−1 for RR49 and RY15 respectively [45]. The presence of many peaks in the zone of the vibrations of the C–H bending confirmed the presence of an aromatic structure.

The faces of the electrodes were investigated by the electron microscope (SEM) prior to and next to the remediation procedure. It showed the difference in terms of morphology owing to the precipitation of (Fe(OH)n) after the treatment process as shown in Fig. 13.

Fig. 13
figure 13

SEM of electrodes’ surface: a before dyes removal and b after RR49 removal, c after RY15 removal mechanism

SEM and FTIR analyses revealed that RR49 and RY15 were rapidly removed from the bulk solution by adsorption on the flocs' insoluble iron hydroxides.

3.10 Absorption spectral analysis

The dye removal mechanism could be investigated using the absorption spectra (UV–Visible spectra) of the solutions containing dyes, as shown in Fig. 14. The bands which appear in visible region could be assigned to n–π * shift related to -N2- group, in the ultraviolet region the bands are assigned to the π–π * shift of the aromatic ring bonded to the -N2- group. These bands distinguish the dyes before the EC [40].

Fig. 14
figure 14

Absorption spectra for the removal of a RR49, b RY15 dyes with EC

Figure 14 shows that the dyes' band intensities were rapidly reduced by increasing the EC time which means that the dyes were removed by EC without being degraded or cleaved or forming intermediates.

3.11 ANOVA

Table 5 represents the ANOVA results obtained in terms of each factor's impact on the response variable. The results reveal that all the factors were non-significant except for the pH where the P-values were lower than 0.05 for both dyes and that was the reason the work was done at pH = 4 and 5.9 for RY15 and RR49 respectively.

Table 5 the ANOVA test for RR49 and RY15 dyes

3.12 Differences from the literature

Table 6 Illustrates a comparison of the proposed work with other publications of the same technique which proves the effectiveness of the novel mesh electrode in the removal of two reactive dyes. As can be seen from the figure, the % Re with this type of electrode was greater than the highest removal obtained in the literature [about 2% difference with the Al plate electrode and 4.5% difference with its counterpart of the same material (Fe plate electrode)].

Table 6 Comparison of the proposed work with other publications of the same technique

These results may be due to the capability to increase the electrodes’ surface area through the increase in the number of layers wrapped around the PVC tube [i.e., higher surface area gives large number of coagulant species]. Increasing the homogeneity of the solution where the solution containing the pollutant can enter inside and out of the electrode through the pores of the mesh during the stirring which makes the solution homogeneous rather than the plate electrodes. In addition to that, this type of electrodes does not take up space in the reactor which enables the removal of large number of pollutants.

4 Conclusion

The new electrode structure had to be studied on different dyes (RR49 and RY15) of different structures to evaluate its progress on the removal process. Many factors were studied, and an excellent removal (98.5%) was obtained. At optimum conditions of initial dye concentrations of 80 and 60 mg/L, pH of 5.9, and 4, 0.5 g of NaCl, 900 and 500 rpm of stirring rate, and temperatures of 20 and 30℃ for both RR49 and RY15, respectively, the removal percentage has reached 98.5 for both dyes. The removal mechanism was found to be spontaneous from the negative value of ∆Go, in addition, the ∆Ho value was exothermic with the RR49 dye removal, unlike the RY15 dye where its removal was an endothermic one. The removal mechanism was found applicable by the Langmuir model. The kinetics of RR49 removal explained by the pseudo- second- order model, while that of the RY15 was described by the pseudo-first-order. The coagulated particles were characterized by FTIR and SEM which confirms the removal through adsorption on the coagulant formed while the solution was analyzed by UV/Visible spectral analysis which confirmed that no new species were formed. The pH factor showed a significant variation through the ANOVA test. The comparison with other previous work confirmed the superiority of the Fe mesh to the ordinary plate electrode and materials. Future studies should be done on the mixture of dyes while comparing these studies with real effluent of the same dyes. For future perspective, the new electrode should be tested for its effectiveness on another industrial effluent not only dyes.