Introduction

Large quantities of waste cooking oils (WCOs) are produced from kitchens in different facilities like households and restaurants [1, 2], catering facilities [3], hotels [4], or fast-food shops [5] in developed and developing countries. Catering service sector is one of the largest producers of this residue around the world [6, 7].

In most cases, WCOs are discarded in waste containers [8] or wastewater drains [5], causing considerable environmental concerns, like clogged drains and sewers, or water, air and soil pollution [9, 10]. Moreover, WCOs are considered as hazardous wastes (HWs), thus inappropriate disposal of WCOs may create considerable environmental concerns [11, 12].

The amount of WCOs generated rises every year, due to the evolution of different business sectors (e.g., industrialization or tourism) and the tendence of human populations to move into big cities [13], which increases urbanization levels and located oil consumption [14]. According to the Food and Agriculture Organization (FAO) [15], the global demand and consumption of edible palm oil raised very speedily, from 20.74 million tons (Mt) in 1999 to 75.88 Mt in 2020. In the past, the majority of these oils were used for human nutritional purposes, but the percentage dedicated to other uses such as industry and animal feed grew from 7.5% in 2000, up to 34.7% in 2017 [16]. Main WCOs producing countries are China, Malaysia, the United States of America, Europe, Taiwan, Canada, and Japan, accounting for approximately 16.54 Mt of WCOs every year [17]. As reported by Teixeira et al. [16], China and India being the most populous countries, produced the majority of WCOs worldwide with circa 5.6 Mt/year and 1.135 Mt/year, respectively. On the other hand, Canada, Demark, Spain, Italy, Japan, South Korea and United Kingdom, present middle WCOs productions, ranging from 0.1 to 0.5 Mt/year. Finally, countries such as New Zealand, Slovenia, Ireland, and Cyprus, all together, generated less than 0.1 Mt/year. The generated amount of WCOs in developing countries such as Iran [18], Pakistan [19], Colombia [20], or India [16], ranged from 0.225 to 1.135 Mt/year. The total generation of WCOs in the catering facilities of cities from developing countries was stated to be near 29.2 tons/year [18, 21]; while in Europe, approximately 0.85 Mt of WCO are generated in the household sector, and 0.80 Mt in the commercial sector [17].

Suitable recycling of WCOs for energy generation has been considered as one of the more effective approaches for solid waste management (SWM) with multiple natural advantages [22]. WCOs recycling into biofuels represents the valorization option to reduce environmental concerns, such as climate change, water and air pollution, or CO2 emissions reduction [23,24,25]. Moreover, it would prevent human health problems (e.g., safeguarding food safety) and may represent a renewable energy source in many countries [24].

As a result, instead of discarding WCOs in landfills or drainage sites, biodiesel and other biofuels, may be produced as renewable and clean energy sources, contributing to the progress and development of the renewable-energy industry [26, 27]. One of the main indicators of a sustainability assessment framework for biofuel systems is greenhouse gas (GHG) emissions [28, 29] and, among biofuels, biodiesel plays the most significant role in reducing it.

In addition, according to previous works, the selection of raw materials for biodiesel production plays a significant role in the final fuel cost calculation [30], and WCOs are available in large amounts and low cost. Besides, in comparison with vegetable oil-based biofuels, such as coconut, soybean, croton, or olive-based biodiesel, WCOs-based biofuels are not only inexpensive, but also more sustainable in terms of water, energy or land use [31, 32], and GHG emissions during its life-cycle assessment [33]. Consequently, WCOs-based biodiesel production constitute a remarkably sustainable valorization process [34], as well as an effective way to decrease energy utilization and lower emission levels [35]. Moreover, it can be considered as a cleaner production strategy due to: 1) savings on raw materials and energy; 2) reduction of hazardous wastes (HWs); 3) waste minimization (WM), through materials recovery for energy production; 4) optimization of processes and resources [28, 36]. To date, this liquid biofuel is one of the most sustainable energy sources for developing countries and, because of its reliability and sustainability, it is considered as a renowned source of green energy [37].

Fatty acid methyl esters (FAMEs), the principal constituents of biodiesel, originate by the transesterification of fats and oils using alcohol (usually methanol) in the presence of a catalyst [30]. Most usual methods for the valorization of WCOs are microemulsion, pyrolysis, or transesterification, among others [38]. Transesterification or alcoholysis, is the most popularly applied and well-known biodiesel production process [9], because of its cost competitiveness [39]. It consists on an equilibrium and reversible reaction, where fats and oils react with an alcohol in the attendance of an acid or base catalyst to generate biodiesel and glycerin [9, 40]. Reaction time and temperature, catalyst type, catalyst concentration, alcohol to WCO ratio, alcohol kind, moisture content, and free fatty acids (FFA) content, are the main factors affecting a transesterification reaction [41, 42]. It could be carried out using homogeneous base catalysts like potassium hydroxide, sodium hydroxide, or homogeneous acid catalysts like sulfuric acid [43, 44].

As reported in the literature concerning modeling studies, once examined the factors affecting the response variable and investigated the adequacy of the model, a process optimization step is necessary and unavoidable [45]. Process optimization is often time-consuming and requires repeated and overrated examinations. In addition, owing to the concurrent effects of some operating parameters in the system, the planification and application of modeling tools, like response surface methodology (RSM), is necessary to maximize performance and decrease the possible influences of human procedures during the production and analysis process [46, 47]. RSM is suitable for optimizing complex systems where responses are impressed using various variables [48]. Furthermore, previous works reported that RSM could be applied effectively to study the effects of main operating independent variables (such as methanol/catalyst to oil ratio, or reaction temperature) on biodiesel yield [45, 49]. Several RSM methods, like central composite design (CCD) [50], Box–Behnken design (BBD) [51] or D-optimal design [52], have been used for the optimization of biodiesel production.

