**2. Methods**

Two scenarios for biodiesel and bioethanol production in a biorefinery based on castor plant using NaOH pretreatment were developed. These processes were designed based on the promising experimental data previously obtained [9,27]. Aspen Plus simulated all the processes, and then APEA evaluated the economic features.

### *2.1. Process Development*

In the first scenario, castor oil is used to produce biodiesel by transesterification with ethanol that is produced from the lignocellulosic materials of castor plant, including leaves, stem, and seed cake. In the second scenario, castor oil is used to produce biodiesel by transesterification with methanol and the lignocellulosic materials used for bioethanol production similar to scenario 1.

2.1.1. Scenario 1: The Biorefinery for Biodiesel (from Oil and Ethanol), Bioethanol, and Heat Production

This process includes feed handling, transesterification, biodiesel purification, pretreatment, ethanol production via simultaneous saccharification and fermentation (SSF), purification of bioethanol by distillation, and fuel grade production of ethanol by dehydration, heat production, wastewater treatment (WWT), and utility services units. The block flow diagram (BFD) of this scenario is shown in Figure 1.

**Figure 1.** The block flow diagram (BFD) of biorefining of an environmentally friendly process for biodiesel and ethanol production (scenario 1).

In the harvest time, the seeds are separated, and seeds and residues were then sent to plant with trucks. In the feed handling unit, oil is extracted from the seeds by a cold mechanical press, filtered, kept for 24 h at 80 ◦C in the tank storage to remove extra moisture, and then sent to the transesterification reactor. Seed cake, stem, and leaves are crushed and dumped into storage piles until transfer to the pretreatment unit. Similar units for feed handling are considered for both scenarios [30].

℃ Biodiesel is produced in a 25 m<sup>3</sup> ransesterification reactor at 62.5 ◦C for 3.46 h by using 1 g potassium hydroxide (KOH) per kg oil and 0.29:1 ethanol to oil mass ratio to obtain 85% biodiesel efficiency. The two-phase stream, i.e., fatty acid esters (biodiesel) rich and glycerol rich streams, is removed from the reactor [1,9,20,27,31].

In the separation unit, the excess alcohol (here ethanol) contents of both biodiesel and glycerin are first recovered. The ethanol recovery is carried out by using a three-phase distillation tower, containing 22 sieve trays with 80% efficiency and operates under vacuum pressure of 0.2 bar (absolute). The product is finally sent to the dehydration unit for water separation, and the bottom stream of the tower sends to the biodiesel purification unit [31].

To help the phase separation, water is added to the process in the centrifuge. The products of transesterification are contaminated by the remaining raw material (i.e., oil), ethanol, catalyst (KOH), and soap. Thus, according to ASTM D6751 or EN 14214, the produced biodiesel is purified to contain less than 0.05% *v*/*v* impurities. A distillation tower containing 22 trays (sieve trays, 80% efficiency, operates at 0.1 bar pressure) is used for biodiesel purification. The purified biodiesel (99.95% *v*/*v*) obtained from the distillate is sent to the storage tanks, and the unreacted oil that exits from the bottom is sent back to the transesterification reactor. The glycerin-rich stream is first neutralized by the sulfuric acid and then purified in a distillation column with 4 sieve trays (80% efficiency, 0.4 bar pressure). The process flow diagram of the biodiesel production unit is presented in Figure 2 [1,24].

**Figure 2.** Process flow diagram of biodiesel production (transesterification and biodiesel purification units) (cf. Table 1 for process conditions).


**Table 1.** The process conditions for equipment for biodiesel production in scenario 1 in Figure 2.

