1 Introduction

The generation of electric energy is fundamental for the maintenance of humanity’s current standard of living, as well as for the economic and, even, social development of any country. With an ever-increasing world demand, the insertion of renewable energy sources into the global energy matrix is indispensable. This insertion aims at both meeting higher consumption demands and causing less environmental impact, specially when compared to mainstream sources currently in use, such as coal, oil and natural gas (which utilize finite fossil resources), or hydroelectric plants (which cause major environmental impacts). Adding to all this, it is still necessary to consider the large emission of carbon dioxide from fossil fuels burning, which impacts the atmosphere, aggravating and accelerating global warming.

Biogas is a renewable source of energy obtained through the process of biomass decomposition in anaerobic environment [8]. This process occurs by the natural action of the bacteria in the digestion of organic matter, resulting in generation of methane. This way, because of the presence of methane, biogas has a calorific factor, which can generate energy through the process of burning [4].

Biogas produced at Sewage Treatment Plants (STP), which uses anaerobic reactors, landfills and similar facilities is often disposed directly into the environment or burned in flares. Noting that this burning has a great calorific value that can be used for generating electric energy, it was decided to develop this work in order to take advantage of this potential.

2 Goals

This work fits in the field of electric power generation from biogas, using electric generators coupled to internal combustion engines (MCI). Biogas is flared within the MCI, which in turn provides the torque required for generator rotation. The generator will then produce electricity that can be used to feed the internal loads of the facility or be injected directly into the utility grid. The biogas to be used may come from any facility, such as sewage treatment plants, landfills and so on.

The main objective of this work is to present the generator scheduling methodology, which applies to installations that have a variable biogas production profile, to implement this routine in a software and to apply it in the sizing of the Baldo WWTP generation system. Presenting the results obtained.

3 Existing methodologies

Currently, in installations where the biogas production profile is variable, power generation systems are designed to operate with a constant generation power. This way, the variations in the volumetric flow rate of the biogas produced are not taken into account and, consequently, neither is the available power through this flow for the generation system at any given time.

Currently, there are methods that calculate an average hourly volumetric flow rate of annual biogas production and from this value the value of the nominal generation power is obtained and, consequently, the potential of electric power generation in a given period [7]. This method estimates the annual production of biogas through specific formulas or measurements, determining an annual average volumetric flow rate and, through this, a constant value of power for the generation system and, consequently, of energy generated in a certain time interval. This method does not take into account the profile of biogas production at each moment of the year considered. Up to a period of minutes may be sufficient to cause instability and cause the generation system to stop due to lack of biogas, or the waste of the excess produced if it is above the nominal capacity of the generation system, as no calculation of the minimum storage reserve to ensure the necessary stability was made.

In another method, a set of point measurements of the volumetric flow of biogas produced is performed to estimate an average value of this flow and, consequently, of the generation power. From these values an average monthly power generation is estimated, which can be extrapolated for a longer period [14]. In this method an average biogas production flow rate is estimated through a set of point measurements performed. Similar to the previous work, this method does not take into account the profile of biogas production in the simulation period considered and, as a minimum storage reserve was not calculated to guarantee the necessary stability, there will be waste of biogas produced at certain times, and the estimated value of energy generated will not be reached.

4 Biogas and UASB Biodigester characteristics

Biogas is colorless, insoluble and of low density, consisting mainly of methane, carbon dioxide and other gases in lower concentrations. It is obtained through the anaerobic decomposition of organic matter. This process is performed by microorganisms (bacteria), that do not need dissolved oxygen in the water or the air to survive. They “breathe” the oxygen that is part of the complex carbon molecules that make up the lipids, carbohydrates and proteins (biomass). When they remove the oxygen, they break these molecular chains into smaller ones, like methane and carbon dioxide. The main component of biogas, when one thinks of its use as fuel, is methane. The higher the concentration, the purer the biogas is and the greater is its calorific value [12].

Understanding the biogas composition is the first step in quantifying its caloric power, especially regarding the available methane concentration and, this way, determining the power generation potential. Through the discovery of the composition and the gases present, it is also determined the appropriate treatments to remove unwanted substances in the combustion process or those aggressive to the equipment.