In contrast to CCD and BBD, that allow only quantitative factors, D-optimal design approaches can combine both, quantitative and qualitative factors, in the same experimental design [53, 54]. For example, Adekoya et al. [55], reported ideal conditions to achieve a maximum yield of biodiesel (98%), applying RSM based on D-optimal experimental design, as 60 °C of temperature, for 180 min, with a 6:1 methanol to WCO ratio, and a catalyst concentration of 2.54 wt% (sodium hydroxide). In addition, Corral Bobadilla et al. [56] applied RSM based on BBD to study the effects of the independent variables, like methanol to oil ratio (6:1 to 9:1), NaOH catalyst (1–2 wt%) or temperature (20–40 °C), on the calorific value (as response variable) of biodiesel produced from WCO. Results indicated that the dose of NaOH was the most critical reaction parameter, and ideal conditions to maximize biodiesel’s calorific value were 33.7 °C, 20 min time, methanol/oil ratio of 6.4:1, and 1 wt% catalyst concentration.

Therefore, according to the literature, RSM based on D-optimal design has sufficient capability and reliability to optimize biodiesel production from WCOs, providing not orthogonal matrices whose effect estimates are associated, and helping to determine the input factors settings that are needed to obtain a desired output [52].

Besides, many peer reviewed studies have focused on the optimization of biodiesel yield as a quantitative parameter [51, 57,58,59,60], while few of them have focused on the optimization of the calorific value as a quality parameter [61,62,63]. As an example, Sakarika et al. [62] and Chen et al. [61] reported calorific values (kcal/kg) as response variable for biodiesel produced from coastal macroalgae (Chara vulgaris), and microalgae Chodatella sp., respectively. Nevertheless, scarce information is available regarding to the optimization of biodiesel calorific values using S-WCO as feedstock.

It is totally necessary to continue the search for simple, convenient, and low-cost methods for the valorization of WCOs, especially in economically backward regions and countries with inadequate or poor management of residues, like Iran. Many researchers have focused on the use of RSM, based on CCD or BBD designs, for the optimization of biodiesel from WCOs [64, 65], but only a few studies, like those mentioned above, have studied RSM based on D-optimal design [52]. Nevertheless, there is no evidence in the literature of biodiesel production using S-WCO from catering facilities as feedstock, assisted by RSM based on D-optimal design to maximize calorific value (kcal/kg), influence factors, physicochemical properties, and operating conditions.

Main goal of this work is the collection of WCOs from different catering services in Tehran (Iran), for a further pretreatment and centrifugation, in order to use the supernatant upper phase as raw material for biodiesel production. RSM based on D-optimal will be used for the optimization of transesterification reaction and physicochemical properties of reactants and products will be analyzed.

The findings of this study have broad sustainability implications, both in regions with an improper management of WCOs, and in the drive of using WCOs as inexpensive and sustainable raw material for the biodiesel production and biobased products.

Materials and methods

Reagents

NaOH pellets (99%, Merck), methanol (Merck Millipore), and hydrogen chloride (Hydrochloric acid: HCl, 37%, Merck) were purchased from Merck, Germany. NaOH and methanol were applied in the transesterification as catalyst and alcohol, respectively. In addition, double distilled deionized water was used throughout the study.

Research location and sampling of WCOs

This work was performed in Tehran (35.6892° N, 51.3890° E), the largest city in Iran, with 22 distinct geographic regions. Waste cooking oils were gathered in forty-nine sampling locations from catering facilities and blended in a large barrel tagged as O-WCO (original waste cooking oil). The amount of O-WCO collected from each location was 1.5 L/day and this process continued for a week (7 days) until the volume of O-WCO reached 10.5 L.

Pre-treatment of O-WCO

Original waste cooking oil was filtered via a cloth (300 µm) to segregate food residues [66, 67]. Subsequently, to remove finer particles and insoluble impurities, 150 µm, 75 µm and 20 µm multi-mesh sieves were used. Filtered and sieved O-WCO was heated to 100–110 °C for 1 h to reduce the moisture content.

Pretreated O-WCO was centrifuged at 12,000 rpm for ten minutes and 30 °C, using a compact high-speed centrifuge of the CF-RX2 series from HITACHI (Japan Co., Ltd), to separate the supernatant (S-WCO) and the bottom phase (B-WCO). Even though B-WCO can be used for the production of solid alcohol fuel (data not published yet), this study concentrates only in the production of biodiesel from the supernatant phase (S-WCO).

S-WCO biodiesel production, preparation, and analysis

To produce biodiesel, a 250 mL round-bottom flask, prepared with a magnetic stirrer, a reflux condenser with tap water (to avoid methanol evaporation), a paraffin bath, and a thermocouple probe were used. NaOH granules were dissolved in methanol before being added to the reactor containing 30 g of pre-heated S-WCO. Reaction temperatures were 50, 55, 60, 65, and 70 °C, for the different experiment series. Reactants were kept at reaction temperature for 30, 45, 60, 75 or 90 min, under continuous agitation (650 rpm). Methanol to S-WCO ratio varied between 2:1 and 10:1, while the amount of NaOH varied between 0.2 wt% and 1 wt% of the S-WCO weight. The reaction mixture was permitted to halt for 5 min, and next quelled with dilute HCl (0.056 mL of 4% HCl) to neutralize the catalyst.

