1 Introduction

There has been a gradual decrease in fossil-fuel reserves and a steady rise in energy demand across the world. Also, the use of fossil fuels over the years has been known to produce environmental pollutants. exacerbate global warming and accelerate climate change. This has led to a general global drive towards cleaner production technologies and alternative energy sources [1, 2]. As examined by Aransiola and Ojumu [3], biodiesel is one of the notable options currently available to complement conventional fuels. It has attracted considerable attention during the past decade because it is renewable, biodegradable and non-toxic [4]. Biodiesel can be used singularly or blended with diesel. It has been shown to be compatible with diesel engines without requiring special modifications and will result to no negative impacts to operating performance of the engines [5]. Biodiesel is produced by the transesterification of virtually any triglyceride feedstock and this includes oil-bearing crops, animal fats, and algal lipids [6, 7]. In the process, the triglycerides react with alcohols in the presence of a catalyst to produce fatty acid alkyl esters (known as biodiesel). Glycerol is the by-product of the reaction. Considering that methanol is the most common alcohol used to produce biodiesel, it can be termed fatty acid methyl esters (FAME) [6]. The process can be catalysed by acids, bases and enzymes but base catalysts have been discovered to perform better [8]. Compared to conventional diesel, the relatively high cost of producing biodiesel is a major barrier to its commercialization. It costs approximately one and a half times that of petroleum-based diesel depending on feedstock oils [9]. It is reported that about 64–84% of biodiesel production cost arises from the cost of vegetable oil or animal fats [10].

Biodiesel production from non-edible oils is a recent trend being explored. This is because edible oils are a key part of the human diet and energy production will have to compete with human consumers. Non-edible oils with high mono-unsaturation values for biodiesel production includes Jatropha curcas oil (Jatropha curcas L.), Neem oil (Azadirachta indica), Caper spurge oil (Euphorbia lathyris L.), Rice bran seed oil (Oryza sativa), Honge oil (Pongamia pinnata), Putranjiva oil (Putranjiva roxburghii), Yellow Oleander oil (Thevetia peruviana M.), Mahua oil (Madhuca indica), Tamanu oil (Calophyllum inophyllum) and Crambe oil (Crambe abyssinica Hochst) [3]. Oils from Jatropha curcas [11,12,13], Euphorbia lathyris, Brassica napus and Ricinus communis [14] has been established to be available across the world and produces good quality biodiesel that runs smoothly on diesel engines [11].

Euphorbia lathyris is a weed that is non-edible and have no other competitive use [14]. Khaleghian and Nakaya [15] studied the feasibility of biodiesel production from Euphorbia tirucalli L. They obtained an oil of density 0.88 g/cm3. There was no report of the catalyst used neither was there any evaluation of process conversion or yield. However, the technical feasibility of the process was established. Wang and Hanna [16] obtained a maximum biodiesel yield of 86.2% from the transesterification of Euphorbia lathyris oil using methanol and KOH catalyst. The biodiesel quality was observed to be higher than that of Jatropha and Sapium. Zapata and Vargas [14] obtained a biodiesel yield of 91% using methanol and NaOH catalyst also from E. lathyris oil. Zhang and Wei [17] evaluated mesoporous Al–Mo oxides in biodiesel production from E. lathyris. A maximum conversion of 80.9% was observed at optimum conditions. Euphorbia lathyris compares well with other non-edible feedstock for biodiesel production (terms of reaction conversion) such as for avocado seed oil (over 90%) [18,19,20] and Jatropha (over 84%) [21].

In a recent review, Patan and Bugude [22] opined that Euphorbia lathyris L. holds great promise for biodiesel production. They however explained that scale-up from laboratory scale to pilot scale is still a major challenge. This is where modelling and optimisation analysis such as these comes in. Models such as those developed in this study can serve a platform for first stage in silico scale-up, for production estimations, cost estimation and techno-economic analysis. Biodiesel simulation, modelling and optimisation has been carried out for waste cooking oils [9, 23], edible oils [24, 25] and some non-edible oils [12, 26]. Besides the few experimental studies, there are no reports on the simulation, modelling and optimisation of biodiesel production from Caper spurge oil (Euphorbia lathyris L.). This work is novel as it reports the modelling of biodiesel production from one of the least reported but readily available non-edible feedstocks. In this study, Advanced system for process engineering (ASPEN) Hysys 2006 was used to model and simulate and the production of biodiesel from Caper spurge oil (Euphorbia lathyris L.) using methanol and NaOH catalyst. Response surface methodology was employed to optimise the process. It should be noted that there is already a shift towards heterogeneous catalyst in biodiesel production. However, due to the dearth in research in biodiesel production using Euphorbia lathyris L., a first-stage modelling study is not out of place. Besides, the research direction with the feedstock is still in its infancy and more in-depth studies on catalysis will need to be performed. An integration and optimisation study such as this is quite preliminary but are indispensable foundations for more research for greater energy sustainability.

