## 2 Materials and Methods
### Wastewater Treatment Process: Case Study
#### 2.1.3 Gas Processing and Power Generation  
Sewage treatment comprises high energy-consuming processes, whose electricity consumption contributes up to 30% of total operating costs, and the treatment and disposal of sludge constitute about 20% of the total operating costs [47]. From the total electricity consumption of the plant, 35% is used for the treatment of the sludge and its disposal [48]. A considerable part of the thermal energy is required to manage the sludge produced during the digestion process. The biogas generated in the anaerobic digestion process can be used to generate combined heat and power (CHP) for energy cogeneration [48]. During the sludge stabilization process, biogas is obtained as a result of a methanogenesis reaction, which can be used for the production of electrical energy and the consumption of the plant. In the gas processing line, biogas is produced, stored, treated, and the obtained energy is reused in the combustion process for energy use within the treatment plant [49]. In this sense, the yield of the biogas and the digested matter are interdependent: while the former increases, the latter decreases. Additionally, the organic solids generated in the anaerobic digestion process can be used as fertilizers, so their agricultural application can be more environmentally benign [48]. A portion of biogas is used during the digestion of sludge, as fuel for the generation of electrical energy in the plant. The remanent biogas is carried out in the sludge heaters used to maintain the digester under mesophilic temperature, supplying energy to the heat exchanger. As the sludge heats up and enters the digesters, the water cools and can be returned to the engine cooling system. Finally, the odors are extracted through a network of ducts that will connect the processes with the deodorization system. Figure 2 summarizes the different assets involved in the anaerobic digestion process within the WWTP. Based on the primary treatment and sludge treatment described in Section 2.1, and the application of a criticality analysis of the assets, it is possible to identify fifteen (15) maintenance activities that are critical and highly hazardous to the operation of the WWTP. These activities correspond to different essential tasks for the operation of the different areas and processes involved in wastewater treatment. To carry out each of these activities, it is necessary to stop the continuous process in the wastewater primary treatment or in the sludge treatment, which involves a loss in the availability of the assets involved. The information on the preventive maintenance plan is summarized in Table 1. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**ID** & **Area/Process** & **Activity Description** & **Execution Periodicity (w)** & **Execution Time (h)** \\ \hline
1 & Roughing & Inspection of sensor chains & 20 & 8 \\  & & and electrical connections & & \\
2 & Grit removal & Inspection of aerators for & 48 & 8 \\
3 & Roughing & & Change of luminaires & 36 & 5 \\
4 & Grit removal & Bridge repair & 18 & 96 \\  & & Inspections and & & \\
5 & Mixing & unclogging of submersible & 15 & 24 \\  & & pumps & & \\
6 & Homogeneization & Agitator check & 10 & 24 \\
7 & Deodorization & Tower cleaning & 50 & 72 \\
8 & Gas flow line & Equipment maintenance & 4 & 72 \\  & & Scheduled inspection of & & \\
9 & Electrical distribution & medium voltage & 1 & 1 \\  & & equipment & & \\
10 & Dehydration & Inspection of agitator and & & \\  & & electrical cables & 12 & 24 \\
11 & Electrical distribution & MT switchgear & 30 & 1 \\  & & Check flow meters and gas & & \\
12 & Sludge digestion & flow leaks in purge & 24 & 4 \\  & Sludge & Checking and cleaning the & & \\
13 & digestion—Digester & heat exchanger and & 20 & 6 \\  & room & controller & & \\
14 & Sludge digestion & Temperature probe and & & \\  & Sludge & thermostat inspection & & \\
15 & digestion—Digester & Three-way valve and & & \\  & room & actuator inspection & & \\ \hline \hline \end{tabular}
\end{table}