Neutralized mixture was subsequently rinsed, in a series of four cycles, with hot doubly distilled deionized water in a separatory funnel [68] until the residual water was clear [69]. In this purification step, double distilled deionized water (at least 10% v/v of S-WCO volume), pre-heated at 50 °C, was poured to the biodiesel sample and gently agitated for 10 min. After that, the mixture underwent a density-driven phase separation [69]. To remove residual methanol, catalyst, and glycerol, washed biodiesel samples were centrifuged at 4000 rpm for 10 min at 25 °C [13, 34]. Finally, biodiesel samples were rotary evaporated under vacuum conditions at 60 °C for 1 h, for further separation of residual methanol and water [13, 70]. The product produced in this step was a yellow S-WCO-based biodiesel.

Determination of physicochemical properties

Physicochemical properties of O-WCO, S-WCO, B-WCO, and S-WCO-based biodiesel were determined according to ASTM, DIN, EN, and AOCS standards by triplicate for each analytic variable. Acid value (AV; mg KOH/g), iodine value (IV; g I2/100 g) and saponification value (SV; mg KOH/g) of all samples (both, raw materials and product) were quantified using a titration method, including AOCS-Cd 3d-63, AOCS-Cd 1d-92 and AOCS-Cd 3b-76, respectively. Please refer to the Supporting Information for more specific details.

Statistical analysis

D-optimal experimental design

In this work, D-optimal design was applied for statistical analysis of the experimental data using the MODDE software version 12.0.1 [71]. Effects of the main operational variables, namely methanol/ S-WCO ratio (X1), catalyst concentration (X2, NaOH wt%), temperature (X3, °C), and reaction time (X4, min), related to the S-WCO biodiesel calorific value (as response variable), were investigated through fifty-six duplicate experiments. Operation parameters range and level for the production of S-WCO-based biodiesel are described in supplementary table S1. Selection of variables and their intervals was performed according to past experimental works [68, 72]. As mentioned previously, the response variable (S-WCO-based biodiesel calorific value) was associated to the selected factors by a full quadratic model, like the one presented in Eq. 1 [51, 52]:

$$Y= {\beta }_{0}+ \sum_{i=1}^{n}{\beta }_{i }{x}_{i}+ \sum_{i=1}^{n-1}\sum_{j=i+1}^{n}{\beta }_{ij}{x}_{i}{x}_{j }+ \sum_{i=1}^{n}{\beta }_{ii}{x}_{i}^{2},$$
(1)

where Y is the predicted calorific value (kcal/kg) of S-WCO-based biodiesel; xi and xj are the uncoded parameters; and n is the number of factors. Finally, β0, βi, βii, and βij stand for the model coefficients.

Regression analysis of experimental data by RSM based on D-optimal experimental design (regression model)

The statistical software MODDE version 12.0.1 was applied for regression and graphical analyses of the acquired data, as well as for the statistical analysis of the model to appraise the variance analysis (ANOVA). Initially, MODDE uses regression analysis to estimate the coefficients of the model. In this work, the dependent or response variable, “Y” (calorific value), is predicted by means of a regression model, from a set of independent variables or factors “xi” (namely methanol/ S-WCO ratio, catalyst, temperature, and time). Furthermore, if the p-value acquired from the regression analysis is less than or equal to 0.001 at 95% confidence level, there is a statistically significant communication among the response and independent parameters. Nevertheless, if the p-value obtained from the regression analysis is greater than 0.001, there is no statistically significant communication among the response and independent parameters. Finally, the fit of the model can be checked through the following techniques:

Analysis of variance (ANOVA)

In order to evaluate the performance of the selected optimization model and the effect of independent parameters on the response variable, calorific value data, obtained from biodiesel combustion, were analyzed using ANOVA. The results of ANOVA included squares sum (SS), residuals and statistical parameters of the model’s goodness of fit (i.e., R2, RSD, Q2, adjusted R2). If the values of r-square (R2) and adjusted R2 are close to one, it indicates that there is a high relationship between observed and predicted values; and if their difference is below 0.2, it indicates the suitability of the obtained quadratic model and shows the high importance of the predicted model [71].

Confirming the mathematical model

Fit chart summary The developed model acquired from D-optimal design by MODDE software was studied with respect to multiple R-squared (R2 based on %), cross-validation (Q2 based on %), model validity (based on %), and reproducibility (based on %). Please refer to the Supporting Information for more specific details.

Replicate plot It provides a quick overview of the raw data describing the results discrepancy for the total runs. Calorific value data (green and blue points, kcal/kg) were plotted against the experimental runs, showing the changes in response for the replicated runs.

Normal probability plot of residual It was used to represent the residuals of answer versus the normal probability of the distribution. If the examinations were in a straight line, then the residuals were ordinarily spread. Spots beyond (± 4 SD) were remarked outliers and should be investigated for errors. Furthermore, if the degrees of freedom for lack of fit (DF) are lower than five, the graph can show an unusual pattern [71].

Coefficient plot (scaled and centered) or effect plot Regression coefficients from the statistical calculated model, for the scale and centered coefficients, and their 90% confidence intervals were represented to show the importance and statistical significance of the various variables of the model [71]. The effect of independent variables on the calorific value and the interaction between them were determined by the coefficient plot.