The pretreatment of castor residues is conducted with 8% *w*/*v* NaOH (100 ◦C, 60 min, 22% solid loading). The pretreated residues are then filtered and washed in a 9-stage counter current solid washer to minimize the freshwater consumption. Water containing the impurities is then sent to WWT unit.

℃ ℃ SSF is used for ethanol production by hydrolysis of the pretreated solids (13% solid loading) with Cellic CTec3 enzyme (1.8% *w*/*w* of cellulose, Novozymes, Denmark [32]) and fermentation with *Saccharomyces cerevisiae* at 37 ◦C for 72 h under anaerobic conditions [25.33]. The nine main fermenters are designed with a volume of 350 m<sup>3</sup> . The seed yeast is prepared in a series of fermenters (stainless steel 304), starting from 5 L to 300 m<sup>3</sup> final volume with 1:10 scale-up ratio. The beer (fermentation broth) stream, leaving the fermenters, contains 3.86% *v*/*v* ethanol, unfermented hexoses and pentoses, and lignin. The beer is stored in a 150 m<sup>3</sup> tank and then sent to distillation step.

The purification of ethanol is conducted using stripper, rectifier, and scrubber columns (Table 2). The produced carbon dioxide is separated in a flash drum stage, and degassed beer is preheated to enter the second stage of stripper (24 sieve trays, 80% efficiency, 0.2 absolute bar). The vapor side-draw from the third stage, comprising 40.17% *v*/*v* ethanol, is fed to the rectifier column (32 sieve trays, 80% efficiency, 1.8 absolute bar). This column produced ethanol in 94% *v*/*v* concentration in vapor form. The vent from the top of the beer column, as well as the vents from beer stream storage and fermenters, is sent to the third column that is a water scrubber. The scrubber is a simple packed column

that recovered 99% of vented ethanol by washing with water. The ethanol is exiting from the bottom and returned to the beer column [33]. The solid containing the unconverted residues of the substrate, e.g., lignin, is presented in the wastewater that leaves the distillation. It is sent to the wastewater treatment and used for heat production.

Saturated vapor from the rectifier column, along with the recovered ethanol from biodiesel separation unit, is superheated and fed to the molecular sieve unit for purification to 99.9% *v*/*v* concentration of ethanol. This unit includes two adsorption columns. They are used alternatively in adsorbing and regenerating operation. The regeneration of the adsorption columns is performed by pure hot ethanol vapor. The final product, i.e., pure ethanol, is cooled and a part of it (40%) is sent to the biodiesel production unit, and the remaining ethanol pumped to storage to be sold as a fuel [33].


**Table 2.** The process conditions for the equipment of distillation and dehydration in Figure 3.

**Figure 3.** Process flow diagram of distillation and dehydration unit.

The bottom product of the rectifier column is pure water (>99% *w*/*w*) that is added to clean process water. The bottom product of the beer column, i.e., stillage, mainly contains non-fermentable sugars and lignin. Lignin is separated from this stream by filtration and is sent to the WWT unit. The liquor that is removed from the lignin separation step and the liquid effluent from the pretreatment unit is sent to the filtration and electrodialysis for the removal of dissolved compounds and NaOH that remained in the liquid. To reduce the COD and produce biogas, an anaerobic digester is used. The produced biogas consists of 44% carbon dioxide and 54% *v*/*v* biomethane. The rest of the organic materials are converted to CO2, water, and sludge, using aerobic digestion. A clarifier is used to settle the sludge, and the water is treated and added to clean process water. Biogas, lignin, and dewatered sludge are combusted, and heat is produced as a valuable byproduct in the heat production unit.

2.1.2. Scenario 2: The Biorefinery for Biodiesel (from Oil and Methanol), Bioethanol, and Heat Production

The overview of the process used in scenario 2 is presented in Figure 4. The castor plant seed and residual handling, oil extraction, and ethanol production units are similar to scenario 1. However, the transesterification of oil and process parameters are different. In this process, methanol is used for the transesterification in 10 m<sup>3</sup> reactor (40 ◦C, 1.5 h, 1.5 g KOH/kg oil catalyst, 0.4:1 methanol to oil ratio). The excess alcohol is separated in the methanol recovery and recycled.

**Figure 4.** The BFD of biorefining of the fossil-based process for biodiesel and ethanol production (scenario 2).
