# ORC Optimal Design through Clusterization for Waste Heat Recovery in Anaerobic Digestion Plants
## 3 Methodology
### Preliminary Design
#### 3.1.2 Design Optimization Problem
* \(T_{2,orc}\) and \(T_{2,orc}\) are the inlet and outlet temperatures on the regenerator cold side (evaporation pressure), respectively, while \(T_{4,orc}\) and \(T_{4,orc}\) are the inlet and outlet temperatures on the regenerator hot side (condensation pressure), respectively. * \(T^{\prime}_{loop}\) is the oil temperature at the beginning of organic fluid evaporation (thermal oil temperature at evaporator pinch point). * \(T^{\prime}_{cool}\) is the cooling water temperature at the beginning of the organic fluid condensation (thermal oil temperature at the condenser pinch point). * \(T_{loop,5}\) is the thermal oil temperature at the circulation pump outlet. * \(T_{loop,3}\) is the thermal oil temperature entering the air cooler. Under design conditions it is equal to \(T_{loop,4}\) (i.e., the temperature of the oil exiting from the air cooler). * \(T_{sev,in}\) is the sewage temperature at the inlet of the sewage heating heat exchanger set at 37 \({}^{\circ}\)C, which is the digestion process's nominal temperature. Some of the quantities involved in non-linear constraint evaluation must be calculated, as they are not readily available. \(T^{\prime}_{loop}\), which is necessary to set the constraint on the evaporator pinch point, was found as in Equation (39):  
Figure 5.8  
where \(h_{2,orc}\) is the organic fluid enthalpy at the beginning evaporation. \(T^{\prime}_{cool}\), which is necessary for the constraint on the condenser pinch point, was derived from Equation (40):  
Figure 5.9  
\(h_{5,orc}\) is the organic fluid enthalpy at the beginning condensation and \(T_{cool,in}\) is the cooling water temperature entering the ORC condenser, which was set to 15 \({}^{\circ}\)C. Finally, \(\dot{Q}_{cond}\) is the condenser heat flux, which was found as (Equation (41)):  
\[\Delta l_{pump}=\frac{(h_{2 is,orc}-h_{1,orc})}{\eta_{is,pump}} \tag{5}\]0  
By using the ORC thermal requirement \(\dot{Q}_{ev}\) from Equation (6) and the plant operational data (\(\dot{Q}_{dig}\), \(\dot{m}_{f}\) and \(T_{f}\)), previously calculated through clustering, \(T_{source,out}\) was calculated as in Equation (42):  
\[\Delta l_{pump}=\frac{(h_{2 is,orc}-h_{1,orc})}{\eta_{is,pump}} \tag{5}\]1  
Likewise, \(T_{loop,5}\), which is necessary to constrain the pinch point of the flue gases in the heat exchanger, was determined as in Equation (43):  
\[\Delta l_{pump}=\frac{(h_{2 is,orc}-h_{1,orc})}{\eta_{is,pump}} \tag{5}\]2  
Thermal oil temperature exiting the sewage heat exchanger was calculated to impose the oil loop minimum temperature:  
\[\Delta l_{pump}=\frac{(h_{2 is,orc}-h_{1,orc})}{\eta_{is,pump}} \tag{5}\]3  
Finally, \(T_{sew,in}\) was calculated to set the constraint on the pinch point of the sewage heat exchanger:  
\[\Delta l_{pump}=\frac{(h_{2 is,orc}-h_{1,orc})}{\eta_{is,pump}} \tag{5}\]4  
where \(\dot{m}_{sew}\) and \(c_{p,sew}\) correspond to sewage mass flow rate and specific constant pressure thermal capacity, respectively. To solve the problem defined by Equations (2) and (3), a sequential quadratic programming (SQP) algorithm was used, as implemented in [39], inspired by the SQP algorithm presented in [40]. The problem is not smooth in theory, as the use of CoolProp to evaluate fluid thermophysical properties makes the objective function a \"black box\". In this case, the objective function may be numerically estimated, but it does not have derivatives. Despite this, the problem is sufficiently smooth to be solved with an algorithm based on derivatives. The numerical estimation of gradients and Hessians is most often successful due to the general smoothness of thermophysical properties. The resulting optimization problem is non-linear, without an analytical representation, and potentially non-convex. In this case, the solver might find a local minimum instead of a global one. Such an issue may be avoided by repeating the optimization from several starting points. A multi-start algorithm has been applied to improve the convergence rate to optimum, as implemented in [41; 42].