Normal distribution of the response variable graph

The normal distribution of the response variable (calorific value) is a popular and ordinary procedure to assess model and consist on a regression of predicted vs. observed values. Observed graph versus predicted plot were applied for the normal distribution of the response variable graph. For a good model, the points should be close to a straight line [71].

Factor effect plot and response surface contour plot

The effect of the independent variables and the interaction of these variables on the predicted calorific value was studied by the factor effect plot and the response surface contour plot, respectively, using a quadratic model.

Ideal RSM operating conditions based on D-optimal experimental design

In modeling studies, after examining the factors of the response variable (calorific value) and investigating the suitability of the model and how each of the factors affects the response variable, process optimization is necessary and unavoidable [73, 74]. RSM based on D-optimal design was used in the ideal operating conditions of the independent variables (methanol/oil ratio, reaction temperature, time, and catalyst concentration) to achieve the maximum variable response (calorific value). Another way to demonstrate the probability of acquiring findings outside specification ranges, in the process optimization by RSM based on D-optimal design, is the process performance index or probability of failure (Cpk) [71]. If the simulation average is outside the range provided by the user, the value of Cpk is less than zero (Cpk < 0) [71].

Results and discussion

Physicochemical properties of O-WCO, S-WCO and B-WCO

Key physicochemical properties of O-WCO, S-WCO and B-WCO such as AV, IV, SV, density (kg/m3), kinematic viscosity (mm2/s), FFA content (wt%), and water content (v%) obtained in this work and compared to other studies are shown in supplementary table S2.

Original waste cooking oil determined properties

The original waste cooking oil sample collected in this study was a dark brown mixture of liquid at 25 °C. Its density at 15 °C and kinematic viscosity at 40 °C were 913.9 ± 0.45 kg/m3 and 56.05 ± 0.075 mm2/s, respectively. Its calculated AV was 1.83 ± 0.002 mg KOH/g. As shown in supplementary table S2, AV may vary from lower magnitudes (e.g., 0.8 mg KOH/g [58]) to high values (e.g., 12.86 mg KOH/g [5]), depending mainly on the oil type [55, 75,76,77]. As reported in the literature, oils with an AV < 2 mg KOH/g, may be transesterified using a basic catalyst without previous treatment [78,79,80,81].

Fatty acid composition of O-WCO is presented in supplementary figure S1, together with S-WCO. According to figure S1, main fatty acids in the original waste cooking oil were oleic acid (C18:1), linoleic acid (C18:2), palmitic acid (C16:0), and stearic acid (C18:0) with 39.41%, 32.10%, 19.60%, and 5.80%, respectively. The total amount of these fatty acids accounted for 96.91% of all the triglycerides present in the original sample, which is similar to previous works showed in supplementary table S3. Moreover, FFA content in the original sample was 1 wt%, which represents a relatively low value for a waste oil when compared to the literature [82, 83], as shown in supplementary table S2. As mentioned in the previous section, oils with FFAs contents ≥ 3 wt%, may not proceed to a direct transesterification, thus FFA may consume the basic catalyst and decrease the abatement efficiency of the reaction. Those type of oils shall be subjected to a pre-esterification reaction with acid catalysts [84, 85]. In the particular case of this study, basic catalyst may be used directly without any concern.

Presence of water and other solid impurities in feedstocks for transesterification, may cause triglycerides hydrolysis to FFA resulting in low yields and high catalyst consumption [84, 86]. In the present study, water content of O-WCO was 0.023 ± 0.0001 v%. Based on the literature, the water content should be kept below 0.1 wt% (0.92 v%) [87, 88]. Saponification number in the original oil sample was determined as 200.3 ± 0.15 mg KOH/g, a relatively high value when compared to other publications as shown in supplementary table S2. Iodine value was also measured and resulted in 70 ± 0.13 g I2/100 g for the O-WCO, a relatively low value, compared to other studies in supplementary table S2. However, standard values for saponification and iodine values in biodiesel feedstocks have not been established throughout the world yet, and state and local agencies have no monitoring programs in this regard. Nevertheless, previous works suggested that saponification and iodine values of 69.40 g I2/100 g and 143.6 mg KOH/g for WCO were suitable for the preparation of biodiesel [13]. In addition, determined properties for original waste cooking oil (O-WCO) in this work compared to other related studies are displayed in supplementary table S2.

Centrifugated supernatant and bottom waste cooking oil determined properties