To perform the anaerobic digestion of the organic matter, a equipment called Biodigester is used [5]. The Upflow Anaerobic Sludge Blanket (UASB) is a world-wide spread equipment, mainly in countries of hot weather, for the treatment of domestic sewage in treatment plants. With internal retention of sludge, this Biodigester has, in a way, revolutionized the sewage treatment, since it started offering many advantages inexistent that until then, such as the low operating cost and the exploitation of biogas and sludge generated. The operating principle of this equipment is based on the upward flow of the affluent to be treated, which crosses a bed of active biomass (sludge), being discarded after passing through a system of deflector plates placed at the top of the Biodigester, that separates the biogas and directs it to the collector [9].

The bacteria present in the sludge are responsible for the purification of the organic matter. This mechanized process generates two byproducts: sludge and biogas. As sludge is the agent responsible for the degradation of the matter, it must be kept inside the reactor to start and continue the treatment process, periodically removing the excess produced [9].

5 Generator staggering methodology

The problem to be solved is the adequacy of the generation system power to the biogas production variations in the installation over time, in two main aspects:

  • When it is not possible or impracticable to control biogas production;

  • When the installation of a large reserve for biogas storage aiming at the amortization of the variations of its production is not feasible, or it is sought to reduce the installation costs of the generation system by implementing a smaller reserve;

The impossibility of controlling biogas production in certain installations is characterized by primary factors, which cannot be modified. As an example, in a sewage treatment plant, biogas production is directly related to the incoming tributary flow, the larger the volume of sewage to be treated, the higher is the biogas production. Since this flow that enters the station cannot be controlled because it is the result of the sum of individual and unpredictable flow of each customer connected to the collection network, biogas production will vary following this profile. In these cases, sizing a constant generation power reduces biogas utilization according to the following main circumstances:

  • The generation system does not work at flows below its required flow rate and if there is not sufficient storage reserve available, this biogas will be wasted;

  • For flow rates above the flow required by the generation system, this overflow potential is wasted if there is also insufficient storage available for this overflow volume in the reserve;

  • The generation system will only use biogas production more efficiently when the production flow is equal to (or very close to) the flow required by the generation system;

Assembling a biogas storage reserve large enough to account for variations in biogas production is often not achievable. For its implementation, it is necessary that there is sufficient space inside the installation (which often does not happen), as well as the costs of storing a large volume can make the deployment of the generation system unfeasible, or reduce its profit margin. In these cases, with the generator staggering method, in addition to greater efficiency in the use of biogas, a smaller biogas storage reserve may be conceived, which will increase the financial return and help to enhance the economic viability of the system of generation deployment.

This proposal allows the use of one or a set of generators operating at any moment according to the reading of the volumetric flow of biogas produced at that moment and the available storage. In this way, the generation system operates as long as possible within the biogas production range, with the greatest possible proximity between the amount of flow produced and the flow used by the generators.

In Fig. 1, we can see in blue an example of a biogas volumetric flow curve produced in a given installation, having a variable profile. With a generation system designed to operate at constant power and consequently constant biogas consumption, one would have an operating point like the orange curve. In these cases, with a storage reserve that is not sufficient to stabilize the biogas supply to the generation system, it could only operate when the production curve (blue) is higher than or close to the consumption curve (orange). The volume of biogas produced above the capacity of the generation system (blue curve above the orange curve) is wasted, as well as the volume produced less than that required by the generation system (blue curve below the orange curve).

Fig. 1
figure 1

Graph of the flow of production profiles, consumption and loss of biogas in the system of generation of the Sewage Treatment Plant of Baldo

Due to the need to adapt the power of the generation system to the biogas production profile of the installation, this proposal allows the staggering (modulation) of the generation power to adapt to the generation potential available by the biogas produced. Thus, it is sought that the generation system operates as long as possible within the biogas production interval, with the closest possible proximity between the biogas flow produced by the installation and the flow required by the generation system.

To visualize the application of this method, observing once more Fig. 1, the blue curve represents the volumetric flow of biogas production in the installation and the yellow curve represents the biogas flow consumed by the generation system. It is observed that the flow profile required by the generation system tends to follow the behavior of the biogas production curve. The closer these two curves are, the lower are the biogas losses (purple curve). The generation system is limited by its rated power (orange curve).

