Introduction

Over a million metric tons of palm oil and its products are consumed and utilized annually in thousands of corporate supply chains (Murphy et al. 2021). However, the palm oil production process generates a substantial volume of wastewater known as palm oil mill effluent (POME), characterized by high chemical oxygen demand (COD), brownish color, and acidic pH. (Khongkliang et al. 2019; Khemkhao et al. 2022). Most palm oil mills employ anaerobic digestion (AD) as the primary treatment to convert POME's biodegradable portions to methane for energy generation and COD reduction. However, ammonium, tannins, and phenolic chemicals are barely removed by AD, resulting in residual COD in anaerobically-treated POME of approximately 5000–6000 mg/L (Khongkliang et al. 2023) and ammonia–nitrogen of approximately 200–350 mg/L (Zahrim et al. 2014; Khongkliang et al. 2023). Furthermore, anaerobically-treated POME has a brownish color due to the presence of plant constituents such as lignin, tannin, humic and fulvic acid, and phenolic compounds (caffeic, ferulic, gallic, protocatechuic, p-coumaric, syringic, 4-hydroxybenzoic, and 4-hydroxyl phenylacetic acids) (Edem 2002; Zahrim et al. 2009; Kongnoo et al. 2012).

Secondary treatments for removing plant constituents in POME have been proposed using various techniques such as coagulation/flocculation (Zahrim et al. 2014; Khongkliang et al. 2023; Aryanti et al. 2024), flotation (Poh et al. 2014), membrane processes (Tan et al. 2017; Aryanti et al. 2024), Fenton processes (Taha and Ibrahim 2014), and photocatalysis (Alhaji et al. 2016). Various coagulants have been studied for the coagulation/flocculation process, including calcium lactate (Zahrim et al. 2014), blood protein (Khongkliang et al. 2023), Moringa Oleifera extract (Yap et al. 2021), and polyhydroxide and polyhydroxy metallic compounds produced in situ from iron and aluminum anodes by electrocoagulation (EC) (Saad et al. 2022). However, additional operating costs often hinder secondary treatment of anaerobically-treated POME. This has prompted increased attention to waste valorization when dealing with anaerobically-treated POME. In a recent study, Khongkliang et al. (2023) proposed an economically feasible approach that integrates protein-tannin complexation and EC at pH 5 to harvest plant constituents from anaerobically-treated POME effluents and improve the quality of the treated wastewater. One advantage of an operating pH of 5 is that it helps postpone the onset of electrode passivation, which is a significant obstacle to the implementation of EC (Al-Qodah et al. 2024). This is because the low pH environment effectively inhibits the formation of surface layers (Ingelsson et al. 2020). In addition, the proteins in pig blood can form complexes with condensed tannins via hydrogen bonds, hydrophobic interactions, and covalent bonds between the amino acids in the protein and the hydroxyl and phenolic groups in the tannins (Girard et al. 2018; Pizzi 2021), resulting in the simultaneous harvesting of tannins and > 90% removal of COD and color. The tannins harvested by the protein–tannin complexation method could be further utilized as animal food additives and nutraceuticals for pets. In addition, the quality of the treated POME can be further improved using subsequent EC, which precipitates highly soluble plant constituents. As a result, the secondary-treated POME has a remaining ammonia–nitrogen of approximately 23–27 mg/L, a color of approximately 700–800 Pt–Co, and a yellowish color owing to the presence of a residual tannin concentration of approximately 30–40 mg/L. The properties did not meet the criteria specified by the Thailand Ministry of Industry that regulated the color of water for industrial effluent to be < 300 ADMI, COD < 120 mg/L, phenolic compound < 1 mg/L, and pH in the range of 5.5–9.0 (Ministry of Industry 2017).

Due to the presence of residual ammonia–nitrogen (NH3–N) in the secondary-treated POME, discharge of the secondary-treated POME to the environment can cause nitrogen deposits, which have a direct effect on soil acidification and vegetation (Bashir et al. 2016; Jefferson et al. 2016). Furthermore, the color of the secondary-treated POME might cause public resistance to recycled water for industrial applications. Thus, removing ammonia–nitrogen and decolorizing secondary-treated POME is an essential step toward water recycling in the palm oil industry. The application of electrooxidation (EO) in the decolorization of various types of wastewater is well documented: tannery wastewater (Rao et al. 2001), ammonium-containing wastewater (Zöllig et al. 2015), textile wastewater (Kaur et al. 2018; Gilpavas et al. 2020), and phenolic wastewater (Kiss et al. 2023; Pu et al. 2023; Đuričić et al. 2023). In addition, the EO of ammonium-containing water generates strong oxidizing agents in situ (hypochlorite, nitrogen oxide radicals, and ozone), causing color reduction and the oxidation of ammonium ions into N2 and large phenolic compounds into small molecules (Rao et al. 2001). However, to our knowledge, no studies have reported the application of EO in refining the quality of treated POME.