2 Methodology

2.1 Reaction kinetics

Caper spurge oil can be considered to be primarily composed of Oleic acid (see supporting information Table A). Hence for the simulation, oleic acid will be considered as the feedstock for the reaction. Aransiola and Ojumu [3] reported a mono-unsaturation value of 82.16% for Caper spurge which is the highest value for all non-edible oils mentioned in the recently related review albeit with a relatively high acid value of 25.18 g/kg KOH. A high percentage of mono-unsaturation in fatty acid that make up the triglycerides is a requirement for the choice of best oil feedstock for biodiesel production. Also, feedstock with low free-fatty acid is preferred else a two-stage process would be required needing an initial acid catalysed esterification process. Hence, among the non-edible oils, Caper spurge oil (Euphorbia lathyris L.) is still one of the better non-edible feedstock for the production of biodiesel due to the favourable level of mono-unsaturation. A general chemical equation for the reaction is given in Eq. 1.

$${\text{Tri-glyceride of Oleic acid}} + 3\;{\text{Methanol}} \leftrightarrow {\text{Methyl Oleate}} + {\text{glycerine}}$$
(1)

The kinetics of Oleic Acid Transesterification with methanol was studied by Tesser and Di Serio [27] and presented in the supporting information Table B. In the study by Tesser and Di Serio [27], the temperature range used was between 50 and 100 °C and methanol/oil molar ratio was in the range 8.61–10.69. A porous co-polymer styrene-DVB (a sulphonic resin) was used as catalyst and loaded between 5 and 10 g whilst residence time ranged from 200 to 5000 min. An rpm of 1500 was used in their experiments and they conducted their experimental runs in the presence of acidity-free soybean oil in mixture with oleic acid with the aim of simulating the real mixture that must be submitted to the preliminary esterification step in the biodiesel production process. The information of kinetics in the supporting information Table B is important for simulating the proposed reaction in ASPEN Hysys under the current approach. In this simulation, Sodium Hydroxide (NaOH) was used as the catalyst. Both the Arrhenius parameters and the expression in Eq. 1 were inputted into the software. Putting these into cognisance, the general expression is easy to elucidate. From equation, the rate of biodiesel formation can be expressed as Eq. 2.

$$r_{FAME} = \frac{{dC_{FAME} }}{dt} = - 3\frac{{dC_{Triglycerides} }}{dt} = 3kC_{Triglycerides} C_{methanol}$$
(2)
$$\frac{{dC_{Triglycerides} }}{dt} = - Aexp\left( {\frac{E}{RT}} \right)C_{Triglycerides} C_{methanol}$$
(3)

where \(C_{Triglycerides}\) is the concentration of triglycerides, \(C_{methanol}\) is the concentration of methanol, \(C_{FAME}\) is the concentration of the biodiesel and \(r_{FAME}\) is the production rate of the biodiesel. All other parameters have been previously defined. The rate expression is second order and takes into account both the concentration of the methanol and the triglycerides. The typical characteristics of caper spurge oil is presented in the supporting information Table C.

2.2 Simulation methodology