Thus, the term “staggering” was used to inform hat the generators will operate according to an algorithm of choice that defines, according to the produced flow, which generator(s) should work at that moment, in order to maximize the generated amount of energy.

A stairway of three generators is shown in Table 1. There, all possible combinations of operation are shown together with the associated flow values. In this way, the algorithm chooses which best combination should work at each moment, according to the volumetric flow produced. As an example, if at any given moment the volumetric flow produced was 750 m3/h, the best combination to work at this moment would be G2 + G3.

Table 1 Example of staggering of generators according to their nominal flows

The generation system will be composed of a set of generators with certain powers, which, along or individually, can generate energy in several flow ranges. Thus, the effect of the biogas production variation is mitigated throughout the day, allowing the system to operate in a wider range of flow values, seeking the highest possible efficiency.

The schematic diagram of the system is shown in Fig. 2. It can be observed the system of biogas production by the UASBs, the storage in the gas-meter and the generators operating in a staggered way. The energy produced is made available for installation and, when applicable, driven to the concessionaire.

Fig. 2
figure 2

Simplified schematic diagram of the biogas energy generation system by staggering generators

The algorithm for the staggering system chooses a particular combination of initial generators. From this, and according to the volumetric flow rates of biogas production, it is determined which generator(s) should operate in every hour in a stepwise way, aiming to maximize the usage of biogas. This procedure is repeated for the entire reported biogas production period. The generated hourly energy is obtained as a function of the flow consumed by this generator(s). At the end of the reported production period, the net present value (NPV) of the generator combination is calculated. This procedure is repeated for other combinations of generators and, through an optimization method, the best combination of generators to be used is determined, according to the highest NPV presented.

The remaining biogas stock is checked every hour according to the volumetric flow produced and consumed by the generators, and is stored in the reservoir. When the reservoir is full, the surplus is counted as loss. It is necessary to consider the installation of a minimum storage, specially to give stability to the generation system. This allows a minimum operating autonomy to the generators when the volumetric flow of production is small, and it also provides the storage of the excess biogas produced when it cannot be used. The residual storage value is the volume below which the generation system becomes inoperative.

In this context, the proposed generator staggering method addresses the following main aspects:

  • Simulation of the operation of electricity generation systems from biogas;

  • Sizing of electric power generation systems from biogas;

  • Operation of the actual functioning of electricity generation systems from biogas;

6 Main characteristics of Baldo sewage treatment plant

The generator staggering methodology was applied in the Baldo STP. It is the largest sewage treatment plant in the state of Rio Grande do Norte, receiving and treating about 30% of all sewage produced in the city of Natal (its capital).

The Baldo STP treatment system consists of preliminary, primary, secondary and tertiary treatments. The preliminary treatment aims to remove all solid waste present in the tributary through the coarse grid, fine grid and sand box. The effluent is then directed to eight UASBs, which represent the primary treatment step, removing about 65% of the organic load. After leaving the UASBs, the secondary treatment system begins, consisting of mechanically oxygenated aerobic reactors associated with secondary decanters. Tertiary treatment consists of anoxic chamber and final ultraviolet disinfection.

Sludge returning from the secondary decanter to the UASBs guarantees a great advantage in the production of biogas, since the Chemical Oxygen Demand (COD) of the sludge is around 5.000 mg/L, while that of the raw sewage is 500 mg/L. As the production of biogas is directly related to the effluent’s COD, this sludge from the secondary settler provides a large increase in biogas production.

The Baldo STP substation is made of two transformers, one of 1500 kVA and one of 750 kVA. Each transformer has a single secondary circuit, there being no communication between the loads that each one feeds [3].

7 Software implemented with the methodology of staging generators

The Software for Analyzing the Generation of Electricity from Biogas (SAGGAS) was developed for the design and simulation of energy generation systems from biogas, according to the methodology of staggering generators. According to the production data and the characteristics of the biogas and the installation, the program scales the generators, obtains the possible energy value to be generated, the associated costs and performs the financial analysis for the stipulated period. Thus, the choice of generators is performed with the goal of maximizing the NPV during the time considered in the analysis. The values of initial investment, maintenance, equipment replacement, equipment life, financial rates and other factors inherent to the system are included in the program to perform the calculations.