This study investigated the simultaneous reduction of ammonia–nitrogen and decolorization of secondary-treated POME using EO. Specifically, the effects of secondary treatment (EC alone and organic precipitation followed by EC), electrode configuration of an EO reactor with a graphite anode (monopolar in series, monopolar in parallel, and bipolar), and feed flow rates on the efficiency of EO in removing residual tannins and ammonia–nitrogen, decolorization efficiency, and energy consumption were examined.

Materials and methods

Raw materials

Wastewater samples were collected from the effluent discharge point of an anaerobic cover lagoon at Suksomboon Vegetable Oil Co., Ltd., Chonburi, Thailand. These samples, labeled "anaerobically-treated POME," were kept at 4 °C before usage. The anaerobically-treated POME had a concentration of phenolic compounds of 224.46 ± 13.17 mg/L, total chemical oxygen demand (tCOD) of 5440.80 ± 78.40 mg/L, pH of 8.32 ± 0.06, NH3-N concentration of 37.98 mg/L, and color of 13,337.5 ± 1178.60 ADMI. Additionally, pig blood was collected from a slaughterhouse to prepare a stock solution containing 11,297 ± 79 mg/L of stable protein, which was kept at 4 °C.

Gallotannin was purchased from HiMedia Laboratories Pvt. Ltd. (Mumbai, India). Standard solutions of gallotannin (phenolic compounds) were prepared at five different concentrations (2.5, 5, 10, 20, and 30 µg/mL). Bovine serum albumin (BSA) was purchased from Sigma–Aldrich (St. Louis, Missouri, USA). The BSA standard solutions were prepared with eleven different concentrations ranging from 0.5 to 10 g/L according to Martina and Vojtech (2015). Ammonium chloride (NH4Cl, AR grade) was purchased from Elago Enterprises Pty. Ltd. (New South Wales, Australia). The NH3-N standard solutions were prepared at five different concentrations ranging from 0.25 to 2 mg/L according to Le and Boyd (2012).

Preliminary treatment using organic precipitation in series with electrocoagulation

The anaerobically treated POME was transferred to a 2000-mL beaker with a working capacity of 1660 mL. The pig blood solution was added to the anaerobically treated POME at a tannin-to-protein ratio of 0.33 (w/w), and the pH of the mixture was adjusted to 5.0 ± 0.2. The mixture was stirred for 3 min at 150 rpm and 5 min at 60 rpm, then allowed to settle for 15 min. The supernatants were collected for subsequent treatment and referred to as POP-treated POME.

Two types of wastewater were treated with EC: (1) POP-treated POME, and (2) anaerobically-treated POME without organic precipitation. The EC process was conducted in a 700 mL acrylic reactor, assembled with four Al electrodes in the monopolar parallel electrode connection mode. Each electrode had a surface area of 100 cm2 (10 cm × 5 cm × 0.2 cm) and was placed 10 mm apart. Each electrode was linked to a direct current (DC) electricity source with a maximum current capacity of 30 A and an output electrical power of 15 V. The EC reactor was filled with 620 mL of wastewater, and the reaction was initiated by supplying an electrical current to the electrodes at a fixed current density of 30 mA/cm2 for 10 min. After the allotted EC period, the system was left to settle at ambient room temperature (298–303 K) for 15 min, and the supernatant was collected for subsequent treatment and chemical analysis. The supernatants from the EC treatment of POP-treated POME and anaerobically-treated POME are referred to as POP-EC-treated POME and EC-treated POME, respectively. Before and after each experiment, all the electrodes were cleaned with piped water, immersed in 2.5% HCl (v/v) for at least 5 min, and rinsed with DI water.

Electrooxidation reactor setup with different electrode arrangements