The supernatant phase obtained after centrifugation of the O-WCO was a dark brown liquid at room temperature, whose SV and IV were 207.8 ± 0.48 mg KOH/g and 78.2 ± 0.14 g I2/100 g, respectively. These values are slightly higher than the original WCO sample. Besides, the bottom phase after original oil centrifugation (B-WCO) presented a soft dark brown solid appearance at 25 °C. Its saponification number was determined at 199.5 ± 0.21 mg KOH/g and it showed a IV of 58.7 ± 0.11 g I2/100 g. Both were slightly smaller than the original WCO. Results presented in supplementary table S2 showed that after centrifuging the original sample, kinematic viscosity reduced from 56.05 ± 0.075 to 40.05 ± 0.046 mm2/s for the supernatant phase and raised to 54.3 ± 0.089 mm2/s for the bottom phase. The original density of the sample was reduced from 913.9 ± 0.45 to 904 ± 0.19 kg/m3 for bottom phase after original oil centrifugation and 906.8 ± 0.89 kg/m3 for supernatant phase after original oil centrifugation. Moreover, main fatty acids in S-WCO were oleic acid (C18:1, 50.82%), linoleic acid (C18:2, 23.06%), palmitic acid (C16:0, 19.62%), and stearic acid (C18:0, 4%), which represented approximately 97.5% of the triglycerides of O-WCO, which is similar to previous works reported in supplementary table S3. In addition, the calorific value of the S-WCO was 8802.11 kcal/kg (36.82 MJ/kg). Generally, S-WCO derived from O-WCO shows a higher iodine value (78.2 ± 0.14 g I2/100 g) and a higher content of unsaturated fatty acid (50.82% oleic acid and 23.06% linoleic acid). Furthermore, it has been proved by Xiong and co-authors, that the S-WCO containing less saturated fatty acids than the original waste cooking oil sample from CNHLS fast-food restaurant (Guilin, China), could be applied for the production of biodiesel [13]. Hence, it can be concluded that the S-WCO with a higher iodine value can be recycled economically and efficiently as low-cost, accessible, and renewable raw material, compared to other oils for biodiesel generation.

RSM based on D-optimal experimental design regression analysis

Experimental points (for coded and uncoded values) obtained through RSM for the production of S-WCO-based biodiesel are presented in Table 1, while regression coefficients and response quadratic model significance are described in Table 2, together with the analysis of variance of the fitted quadratic regression model. According to the regression analysis in Table 2, p-values for X1 (methanol/S-WCO ratio), X2 (catalyst), X3 (temperature), X22, and X32, below 0.001, with 95% confidence level, significantly affected the calorific value of S-WCO-based biodiesel. Results also show that, X4 (reaction time), was insignificant for the production of biodiesel, meaning that this parameter may not affect the calorific value of the resulting product. Furthermore, the multiple r-squared value was 0.924 (close to 1), corroborating the strength of the regression relationship. According to the regression analysis showed in Table 2, all linear terms (except for X4) presented very strong impact on the biodiesel calorific value, as their low p-values (< 0.001) indicate. Moreover, ignoring insignificant parameters (such as X4), the quadratic model for parameters affecting the biodiesel calorific value (Eq. 2), could be obtained in terms of real factors:

$$Y_{i} \left( {{\text{kcal}}/{\text{kg}}} \right) = {935}0.{69} + {31}.{1759}X_{{1}} {-}{17}.{85}X_{{2}} {-}{25}.{7766}X_{{3}} {-}{82}.{15}0{5}X_{{2}}^{{2}} + {92}.{1327}X_{{3}}^{{2}} \,r\, = \,0.{924}{\text{.}}$$
(2)

where Yi is the predicted response factor (calorific value). X1, X2 and X3 are methanol to S-WCO ratio, catalyst concentration (NaOH) and reaction temperature, respectively.

Table 1 Experimental points for S-WCO-based biodiesel production
Table 2 Analysis of regression and analysis of variance (ANOVA) for response surface quadratic model

Analysis of variance (ANOVA) for response surface quadratic model

In order to evaluate the selected model goodness, for the optimization and influence of independent parameters on the response variable (biodiesel’s calorific value), an analysis of variance (ANOVA) was used. The results of ANOVA, including sum of squares (SS), residuals and statistical parameters of fit goodness (R2, RSD, Q2 and adjusted R2), are shown in Table 2. In this work, R2 was 0.924, which indicates the importance and significance of the obtained quadratic model. In addition, based on Table 2, this model ideally shows the findings of the experimental range studied (adjusted R2 = 0.916). Hence, according to Table 2 and Fig. 1A, the model presented a high relationship between observed and predicted values. The first and second column of Fig. 1A are multiple R-squared (R2) and cross-validation (Q2), respectively. Based on the second column of Fig. 1A, Q2 in this work was greater than 0.5 indicating that the model can be an estimate of the future prediction accuracy. In addition, the first and second column of Fig. 1A, the difference between R2 and Q2 was 0.02 (lower than 0.3) a sign of the goodness of this model. Furthermore, ANOVA results show a negligible lack of fit (0.73, much higher than 0.05) indicating the goodness of the model. In addition, "F-value" and "p-value" for lack of fit were 0.761953 (greater than 0.05) and zero (less than 0.0001), respectively, which indicates that the data fit the quadratic model and confirms the validity of the selected model as well as the accuracy of the tests. These parameters indicate that the quadratic model is statistically highly significant at 95% confidence level. Hence, the proposed model is suitable for interpreting calorific value processes and can be used in future studies. Besides, according to the results of ANOVA and Eq. 2, the variables of X1 (methanol/S-WCO ratio), X2 (catalyst) and X3 (temperature) significantly affected the calorific value of S-WCO-based biodiesel. However, the value "SS of the constant" is large, which means that many factors such as catalyst type, alcohol kind, moisture content, agitation speed (rpm), and even other variables than those considered, are influential. The possibility of checking those parameters may result in a better model.

Fig. 1
figure 1

Confirming the quadratic mathematical model by fit chart summary (A); replicate plot (B); normal probability plot of residual (C); coefficient plot (scaled and centered) (effect plot) (D)

Confirming the mathematical model