SAGGAS has ten interface tabs for data entry and visualization of results by the user, which are:

Data inputs:

  • Home screen:

  • Biogas production;

  • Biogas analysis;

  • Register of generators;

  • Costs, fees and tariffs;

  • Characteristics of the installation;

  • Sizing of generators;

Output:

  • Potential of generation;

  • Payback and accumulated NPV;

  • Biogas utilization profile;

8 Sizing and simulation of the Baldo STP generation system

For biogas production, the Baldo STP has eight UASBs, each one with an independent volumetric flowmeter installed at its outlet. For this study we used the latest available measurement history, which corresponds to the period from 27/05/2012 to 22/09/2012.

In this data, reactor 06 showed zero measurements of biogas production, possibly the meter was damaged. The possibility of considering for this reactor the average production of the others was verified, however, to perform the sizing more conservatively, we decided to disregard it. Reactor 03 presented low biogas production values, this may have been caused by a poor sewage distribution between reactors, wrong positioning of the reading sensor, or perhaps due to some defect in the meter. In this case, as there were measurement data, even with low values compared to the others, we decided to keep them.

The average value of volumetric biogas flow obtained for the Baldo STP was 1240.60m3/h. The repair of the meters and the consequent accurate verification of the current production would be very appropriate, both to confirm the values used here and to measure the current production, because the sewage inflow has increased during this time. Also noting that the production data was collected less than a year after the station started working, when the bacterial colony was not yet fully developed, which decreases biogas production compared to the current colony, already stabilized.

To verify the characteristics of biogas, the values of three distinct analyzes were considered, one already available on 29/04/2013 [10], and two others performed exclusively for this work, on 31/10/2017 and 12/11/2017. Tables 2, 3 and 4, respectively, show the values obtained.

Table 2 Biogas analysis made on 29/04/2013 by CTGAS-ER
Table 3 Biogas analysis made on 31/10/2017 by CTGAS-ER
Table 4 Biogas analysis made on 11/12/2017 by CTGAS-ER

We can see that the values shown for gas concentrations and physicochemical properties are close. For the execution of the SAGGAS, the data from the last analysis carried out on 11/12/2017 was chosen because, besides being the most recent, it also contemplated the concentration of sulfidric gas, which was not included in the other analyzes. Figure 3 shows the biogas collection performed at the Baldo STP on 24/10/2017.

Fig. 3
figure 3

Biogas collection performed at the Baldo STP on 24/10/2017

Through the characteristics input for biogas, SAGGAS determined the resulting conversion factor, as shown in Table 5. It was adopted a 25% yield for conversion in the internal combustion engine and electric generator set, considering a composition of 90% for the efficiency of the electric generator [13] and 28% for the internal combustion engine [11].

Table 5 Biogas characteristics of Baldo STP

The available energy in square meters of biogas was obtained through the Eq. (1).

$$E = \frac{PCI*N}{k}$$
(1)

where PCI: inferior calorific power, MJ/m3; k = 3,6: conversion constant MJ kWh; E: available energy by biogas volume, kWh/m3; N: yield to be considered for the generator;

The yield adopted for the MCI and electric generator set is formed by the composition of the individual yields considered, according to Eq. (4).

$$N = Nth*Nger$$
(2)

where Nth: yield of MCI; Nger: yield of the electric generator; N: total yield;

A yield of 25% was adopted for conversion in the MCI and electric generator set, considering a composition of 90% for the efficiency of the electric generator [13] and 28% for the MCI [11].

Possible sites that could house the gasometers to store biogas at low pressure were analyzed in loco. Thus, according to the available area, we opted for two PVC gasometers located in the space between the aeration tank and the decanters, totaling a storage of 400 m3, as shown in Fig. 4.

Fig. 4
figure 4

Detail of the gasometer location space in the Baldo STP, in red

A pressure transducer must be installed inside each gasometer to monitor the volume occupied, providing this information to the supervisory system, as well as a lightning protection system (LPS) that protects the entire surface of the gasometers.

For the removal of moisture and consequent increase in the efficiency of biogas flaring, the dehumidifier cooling method will be used. Each generator will have its own dehumidifier as a way to treat only the biogas that will be used. This individualization will provide energy savings and facilitate system maintenance and operation.