POP-EC-treated POME and EC-treated POME wastewater samples were further treated with EO. The EO process was conducted in a 910 mL acrylic reactor with a graphite anode and a stainless-steel cathode. Figure 1 shows the reactor configuration with the water inlet, outlet, and electrodes. Each electrode had a total surface area of 260 cm2 (10 cm × 13 cm × 0.1 cm) and was placed 10 mm apart. Three electrode configurations were investigated: monopolar in parallel (MP), monopolar in series (MS), and bipolar in series (BS). The electrodes were connected to a DC electricity source with a maximum current capacity of 30 A and a maximum output electrical voltage of 15 V.

Fig. 1
figure 1

Schematic configuration of the electrooxidation reactor

The EO reactor was filled with 750 mL of each wastewater sample. The reaction was initiated by supplying an electrical current to the electrodes at specified current densities (20, 30, 40, 50, 60, or 70 mA/cm2) and electrolysis times (3, 6, 9, 12, 15, 18, or 21 min). Wastewater was circulated in the reactor at a specified flow rate (80, 100, 120, 140, or 160 mL/min) until the total hydraulic retention time reached the specified electrolysis time. After the allotted EO period, the system was left to settle at ambient room temperature (298–303 K) for 15 min, and the supernatant was collected for chemical analysis. The supernatants from the EO treatment of POP-EC-treated POME and EC-treated POME are referred to as POP-EC-EO-treated POME and EC-EO-treated POME, respectively.

Analytical method

Aqueous pH was measured using a pH meter (Model LAQUA-PH2000, Horiba Advanced Techno Co. Ltd., Kyoto, Japan). The phenolic compound content was measured using a standard colorimetric method (APHA et al. 2012). The NH3-N content was measured using the salicylate method described by Le and Boyd (2012).

Calibration curves of light absorbance as a function of the concentrations of the standard phenolic compounds, BSA, and NH3-N were obtained using a visible spectrophotometer (Model V-1100D, Shanghai Mapada Instruments Co. Ltd., Shanghai, China) at wavelengths of 700, 540, and 640 nm, respectively. The concentrations of phenolic compounds (expressed as phenolic compound equivalents), proteins (expressed as protein equivalents), and NH3-N (expressed as NH3-N equivalents) in the liquid samples were determined from the calibration curves using linear interpolation of light absorbance readings. The colors of the wastewater and treated water samples were assessed in American Dye Manufacturers Institute (ADMI) units using a colorimeter according to the manufacturer's instructions (MERCK Spectroquant Unk Prove 100, Merck Ltd., Darmstadt, Germany).

The output voltages and currents were monitored using a digital multimeter (Model XL830L, Shenzhen Ruizh Industrial Co. Ltd., Guangdong, China).

The chemicals in POP-EC-treated and POP-EC-EO-treated POME were analyzed using a gas chromatography-mass spectrometer (GC–MS, QP2020 NX series, Shimadzu Co., Kyoto, Japan) equipped with an Rxi-5Sil MS capillary column (30 m × 0.25 mm ID × 0.25 μm df). The splitless injection was performed at a ratio of 1:10, and the injection temperature was maintained at 280 °C. The column temperature was increased from 50 to 300 °C at a rate of 10 °C/min. Helium was the carrier gas at a constant flow rate of 3 mL/min. The mass spectrometer was operated in the electronic-impact mode with an ionization energy of 70 eV. The detection was performed in the full scan mode from 35 to 500 m/z.

Calculations

The electrical energy consumption was calculated as follows:

$$SEC =\frac{E \times I \times t}{V}$$
(1)

where SEC is the specific energy consumption (kWh/m3), E is the cell voltage (V), V is the volume of treated water (m3), t is the electrolysis time (s), and I is the current (A).

The boundary layer thickness, which represents the film layer on a smooth plate under laminar flow conditions, was calculated using the Blasius equation:

$$\delta =\frac{5x}{\sqrt{{Re}_{x}}}$$
(2)
$${Re}_{x}= \frac{{U}_{\infty }x}{v}$$
(3)

where δ is the boundary layer thickness (cm), \({Re}_{x}\) is Reynolds number, ν is the kinematic viscosity (m2/s), \({U}_{\infty }\) is the liquid upstream velocity (m/s), and \(x\) is the distance from the edge of the electrode (cm) along the horizontal axis.