Fit chart summary The third column of Fig. 1A represents the model validity, a test for diverse model problems. In this study, model validity was 0.92112 (more than 0.25), which indicates that there is no lack of fit in the model. The fourth column of Fig. 1A is reproducibility. The developed model acquired from D-optimal design can be studied by the reproducibility, it means, the change of the answer (response) under the same situations (pure error) contrasted to the whole change of the answer. Reproducibility of the calculated model is much higher than 0.5, and even close to one (0.90802), which indicates that the model has good reproducibility.

The replicate plot of biodiesel calorific value shown in Fig. 1B, describes the results discrepancy for the total runs, to provide a quick overview of raw data. Calorific value data (green and blue points) were plotted against experimental runs showing the response changes. On the other hand, the values of the responses (green and blue points were displayed by MODDE software) were drawn versus empirical runs indicating the variation in the answer for replicated examinations. Results indicate that change in the repeated experiments is less than the overall change for the response, and the replicate graph shows that all calorific value data were between 9150 and 9450 kcal/kg.

Residuals normal probability graph for calorific value is described in Fig. 1C, that plots the residuals of a response against the normal probability of the distribution. As can be observed, all points on the graph present a tendence close to a straight line, indicating that the residuals are normally distributed. In addition, because the DF value for this work was 50 (> 5), unusual patterns and outliers were not displayed on the graph. Moreover, a curved pattern indicates modeled quadratic relationships.

Coefficient (scaled and centered) graph Coefficient plot or effect plot (antagonistic and synergistic effects) of different independent variables and their interaction on the calorific value are shown in Fig. 1D. The independent parameters methanol/S-WCO ratio (X1), catalyst (X2) and temperature (X3); and the interaction between variables such as catalyst/catalyst (X22) or temperature/temperature (X32) were significant variables to the model, which is consistent with the results shown in Table 2. In addition, Fig. 1D shows that the lowest and highest effects were related to catalyst concentration (X2) and the interaction between temperature and temperature (X32), respectively. The figure shows also that the effect of independent variables and the interaction between them on the calorific value may be ordered as follows: X32 > X22 > X1 > X3 > X2. It also indicates that variables with a positive range possess synergistic effects (strong positive correlation, p < 0.05) on the calorific value (X1 and X32), while those with a negative range present antagonistic effects (strong negative correlation) on the calorific value (X2, X3, X22).

Normal distribution of calorific value (observed vs. predicted plot)

Figure S2 represents observed against predicted results for calorific value, shows a tendence close to a straight line, which indicates a very good model for the prediction of the response variable. In addition, the figure shows that data in the quadratic model are normally distributed, and no deviations are observed.

Effect of independent variables, and variables interaction

The effect of the independent variables mentioned above, on the predicted calorific value through quadratic model, also known as factor effect plot, is shown in Fig. 2A–C. Results shown in Fig. 2A, indicate that an increase in methanol to S-WCO ratio from 2 to 10, increases the calorific value from 9320 to 9382 kcal/kg. In the same way, Fig. 2B describes how increasing the catalyst concentration from 0.2 to 0.6 wt%, the calorific value also increases from 9285 to 9350 kcal/kg, while an increase in the catalyst concentration from 0.6 to 1 wt%, reduces the calorific value to 9250 kcal/kg. Furthermore, Fig. 2C shows that increasing the reaction temperature from 50 to 61 °C, reduces the calorific value from 9468 kcal/kg to a minimum (9350 kcal/kg), but a further increase in the reaction temperature to 70 °C, increases the calorific value until 9415 kcal/kg.

Fig. 2
figure 2

Factor effect plots for methanol to S-WCO ratio (X1) (A), catalyst concentration (X2) (B) and reaction temperature (X3) (C) and response surface contour plot for methanol to S-WCO ratio and reaction temperature (X1:X3) (D), methanol to S-WCO ratio and catalyst concentration (X1:X2) (E) and catalyst concentration and reaction temperature (X2:X3) (F)

The simultaneous effect of different variables (response surface contour plot) such as methanol/S-WCO ratio and temperature (X1:X3); methanol /S-WCO ratio and catalyst concentration (X1:X2) or catalyst concentration and reaction temperature (X2:X3), on the predicted calorific value through quadratic model is shown in Fig. 2D–F. Figure 2D shows that the maximum calorific value obtained from biodiesel occurs when the reaction temperature and methanol/S-WCO ratio were 50 °C and 10, respectively, which is consistent with Table 2. Hence, based on the results of Fig. 2D and Table 2, methanol to S-WCO ratio and catalyst concentration, at 95% confidence level, significantly affect the calorific value of the produced biodiesel. According to Fig. 2E, the maximum calorific value obtained from biodiesel occurs when catalyst and methanol to S-WCO ratio were 0.56 wt% and 10, respectively. Finally, as shown in Fig. 2F, the highest calorific value acquired from biodiesel took place when the temperature and catalyst percentage were 50 °C and 0.56 wt%, respectively. Generally, based on the results of the present study, methanol/S-WCO ratio, reaction temperature and catalyst concentration had important effects on the generation of S-WCO-based biodiesel, which is similar to previous works [58]. Present results reveal that the reaction time did not have an effect on the generation of S-WCO-based biodiesel but can be straightly linked to the energetic efficiency of the process, which is consistent with a previous work [89].

Ideal operating conditions by RSM based on D-optimal experimental design, compared to other related studies