ASPEN Hysys 2006 was used for the simulation. The model is a steady state model hence time function was not considered. Furthermore, a key assumption is the oil composition which is considered as triglyceride of oleic acid. The fluid package used for this simulation is non random two liquid (NRTL). NRTL is an activity coefficient model suited for biodiesel simulation. The non-random two-liquid (NRTL) model is widely utilised in phase equilibria calculations and it employs a three (3) adjustable parameters (two interaction parameters and the non-randomness factor) approach. These parameters are determined through regression of experimental data for a specific binary vapour–liquid equilibrium (VLE) system [28]. The concept of NRTL is based on the hypothesis proposed by Wilson that the local concentration around a molecule is different from that of the bulk concentration. This difference is due to a difference between the interaction energy of the central molecule with the molecules of its own kind and that with the molecules of the other kind. The energy difference also introduces a non-randomness at the local molecular level. NRTL in biodiesel simulations have been previously employed for waste cooking oil [5], Jatropha [29] and for fresh and waste vegetable oil [10].

It is considered suitable due to the presence of highly polar compounds like methanol and glycerol in the simulation [9, 23]. In designing the process, a simple methodology was utilised. Methanol was firstly mixed with the catalyst (NaOH) at ambient conditions then mixed with the stream of non-edible oil. The software is able to capture the effect of NaOH because an activity coefficient model was chosen which takes the binary interactions into account. The stream of methanol and catalyst was pre-heated to a suitable reaction temperature before being fed into the continuous stirred tank reactor (CSTR). A CSTR was used in this simulation as it is the best way to implement the kinetic information of the reaction on ASPEN Hysys. It can also help represent agitation and perfect mixing of the reactants as required by biodiesel reaction systems. The kinetic equation obtained by Tesser and Di Serio [27] was used. There are no vapour products from the reaction. The information on the conditions of the feed streams are presented in Table 1.

Table 1 Information on the conditions of the feed streams

All products leave in a bottom liquid stream from the CSTR. The top stream was placed there as it is a requirement for the complete specification of the reactor, else the simulation wouldn’t run successfully. The information on the specification details of the CSTR is presented in the supporting information. Considering that methanol is the excess reactant, a simple separator (operating at 100 °C) to remove a considerable portion of it from the product stream was introduced. A distillation column was not used as separation intricacies is not the focus of this work, but reaction optimisation. The excess methanol is cooled to ambient temperatures and recycled to the reactant stream. The biodiesel rich product stream is cooled, then washed with water to help entrain the traces of methanol and catalyst before the final separation of the glycerol from the biodiesel. From this framework, parameters such as reaction temperature, catalyst loading and methanol/oil ratio will be optimised. The process flow diagram of the steady-state simulation is given in Fig. 1.

Fig. 1
figure 1

Process flowsheet of the simulation from the HYSYS user interface

2.3 Response surface optimisation

There are extensive review on response surface methodology in open literature [30, 31]. Only a cursory overview will be given in this paper. Response surface methodology is a group of statistical techniques used to elucidate the functional relationship between input variables (x) and a response of interest (y). The relationship is unknown (ideally) but we can approximate it via a low-degree polynomial model of the form given in Eq. 4.

$$y = f^{I} \left( x \right)\beta + \varepsilon$$
(4)

where x = (x1, x2, …, xk), f(x) is a vector function p which consists of cross-products and powers of x1, x2, …, xk up to a certain degree which is denoted by d (≥ 1). Also from Eq. 4, β is a vector of p unknown constant coefficients referred to as parameters, and is a random experimental error assumed to have a zero mean [31]. Two important models are commonly used in RSM; a first degree model and a second degree model. The first degree model is represented in Eq. 5

$$y = \beta_{0} + \mathop \sum \limits_{i = 1}^{k} \beta_{i} x_{i} + \varepsilon$$
(5)

The second degree model is represented in Eq. 6.

$$y = \beta_{0} + \mathop \sum \limits_{i = 1}^{k} \beta_{i} x_{i} + \sum \mathop \sum \limits_{i < j} \beta_{ij} x_{i} x_{j} + \mathop \sum \limits_{i = 1}^{k} \beta_{ii} x_{i}^{2} + \varepsilon$$
(6)

There are 3 keys reasons for utilising RSM as explained by Khuri and Mukhopadhyay [31]: for establishing a relationship between inputs (x) and response (y), to determine the significance of the various factors (x1, x2, …, xk) and to determine the optimum levels of the factors that will result in the maximum response. A very comprehensive discussion of the application of RSM for optimising chemical and biochemical processes has been undertaken by Baş and Boyacı [32]. RSM models have found applications in biodiesel production [12, 33], pyrolysis [34], steam reforming [35,36,37], adsorption [38] and a host of other thermochemical and biochemical processes. Standing on this premise, RSM will be applied in optimising the production of biodiesel from Euphorbia lathyris using methanol and NaOH catalyst. Central Composite Design (CCD) was used to design the experiments for the determination of the optimum parameters of the transesterification reaction in the production of biodiesel from caper spurge oil with the aid of Design-Expert 10.0.1. The following notations and limits were given to the dependent and independent variables shown in Table 2.