The removal efficiency was determined by calculating the percentage (%) removal for each parameter using the formula (D0Dt)/D0, where D0 and Dt represent the initial and residual concentrations of phenolic compounds, color, and NH3-N in the wastewater, respectively.

Results and discussion

Effect of preliminary treatment with organic precipitation on the removal of color and phenolic compounds by electrooxidation

Figure 2 shows the removal efficiency of color and (poly)phenolic compounds from two wastewater samples (POP-EC-treated POME and EC-treated POME) using EO with an MP configuration at an electrolysis time of 12 min and current density between 20 and 70 mA/cm2. The POP-EC-treated POME wastewater samples had lower initial phenolic compound concentrations in the range 7.64–11.12 mg/L, and the removal efficiency of phenolic compounds by EO in this wastewater was almost 100% at a current density of 60 mA/cm2 (Fig. 2a). In contrast, the EC-treated POME wastewater samples had higher initial phenolic compound concentrations in the range 30.14–36.46 mg/L. They required a higher current density of 70 mA/cm2 to reach 96.99% removal of phenolic compounds and a residual phenolic compound concentration of 1.09 mg/L (Fig. 2b). EO oxidizes phenolic compounds to simpler compounds through both direct and indirect oxidation mechanisms (Saputera et al. 2021). In the direct oxidation mechanism, phenolic compounds diffuse through the mass-transfer boundary layer and are oxidized at the anodic surface by radicals such as ⋅O, ⋅OH, and ⋅Cl. In the indirect oxidation mechanism, relatively stable oxidants such as active chlorine species are generated at the electrodes and diffuse across the boundary layer to the bulk liquid, where they are transferred by mass convection to react with complex phenolic compounds (Rao et al. 2001; Serrano 2018). These results suggest that preliminary organic precipitation substantially boosts the removal efficiency of phenolic compounds by EO, possibly by eliminating condensed tannins, thus lowering the interference of large tannin molecules on the mass transfer of active species and interactions between active species and phenolic compounds.

Fig. 2
figure 2

Removal of phenolic compounds and color by EO: a removal of phenolic compounds from POP-EC-treated POME; b removal of phenolic compounds from EC-treated POME; c removal of color from POP-EC-treated POME; d removal of color from EC-treated POME

The effect of preliminary organic precipitation on color removal was similar to that on phenolic compound removal. Figure 2c shows the efficiency of color removal using EO in POP-EC-treated POME wastewater with initial color concentrations in the 347.12–393.04 ADMI range. The EO treatment of the wastewater caused a significant reduction in the color concentrations from above 300 ADMI to 104.10 ADMI (70% color reduction) using a current density of 20 mA/cm2 and to 4.85 ADMI (98.61% color reduction) using a current density of 70 mA/cm2 (Fig. 2c). In contrast, the wastewater samples without preliminary organic precipitation had higher initial color concentrations in the range of 546.50–569.50 ADMI and required a higher current density of 70 mA/cm2 to reach a color removal of 70.57% and a residual color concentration of 160.82 ADMI (Fig. 2d). The results showed that EO was effective in removing color caused by phenolic plant constituents, particularly when current densities > 60 mA/cm2 were applied to the wastewater samples with preliminary organic precipitation.

Effect of electrode configurations and current density on the removal of color and phenolic compounds by electrooxidation

As established in section "Effect of preliminary treatment with organic precipitation on the removal of color and phenolic compounds by electrooxidation", preliminary organic precipitation improves the efficiency of the EO process; therefore, further investigations in this study will be performed on POP-EC-treated POME wastewater samples. Figures 3 and 4 show the removal efficiencies of phenolic compounds and color from POP-EC-treated POME using EO with different electrode configurations (MP, MS, and BS), current densities (20–70 mA/cm2), and electrolysis times (0–21 min). For all electrode configurations, increasing the current density increased the phenolic compound removal efficiency and color. Zhang et al. (2011) reported that using higher current densities during the EO process led to increased chlorine generation, which increased the reaction rates and extent of indirect oxidation. Moreover, the increased current density accelerates the electron transfer rate, thereby facilitating the direct oxidation of organic pollutants (Zhou et al. 2016).

Fig. 3
figure 3

Removal of phenolic compounds from POP-EC-treated POME by EO with different electrode arrangements: a MP; b MS, and c BS

Fig. 4
figure 4

Removal of color from POP-EC-treated POME by EO with different electrode arrangements: a MP; b MS, and c BS