In this work, the optimization of the process was considered in order to maximize the calorific value along with the independent variables/factors as shown in Fig. 3. Optimal values, for the independent and response variables, are reported in supplementary table S4. The relationship between independent variables/factors is complicated and difficult to recognize from simple experiments, therefore, the optimization of these factors by statistical methods is required [61]. According to Table S4 and Fig. 3, ideal conditions to reach the maximum calorific value (9500.74 kcal/kg) were a temperature of 50 °C, 45 min reaction time, 10:1 methanol to S-WCO ratio, and a catalyst concentration of 0.56 wt%. This maximum value (9500.74 kcal/kg) was higher than reported for solid alcohol biofuel (8261.32–8885.47 kcal/kg) [21], natural gas (8600 kcal/kg), coal (4000–7000 kcal/kg), coke (6500 kcal/kg), charcoal (7000 kcal/kg), or carbon (8000 kcal/kg) [90].

Fig. 3
figure 3

Optimal operating conditions for independent variables to maximize variable response

The range of calorific values of S-WCO-based biodiesel, obtained under the selected conditions of this study, was around 9200.00–9500.74 kcal/kg, showing a difference of 300.74 kcal/kg. Nevertheless, this difference is not negligible when compared with the range of calorific values reported in the literature for biodiesel produced from crude palm oil (CPO) (9762.88–9864.83 kcal/kg, with a difference of 102 kcal/kg) [63], or from the coastal macroalgae Chara vulgaris (9108.31–9255.10 kcal/kg, with 147 kcal/kg difference) [62]. This comparison also demonstrates the strength of the study in terms of selection of the right sample size, appropriateness of the experiment conditions or appropriately selected design, among others. Moreover, when high volumes of WCO are collected, this difference might be more noticeable, and the conducted optimization process would be economically justified. As an example, the amount of WCO from the commercial sector in Qom city (Iran) was 0.671 Mt/year in 2017 [18]. When applying optimal conditions to the biodiesel production using this residue, a total calorific value of 201,796 million calories/year (0.671 Mt/year multiplied by 300.74 kcal/kg) might be added to the caloric potential of this biofuel, when compared to the non-optimized procedure.

As mentioned above, reaction time did not affect the generation of S-WCO-based biodiesel, but it may be straightly linked to the energetic efficiency of the process [89]. Biodiesel yield ([gbiodiesel)/gS-WCO] × 100) was 99.2% at this optimal point. Results indicate that reaction temperature significantly affects the resulting biodiesel calorific value, with a contribution factor of 84.21%, followed by methanol to S-WCO ratio (12.5%) and catalyst concentration (3.30%). This data are consistent with the findings of previous works such as Dhawane et al. [91] or Mohammed et al. [92], that studied the biodiesel production from WCO and crude Jatropha curcas oil, respectively. Effectively, Dhawane and co-authors declared that among four remarked factors, temperature, methanol/oil ratio, and reaction time, appeared as significant factors for biodiesel production from WCO, with contributions of 71.6%, 21.5%, and 5.3%, respectively [91]. Contrary to the results presented in this study, Sathish Kumar et al. [93] reported that among four considered factors, catalyst concentration was the most important factor with a contribution of 67.34%, when producing biodiesel from Manilkara zapota (L.) seed oil, followed by methanol to oil ratio (25.85%), and reaction temperature as the least important factor (1.6%). Similar results were reported by Singh et al. [94] for grape seed oil-based biodiesel production.

Optimal conditions for this study compared to other related studies are summarized in supplementary table S5, that shows the highest performance in biodiesel production (99.2%) for the present study. It also shows that for the production of WCO-based biodiesel, using NaOH as catalyst, the best range for independent variables was: catalyst concentration 0.56–1.1 wt%, methanol/oil ratio 7:1- 12:1, temperature 50–65 °C, and reaction time 2–45 min. However, when KOH was used as catalyst, the best range for independent variables was 1–2 wt%, 6:1–12:1, 45–70 °C, and 40–180 min, for catalyst, methanol/oil ratio, temperature, and time, respectively, which indicates that biodiesel production from WCO by NaOH catalyst is more profitable than with KOH and H2SO4. The causes for the small activity of acid catalyzed contrasted to base catalyzed transesterification reactions, may be described through the protonation of the carbonyl groups as the main point in the catalyst interplay with the reactant. Nevertheless, this primary chemical route has in succession raises the electrophilicity of adjoining carbon atoms, and as a result, mediator molecules are prone to nucleophilic assault. By comparison, the base catalysis follows a direct route, where an alkoxide ion is produced firstly, and straightly operates as a potent nucleophile. In addition, according to findings of this work and previous studies, alkali catalyzed reactions such as NaOH are 4000 times faster, non-corrosive, and cheaper [95, 96], and they applied when waste cooking oils content of free fatty acids is ≤ 3 wt%, whereas acid catalysts are appropriate for waste cooking oils with free fatty acids content > 3 wt% [79, 80]. Furthermore, alkali catalyzed reactions can happen at gentle reaction conditions and are less energy intensive [78].

In the case of alkaline catalysts, the reaction proceeds very fast, sodium hydroxide being the most generally utilized catalyst (Fig. 4). When an alkali is utilized, the first step is the creation of an alkoxide, that is a potent nucleophile which attacks the electrophilic carbon in a carbonyl group of the triglyceride. This attack turns the carbonyl to a quadrilateral mediator, as explained in the 2nd stage of Fig. 4. In the third step, the quadrilateral carbon separates from the mediator to create an alkyl ester. In the fourth stage, deprotonation of the catalyst regenerates the alkali, while the proton is bound to diglyceride anions as described. The catalyst reacts with an alcohol molecule, and this process is continued up to the catalyst reacts once again with one alcohol to generate glycerin and alkyl esters [97,98,99].