As a way of decreasing the concentration of hydrogen sulfide gas to an acceptable level, a micro-aeration system will be used, which will inject air in a controlled manner inside the upper UASBs. This system will have a pressure transducer that will monitor the interior of the reactors, indirectly providing data on biogas production. It will be connected to a frequency inverter that activates an injection compressor, thus enabling the control of air dosing.

In order to demonstrate the application of the developed methodology, it was carried out the sizing and simulation of the electric energy generation system from the biogas produced at Baldo STP.

The characteristics of the Baldo WWTP substation, as well as the contracted demand values, were entered into SAGGAS according to Table 6.

Table 6 Substation characteristics and contracted demand for the Baldo WWTP

The power factors to be used by SAGGAS for system simulation, associated with each generator type, are informed below in Table 7.

Table 7 Power factors used in SAGGAS for the Baldo WWTP project

The prices adopted for this project are those charged by the Rio Grande do Norte Energy Company (COSERN), as it is the concessionaire responsible for supplying energy to Baldo STP. Tables 8 and 9 show, respectively, the values of the green and blue tariff modalities.

Table 8 Green tariff values charged by COSERN
Table 9 Blue tariff values charged by COSERN

To register the generators to be considered in the simulation by SAGGAS, we made use of a market analysis, reaching the values shown in Table 10. To reduce costs, the use of generators with power above 700 kVA (which is the highest available in nationally produced generators) was avoided.

Table 10 Generators registered in SAGGAS for simulation

SAGGAS was executed according to the data entered. The best configuration obtained for the Baldo STP generation system was with four generators, with the following apparent power (S): 300 kVA, 500 kVA, 700 kVA and 600 kVA, according to Table 11. Of these, one is connected to the 750 kVA transformer and the other three connected to the 1500 kVA transformer, according to the single-line diagram in Fig. 5. According to the nominal flow values obtained for the generators, each one must have an associated 5 hp injection compressor [6], to control the biogas supply. The electric power consumption of these compressors was taken into consideration in the analysis of the proposed generation system.

Table 11 Values obtained by SAGGAS for the generators at Baldo STP
Fig. 5
figure 5

Diagrama unifilar de conexão dos geradores, cargas e transformadores para o sistema de geração da ETE do Baldo

The green tariff modality was chosen because it has a lower associated cost, considering the use of generation at the tip. The hired demand is expected to increase from the present 650–2000 kW, as a way to make better use of biogas generation potential. In the proposed generation power range for this project, it will be classified as a distributed mini-generation, connected to the distribution network through the installation of the consumer unit, as it is found in the range between 75 kW and 5 MW [1].

The costs considered for the implementation of this generation system are shown in Table 12, considering a period of use of 20 years

Table 12 Costs for the generation system at Baldo STP

The system maintenance cost was calculated considering a monthly fixed value, plus a variable portion per kWh generated, accordingly to what can be seen on Eq. (3). The cost of installation labor and accessories required was estimated at 15% of the total to be spent on the purchase of equipment as implemented on Eq. (4) [6].

$$CM = Cf + \left( {Ea \times K} \right)$$
(3)

where CM: total annual cost with maintenance, R$; Cf: fixed annual cost cost with maintenance, R$; Ea: energy generated annually, kWh; K: cost of maintenance per kWh generated, R$;

$$CO = 0,15 \times CEq$$
(4)

where CO: total cost of labor, installation and accessories, R$; CEq: total cost of equipment purchase, R$;

To compose the cost with biogas analysis, it was considered that two analyzes will be performed every year. The durations of each cost are predefined by the program, as shown in its respective columns. A 20-years period was chosen as the range of analysis of the system, because this is the longest lifespan of all equipment of the system [2]. As the gasometer is the only equipment that has a durability of less than this time, its replacement value is considered at each end of its life cycle (10 years). The power and value of the generators are automatically obtained by executing the program and choosing the best setting.

The tariff mode that best fits within the characteristics of the generation system and the load should be hired, observing the behavior at peak and off-peak hours, as well as the associated consumption and demand. If the increase in hired demand is required, its annual cost is calculated from Eq. (5). If the increase in hired demand does not occur, the program automatically disregards this cost.