Regarding the total elimination of phenolic compounds at lower electrolysis times and current densities, the EO process with the MP configuration performed better than those with the MS and BS configurations. The removal efficiency of phenolic compounds by the EO process with the MP configuration was 98.01% at a current density of 60 mA/cm2 and an electrolysis time of 9 min (Fig. 3a). In contrast, under these operating conditions, the removal efficiencies of phenolic compounds were only 40.24% and 59.19% in the MS and BS configurations, respectively. A current density of 70 mA/cm2 and an electrolysis time of 15 min was required for the EO process with the MS and BS configurations to achieve removal efficiencies of 96.34% and 83.45%, respectively (Fig. 3b, c). The superior removal efficiency of phenolic compounds in the MP configuration might be attributed to its relatively uniform electric field compared with those associated with the MS and BS configurations. The more uniform the electric field, the more stable the generation of radicals and oxidizing agents and, therefore, the higher the reaction efficiency (Nava and de León 2018; Reza and Chen 2022).

The EO process with the MP configuration also performed better for color removal than those with the MS and BS configurations. For example, at an electrolysis time of 9 min and a current density of 60 mA/cm2, the efficiencies of color removal were 93.10%, 57.64%, and 18.83% for the MP, MS, and BS configurations, respectively (Fig. 4a–c). In addition, with the MP configuration, a current density above 50 mA/cm2, and an electrolysis time ≥ 15 min, the color was completely removed (100% removal efficiency). The treated POME wastewater samples became transparent, revealing very low concentrations of light-absorbing substances (Fig. 5).

Fig. 5
figure 5

Visual appearance of the treated POME wastewater samples

Effect of electrode configurations on energy consumption in the electrooxidation process

Figure 6 shows the energy consumption of the EO process with the MP, MS, and BS configurations. The energy consumption by the EO process varied greatly from 0.39 to 21.80 kWh/m3, depending on the current density (20–70 mA/cm2), electrolysis time (3–21 min), and electrode configuration (MP, MS, and BS configurations). In the MP configuration, the current is divided between the electrodes, whereas in the MS and BS configurations, the current passing through each electrode pair is kept constant. In this study, we kept the current passing each electrode pair in all configurations at 2.4 A, and the total current in the MP configuration was 7.2 A. For the same electrolysis time and current density, the energy consumption of the EO with the MP configuration was slightly higher than those with BS and MS configurations. For example, with a current density of 60 mA/cm2 and an electrolysis time of 9 min, the ranking order of energy consumptions was: MP (4.81 kWh/m3) > BS (4.78 kWh/m3) > MS (3.89 kWh/m3). Energy consumption was directly proportional to the applied voltage: 4.81 V for the MP, 4.78 V for BS, and 3.89 V for MS.

Fig. 6
figure 6

Energy consumption of the EO process with different electrode arrangements: a MP; b MS, and c BS

The electrode configuration had a greater effect on the removal of phenolic compounds and color than on the reduction in energy consumption. Considering the removal efficiency of the phenolic compounds, the EO process with the MP configuration resulted in a removal efficiency of 98.01% at the lowest current density (60 mA/cm2), electrolysis time (9 min), and energy consumption (6.93 kWh/m3). With the MS and BS configurations, the removal efficiencies of the phenolic compounds were 96.34% and 83.45%, respectively, with a current density of 70 mA/cm2, electrolysis time of 15 min, and energy consumption of 14.00 and 11.70 kWh/m3, respectively.

Effect of feed flow rates on the removal of phenolic compounds, ammonium-nitrogen, and color by electrooxidation

To examine the effects of feed flow rate on the removal of phenolic compounds, ammonium, and color, the feed flow was adjusted to rates between 80 mL/min (equivalent to a fluid velocity of 0.0017 m/s) and 160 mL/min (0.0033 m/s), the current density was fixed at 60 mA/cm2, and the hydraulic retention time was maintained at an optimal electrolysis time of 9 min. Figure 7a shows the energy consumption and color removal in the EO process at feed flow rates of 80, 100, 120, 140, and 160 mL/min. The results show that varying the feed flow rates between 80 and 160 mL/min caused only small changes in the color removal efficiencies (in the range 98.02–100%). However, the feed flow rates had a profound effect on energy consumption, showing the lowest energy consumption of 3.12 kWh/m3 at the lowest flow rate of 80 mL/min and the highest energy consumption of 9.22 kWh/m3 at 160 mL/min. It should be noted that the direction of water flow was normal to the transport of charged species across the electrodes. Therefore, as the water flowed faster, the charged species traveled along longer paths across the electrodes due to the transverse liquid motion, thus increasing the electrical resistance.