Table 2 Dependent and independent variables

3 Results and discussion

3.1 Parametric studies

Based on the results obtained from the model, the effect of the process factors on the reaction conversion was evaluated. The response surface plots show the relationship between the different factors as they affect the conversion of the reaction. From Fig. 2, we observe that in the domain of high methanol–oil ratio, higher temperatures lead to a rise in the reaction conversion and consequently a greater reaction conversion. However, at low methanol–oil ratio, the positive effect of temperature is rather subdued. It is observed that methanol–oil ratio maxima are around 5–7 mol/mol at low temperatures but the positive effect of increased methanol is sustained to a higher threshold at high temperatures. Reduction in conversion beyond the optimal temperature is expected due to the methanol loss by evaporation because of to its closeness to the boiling temperature of 64.7 °C [39].

Fig. 2
figure 2

Effect of methanol–oil ratio and temperature on reaction conversion

From Fig. 3, the positive effect of temperature is revealed albeit in all domain of catalyst loading. The positive effect of the catalyst is rather minimised. This may be because the simulation model takes a kinetic approach rather than a thermodynamic one. The positive effect of the catalyst is due to the deprotonation of the alcohol by NaOH. The carbonyl carbon of the starting ester undergoes nucleophilic attack by the alkoxide to give a tetrahedral intermediate, which then proceeds to the trans-esterified product. A similar positive effect of base catalyst was observed by Wang and Hanna [16] for the transesterification of caper spurge oil (Euphorbia lathyris L.) albeit with KOH as catalyst. Usually, yield and conversion reduces beyond the optimal catalyst region due to the synthesis of excess soap over time (due to the interactions between the NaOH catalyst and the base oil).

Fig. 3
figure 3

Effect of catalyst loading and temperature on the reaction conversion

From Fig. 4 we observe the positive effect of increased methanol reactant on the biodiesel production process in all domain of catalyst loading albeit at an optimum of about 5–7 mol/mol. Dewangan and Mallick [40] explained that the effect of the reactant ratio on the conversion and yield is consequent on the solubility. The increased solubility of the oil in alcohol at optimum ratio enhances the reaction rate hence higher conversion.

Fig. 4
figure 4

Effect of catalyst loading and methanol–oil ratio on the reaction conversion

3.2 Optimisation

There has been several reference to the threshold of optimal conversion in previous sections of the work. In this subsection, RSM is used to investigate the optimal values for all factors by numerical optimization. To find the optimum levels of the process factors that will maximize the conversion of caper spurge oil for production of biodiesel the factors were all studied in the range/limit presented in Table 2. The optimal conversion was predicted as 83.5%. This can be achieved at a temperature of 65 °C, 9.99 mol/mol methanol–oil ratio and 4.29 wt% catalyst loading. Wang and Hanna [16] obtained a maximum biodiesel yield of 86.2% from the transesterification of Euphorbia lathyris oil using methanol and sulphuric acid catalyst. The biodiesel quality was observed to be higher than that of Jatropha and Sapium. Zapata and Vargas [14] obtained a biodiesel yield of 91% using methanol and NaOH catalyst also from E. lathyris oil. Zhang and Wei [17] evaluated mesoporous Al–Mo oxides in biodiesel production from E. lathyris. A maximum conversion of 80.9% was observed at optimum conditions.

3.3 RSM modelling