$$CD = \left( {\left( {Dn - Da} \right) \times tr} \right) \times 12$$
(5)

where CD: total annual cost with the demand increase, R$; Dn: new demand hired, kW; Da: old demand hired, kW; tr: provider’s tariff, R$;

It is observed that the biggest cost for the project implementation is the maintenance cost, mainly due to the generators. To mitigate this value, a squirrel cage rotor induction generator can be used to compose the generator set, due to its greater robustness. However, due to the fact that no national production line could be found for this type of equipment in this power range, adjustments would be required, which, judging by the amount to be invested, would add some uncertainty to the project. So, it was decided to use only synchronous generators.

In the future, if the use of squirrel cage rotor induction generators is more reliable, it is recommended that at least generator 4 associated with the 750 kVA transformer should be synchronous. This consideration is necessary for the installation’s most important loads are connected to this transformer; this way, this generator could supply power to the STP during an interruption in the power supply by the energy company.

The simulation period used for the execution of the software corresponds to the biogas production data between 05/27/2012 and 09/22/2012. The values obtained for the total volume of biogas used by the generation system, percentage of use of biogas and generated energy, can be observed in Table 13. It can be observed that, with the staggering methodology employed we were able to utilize a percentage of 67.42% of the total biogas produced. The daily volume that is not used is driven to the burning flares, and can be used for other purposes.

Table 13 Simulation data of the energy generation and biogas utilization obtained for Baldo STP

The total energy generated during the simulation period, which can be supplied to the provider’s utility grid, is found by Eq. (6):

$$Et = \left( {Vu \times E} \right) \times k$$
(6)

where Et: total energy generated, kWh; Vu: volume of biogas used by the generators, m3; E: energy available per biogas volume, kWh/m3; k =0,95 loss factor at the transformers [13];

The NPV (profit) and Cost Benefit Index (CBI) found for the generation system during the 20 years of operation are presented in Table 14.

Table 14 NPV and CBI obtained during the 20 years

With the accomplishment of the financial analysis, one can observe in Table 15 the payback obtained through the analysis of the accumulated NPV of the application during the 20 years of operation of the system.

Table 15 NPV accumulated over the course of 20 years

9 Conclusion

With the application of the generator staggering method, present in SAGGAS, in the simulation and sizing of the electric power generation system from biogas to the Baldo STP, the following results were obtained:

  • NPV = R$ 46,356,973.80 (for the period of 20 years of operation of the system)

  • CBI = 2.85

  • Percentage of 67.42% of the use of biogas produced in the STP

  • Generating an average of 1,088,983.80 kW/h of energy per month

The energy generated is sufficient to meet the entire energy consumption of Baldo’s STP, and the rest, being injected into the distribution network, can be used to reduce demands in other locations, within the tariff compensation system. The financial return is very satisfactory, with the initial investment being paid off already during the second year of operation of the system.

It is possible to conclude from the presented data that the staggering generator methodology optimizes the generation of electric energy from the biogas, providing the increase of the biogas volume used by the generation system and the maximization of the NPV compared to a system using a constant generating power. Thus, this method is efficient for systems that have biogas production with variable profile and impossibility of large storage reservoirs.

As a suggestion for future works, the development of a computer program to manage the actual operation of the generation system through the generator staggering method would be very pertinent. Biogas that cannot be used by the generation system can be used for other purposes, such as supplying the company’s vehicle fleet or injecting it into the city’s natural gas network. The development of specific projects for squirrel cage rotor and induction generator sets would be very pertinent as well, since they may result in the reduction of maintenance costs, which are quite significant.

In short, it is observed that this work presented a different method for the sizing of energy generation systems from biogas, through the staggering of generators. This methodology allows to optimize the volume of biogas used by the generation system and to maximize the obtained profit (NPV), by choosing the best combination for the generators that will be part of the generation system. This method was implemented in SAGGAS, a software that measures the generators and simulates the operation of the system, presenting the total energy that can be generated and the economic and financial feasibility of the investment. It is hoped that the method of staggering generators may contribute in the future to the encourage the use of biogas as a renewable source of electric power generation, bringing benefits to companies, society and the environment.