Fig. 7
figure 7

Effect of feed flow rates and water velocity on EO efficiency: a color removal and energy consumption; b phenolic compound removal and boundary layer thickness, and c ammonium removal

Figure 7b shows the relationship between the removal efficiency of phenolic compounds, the thickness of the boundary layer developed in the vicinity of the electrodes as calculated by the Blasius equation with x = 0.25 cm, and the water velocity. There was a relatively large variation in the removal efficiency of phenolic compounds in the range 75.89–97.22% at different water velocities. The flow regime in this study was considered laminar, with a Reynolds number in the range 166–333. As expected, the increase in the feed flow rate and thus the water velocity led to a decrease in the boundary layer thickness from 0.61 to 0.44 cm for water velocities of 0.0017 m/s and 0.0033 m/s, respectively. The decreased boundary layer thickness, in turn, increased the mass transport rate of the oxidizing agents and phenolic compounds between the electrode surface and bulk liquid. Yavuz and Shahbazi (2012) suggested that an increase in the liquid flow rate could reduce heat accumulation in an EO system because the liquid flow helps dissipate heat by promoting convective heat transfer. In addition, Angulo et al. (2020) suggested that an increase in the liquid flow rate could reduce the accumulation of gas bubbles near the electrode surface, impeding mass and electron transfer and leading to localized heating. However, the removal efficiency of phenolic compounds in this study was highest at a median velocity of 0.0025 m/s (corresponding to a feed flow rate of 120 mL/min). An explanation for this is that as the water velocity increased, the contact time for both the oxidizing agents and phenolic compounds in the bulk decreased, causing the reaction efficiency to decrease. Therefore, the results revealed that the interplay among the water flow rate, boundary layer thickness, and reaction contact time is important for optimizing the removal efficiency of phenolic compounds in the EO process.

EO, with its proven ability to effectively remove NH3-N, offers promising solutions. For instance, Zhou et al. (2016) reported the removal of NH3-N from landfill leachate using an EO system with boron-doped diamond electrodes at a current density of 50 mA/cm2, electrolysis time of 6 h, and feed flow rate of 100 mL/min. They achieved a removal efficiency of NH3-N of 74.06%, with an energy consumption of 223.2 kWh/m3, demonstrating the energy efficiency of the EO system. The removal of NH3-N is suggested to occur via an indirect oxidation reaction, as follows (Rao et al. 2001):

$$2{\text{NH}}_{4}^+ + {\text{Cl}}_{2} \to {{\text{N}}_2} + 2{\text{HCl}}$$
(4)

In this study, the effect of the feed flow rate on NH3-N removal was investigated and found to be similar to that on the removal of phenolic compounds. Figure 7c shows the removal efficiency of NH3-N at various feed flow rates in the range of 80–160 mL/min. The highest removal efficiency of NH3-N (92.26%) was achieved at a feed flow rate of 120 mL/min and the residual NH3-N concentration was 2.36 mg/L. In contrast, when the feed flow rate was increased or decreased from the optimal value, the removal efficiency of NH3-N decreased. For example, at feed flow rates of 80 and 160 mL/min, the removal efficiency of NH3-N was reduced to 85.82% and 86.85%, respectively.

GC–MS analysis of profiles of phenolic compounds before and after electrooxidation