A model equation was developed by using RSM to analyse the interactions of the factors by identifying the significant factors that contribute to the regression model. The model is important in making first-stage design predictions and for budgeting, costing and other initial estimations in process design. This is basically one of the key goals of process simulations. Design-Expert 10 fitted four models to the response: linear, two factor interaction (2FI), quadratic and cubic polynomials. These models are simply polynomials of different orders. According to the sequential model sum of squares, the best model was the one where the additional terms were significant and the model was not aliased. A model is said to be aliased when the estimate of an effect includes the influence of one or more other usually higher interaction effects. The metric used for the choice of model were the standard deviation, R2, adjusted R2, predicted R2 and PRESS of the models. The quadratic model was suggested by the software for the process. The model had the highest R2 (0.9687), adjusted R2 (0.9405), predicted R2 (0.8391) and lowest standard deviation (5.41) of the non-aliased fitted models. The final model in terms of actual factors is given as Eq. 7.

$$\begin{aligned} {\text{Conversion}} & = 60.299 - 1.158{\text{A}} - 5.851{\text{B}} - 3.107{\text{C}} + 0.3034{\text{AB}} \\ & \quad + 0.0747{\text{AC}} + 0.0421{\text{BC}} + 0.0038A^{2} - 0.6104B^{2} - 0.2524C^{2} \\ \end{aligned}$$
(7)

where A is reaction temperature (in degrees Celsius), B is methanol–oil ratio (in mol/mol) and C is catalyst loading (in wt%). Positive coefficient indicates a positive effect on the response and vice versa. The analysis of variance (ANOVA) of the model is presented in Table 3.

Table 3 ANOVA for the RSM model (Eq. 7)

The purpose of analysis of variance (ANOVA) is to justify the adequacy of the model and determine its significance level. The Model F value of 34.39 implies the model is significant and values of Prob > F <  0.0500 indicate model terms are significant. Of the factors of the model, only catalyst loading (C) is not significant. This informs that changing the amount catalyst affects the process but to a minimal extent (in comparison to the other two factors). To improve the accuracy of the model, model-reduction was conducted. The insignificant terms of the model were removed monitoring the R2 value. Upon removing, C, AC, BC and C2 and re-computing the ANOVA, A2 was now insignificant and hence was summarily removed. The final model is presented below in Eq. 8 alongside the ANOVA in Table 4.

$${\text{Conversion}} = 47.66 + 14.20{\text{A}} + 15.76{\text{B}} + 17.07{\text{AB}} - 12.43B^{2}$$
(8)
Table 4 ANOVA for the RSM model (Eq. 8)

Figure 5 elucidates better the accuracy of the model over the domain of the results obtained. The final model in Eq. 8 was the basis of this plot. The diagonal can be referred to as a line of perfect prediction. The plot is a parity plot and the data points are obtained by matching the software model results and RSM results. The closeness of the data points to the diagonal is a measure of the parity between actual simulation results and those of the model and it also helps to reveal that the model is very accurate for purpose. The R-squared value of the final model is 0.9612 and the standard deviation is 4.62. In general, the model can afford for quick predictions given a known set of process inputs. The model can also serve as a framework for other optimisation approaches and will enable for early estimates and budgeting at the preliminary design stage.

Fig. 5
figure 5

Parity plot of RSM model predictions of conversion against actual simulation results

4 Conclusion

In this work, ASPEN Hysys 2006 was used to model and simulate and the production of biodiesel from Caper spurge oil (Euphorbia lathyris L.) using methanol and NaOH catalyst. Response surface methodology was employed to optimise the process. Based on the results obtained from the model, the effect of the process factors on the reaction conversion was evaluated. In the domain of high methanol–oil ratio, higher temperatures lead to a great conversion and consequently a greater biodiesel yield. However, at low methanol–oil ratio, the positive effect of temperature is minimised. We also observe the positive effect of the increased methanol reactant on the biodiesel production process in all domain of catalyst loading. The quadratic model was predicted as the best model for response of the reaction conversion to the process factors. ANOVA revealed that the model was significant. The R-squared value of the model was 0.9612 and the standard deviation was 4.62. The optimal conversion was predicted as 83.5% and can be achieved at a temperature of 65 °C, 9.99 mol/mol methanol–oil ratio and 4.29 wt% catalyst loading. The study has successfully established a simulation framework to study the production of biodiesel from Caper spurge oil (Euphorbia lathyris L.). The theoretical model can afford for quick predictions given a known set of process inputs. It can also serve as a framework for other optimisation approaches and will enable for early estimates and budgeting at the preliminary design stage. An integration and optimisation study such as this is quite preliminary but are indispensable foundations for more research for greater energy sustainability.