Fig. 4
figure 4

Homogeneous base catalyzed process for the transesterification of triglycerides: (i) generation of active species (RO); (ii) nucleophilic assail of active species to carbonyl group on triglycerides, creating a quadrilateral mediator; (iii) mediator separation; (iv) restoration of RO. The succession is repeated double for R2 and R3. B: base catalyst; R1, R2, R3: carbon chain of fatty acid; R4: alkyl group of the alcohol [97,98,99]

Another way to demonstrate the probability of acquiring findings outside specification ranges is the process performance index or probability of failure (Cpk). Please refer to the Supporting Information for more specific details.

The purification of glycerin to be used as a by-product is an expensive and energy intensive procedure [100, 101], and therefore, it was not considered in this work. Nevertheless, valorization options for glycerin have been developed in the last decades within the concept of biorefinery, utilizing chemical, thermochemical and biological conversion methods [101, 102]. Biological methods for converting glycerin into various value-added platform chemicals and fuels such as 1,3-propanediol, hydrogen, citric acid, dihydroxyacetone, bioplastics (e.g., PHAs) or ethanol, have been significantly expanded [101, 103,104,105,106,107], as well as its use in animal feed [101, 108]. In fact, the Brazilian Government has recently determined the standards for the use of biodiesel derived glycerin as a supplement of animal feed, stablishing a safe proportion of 10% glycerin per ration [102].

Specifications of biodiesel produced from S-WCO under ideal conditions

Specifications of biodiesel produced from S-WCO under ideal conditions compared with standards from Germany (DIN V 51606), United States (ASTM D 6751-07b/D6751-12), and Europe (EN 14214:2012), as well as other related studies, are summarized in supplementary table S7. Result data are consistent with international standards for several parameters mentioned above. Please refer to the Supporting Information for more specific details.

Regarding specifications of biodiesel produced from S-WCO that are consistent with international standards, it can be concluded that biodiesel production from WCOs shows the potential to solve three main issues including economic, environmental and waste management problems [24, 109]. Indeed, the valorization of this residue may help reducing environmental concerns such as GHGs and other toxic emissions, as well as avoiding contamination of waters or landfills related pollution. On the other hand, the main strategy for a cleaner production, and the main common element of sustainability, is the consideration of economic savings in raw materials [110]. Please refer to the Supporting Information for more specific details.

Conclusions

The rapid decay of the earth ecosystem is pushing states and industries around the world to consider environmental concerns related to energy consumption and production. As a result, the fuel industry is assigning growing efforts and resources to study the contribution of biofuels to sustainable development under new regulatory frames, such as the Renewable Energy Directive in Europe [111] or the Renewable Fuel Standard in the United States [112]. Biodiesel is as alternative non-petroleum-based fuel that is receiving remarkable attention owing to its renewable, non-toxic, biodegradable, environmentally clean, and reducing GHG emissions properties, compared to fossil diesel fuels. Present study may stimulate meliorated policies for Iran, and other developing countries, to recycle waste cooking oils, as a low-cost and renewable raw material to produce biodiesel, that can be blended with other fuels in diesel engines. The following conclusions were obtained according to the results of this work, related to the optimization of biodiesel production from the supernatant fraction of recycled WCO:

  1. 1-

    Regression analysis described a significant relationship between methanol to oil ratio, catalyst, and temperature, with the final calorific value, at 95% confidence level (p-value < 0.001), whereas no significant relationship between biodiesel calorific value and reaction time was founded.

  2. 2-

    The summary of variance analysis (ANOVA table), summary of the fit chart, replicate plot, normal probability plot of residual, coefficient plot (scaled and centered), and normal distribution (observed versus predicted plot), indicate that the obtained quadratic mathematical model is a very good model to predict the calorific value of S-WCO-based biodiesel.

  3. 3-

    Coefficient plot results indicate that the effect of independent variables and the interaction between them on the calorific value were as follows: interaction between temperature and temperature (X32) > interaction between catalyst and catalyst (X22) > methanol to S-WCO ratio (X1) > reaction temperature (X3) > catalyst concentration (X2).

  4. 4-

    Ideal conditions for the production of biodiesel with a maximal calorific value of 9500.74 kcal/kg were founded as: 50 °C of temperature, 45 min reaction time, 10:1 methanol/S-WCO ratio, and catalyst 0.56 wt%.

  5. 5-

    Physicochemical properties of biodiesel based on S-WCO were consistent with most of the requirements of Germany, United States, and European standards.

  6. 6-

    Obtained fatty acid methyl esters (FAMEs) profile consisted of: oleic (41.26%), linoleic (35.04%), palmitic (17.36%), stearic (3.64%), palmitoleic (0.57%), and myristic (0.36%).

  7. 7-

    The use of supernatant WCO (S-WCO) for biodiesel production, instead of original WCO may have profound positive effects on biodiesel quality, and it is safer to handle and store than petroleum diesel.

In summary, physicochemical properties of S-WCO-based biodiesel are nearly analogous to commercially existing diesel fuels, its production process is economicaly viable and sustainable. Therefore, it may be considered as a realistic alternative for the replacement of petro-diesel in the near future.

Supporting Information (SI)

The SI contains additional detailed information on tables, figures and some sections, as indicated in the text.