Table 1 presents the major phenolic compounds in the POP-EC-treated POME based on GC–MS analysis (Table 1). The major phenolic compounds, presented in order of their relative chromatographic peak areas, were vanillin, 2,5-dihydroxybenzaldehyde, 2,4-di-tert-butylphenol, benzeneacetaldehyde, 4-amino-1,2-benzenediol, 4-(4-tert-butylphenyl)-1,3-thiazol-2-ylamine, 1 2-benzenedicarboxylic acid, phenol, 4,4′-(1-methylethylidene)bis-, and phenol, 4-(1,1-dimethyl propyl)-. The relative peak areas of the first and second compounds were more than double that of the third compound (Table 1). Vanillin, the phenolic compound with the highest concentration in POP-EC-treated POME, belongs to the benzaldehyde family and contains hydroxy and methoxy substituents at positions 3 and 4, respectively (Jenkins et al. 2024). When dissolved in water, vanillin causes the water to appear orange-yellow. 2,5-dihydroxybenzaldehyde, the phenolic compound with the second-highest concentration in POP-EC-treated POME, belongs to the benzaldehyde family and has hydroxyl substituents at positions 2 and 5 (Brito et al. 2017). When dissolved in water, 2,5-dihydroxybenzaldehyde causes water to appear yellow, green, and brown. Based on their concentrations in the wastewater samples and their color properties, it is likely that the color of the EC-treated POME was mainly caused by the presence of vanillin and 2,5-dihydroxybenzaldehyde.

Table 1 Major phenolic compounds in the POP-EC-treated POME based on GC–MS analysis

Table 2 presents the major phenolic and heterocyclic organic compounds in the POP-EC-EO-treated POME wastewater samples based on GC–MS analysis. The major phenolic and heterocyclic organic compounds, presented in order of their relative chromatographic peak areas, were 2,3-dihydro-3,5-dihydroxy-6-methyl-(4H)-pyran-4-one (DDMP), a phenylmethyl-related compound (m/z 91 and a retention time of 21.4 min), benzeneacetaldehyde, ethyl p-acetamidobenzoate, 2,4-di-tert-butylphenol, hydroquinone, 1,2-benzenedicarboxylic acid, phenol 4-(1,1-dimethyl propyl)-, 2(5H)-furanone, and 4-(4-tert-butylphenyl)-1,3-thiazol-2-ylamine. The relative peak area of the first, second, and third compounds were more than double that of the fourth compound (Table 2). Vanillin and 2,5-dihydroxybenzaldehyde were not detected in the POP-EC-EO-treated POME samples, indicating that the colored compounds were degraded, whereas hydroquinone and furanone, which are common end products of oxidized aromatics and ring-opening products (Đuričić et al. 2023), were detected. In addition, DDMP was suggested to be a ring-opening product of the oxidation reactions because it was present in relatively large quantities but was not detected in the wastewater samples before the EO process.

Table 2 Major end products of the electrooxidation of the POP-EC-treated POME with graphite electrodes based on GC–MS analysis

Cost analysis

Table 3 estimates the operating costs of the combined process, including power consumption and chemical costs. The estimated cost for the organic precipitation unit was 25.6 USD/m3 for pig blood protein, 3 M HCl, and electricity costs. The main expense for the EC unit was the electricity cost of 21.5 USD/m3. For the EO unit, the electricity cost was 123.2 USD/m3. The total operational cost of the combined treatment process amounted to 170 USD/m3, which was notably higher than the cost of fresh water in normal situations. However, the revenue from the harvested crude tannin-protein complexes, a valuable by-product of the treatment process, can be as high as 260 USD/m3, resulting in a substantial net profit of 90 USD/m3. Similar to a previous report on olive oil wastewater treatment (Al-Qodah et al. 2022), olive mill wastewater has been identified as a source of various bioactive materials, mainly phenolic compounds. These phenolic compounds can be valorized as by-products because they are notable for their antioxidant properties and can be used as additives for different consumable products and cosmetic applications.

Table 3 Analysis of the operating costs of the combined wastewater treatment process with organic precipitation, electrocoagulation, and electrooxidation in series

Conclusions

This study demonstrated the efficiency of EO in removing residual phenolic compounds, color, and NH3-N from POME treated in series with anaerobic digestion, organic precipitation, and EC. Preliminary organic precipitation significantly enhanced the efficiency of EO, particularly in phenolic compound removal, possibly by eliminating condensed tannins that could interfere with EO reactions. Decreases in phenolic compound concentration (97.22%), color (98.49%), and NH3-N concentration (92.26%) in the treated POME were obtained using the EO process with an MP configuration at a current density of 60 mA/cm2, feed flow rate of 120 mL/min, and electrolysis duration of 9 min. Furthermore, GC–MS analysis confirmed the degradation of colored compounds and the generation of end products such as hydroquinone and furanone, demonstrating the efficiency of EO in refining the quality of treated POME. Future studies should examine EC prior to biological treatment to evaluate its efficacy and cost-effectiveness compared to the existing procedure for treating wastewater.