Energy self-sufficiency and greenhouse gas emission reductions in Latin American dairy farms through massive implementation of biogas-based solutions

The transition towards sustainable economies with improved resource efficiency is today ’ s challenge for all productive sectors. The dairy sector in Latin America is growing without considering a clear path for sustainable energy and waste management solutions. This study proposes integrated solutions through a waste-to-energy approach. The solutions consider biogas production (via cow manure) as the main energy conversion pathway; technology solutions include biodigesters, power generators, and combined heat and power systems that supply not only the energy services demanded by dairy farms (for cooking gas, electricity, refrigeration and hot water) but also provide organic fertilizers. Biogas ’ potential was estimated to verify whether it can cover the energy demands of the farms, while the levelized costs of producing biogas and electricity were the indicators for the techno-economic evaluation of the solutions. Greenhouse gas emission reductions were estimated by following IPCC guidelines. Specifically, the proposed solutions lead to energy self-sufficiency in most dairy farms with relevant biogas and electricity costs in the range of 1.7 – 3.7 and 6 – 12 USD cents/kWh, respectively. In addition, implementing the proposed solutions in Latin American dairy farms would allow annual greenhouse gas emission reductions of 32.8 Mton CO 2 eq. with an additional 17 Mton if widespread use of the supplied organic fertilizers is achieved.


Introduction and objectives
The Food and Agriculture Organization of the United Nations (FAO) and the Global Dairy Platform (GDP) recognize milk as a vital product that should be part of the population's diet. This is especially relevant in developing countries since milk and dairy products supply calories, micronutrients and significant amounts of protein that can help combating malnutrition in children and adults [1][2][3][4]. However, due to the significant greenhouse gas (GHG) emissions produced by the livestock sector (meat and dairy production), and in line with the Sustainable Development Goals (SDGs), a healthy and sustainable diet that contributes to reducing the consumption of dairy products is also promoted [5,6]. It is possible that this trend will gain more support and, perhaps, begin to consolidate first in developed countries. Nevertheless, for the short and medium term, milk and dairy products will continue to remain critical in developing countries for the reasons stated above, with their supply promoted by governments under the support of international organizations such as the Global Dairy Platform and, in Latin America, the Pan-American Dairy Federation (Federación Panamericana de Lechería, FEPALE [7]). Therefore, it is expected that the demand for milk and dairy products will continue to increase [1,2]. In these circumstances it is paramount to explore novel solutions applied to the dairy sector to ensure that this growth occurs under conditions of sustainability through efficient management of resources. These solutions can allow reducing the negative environmental effects of dairy activities while, simultaneously, addressing various sustainable developmental goals (SDGs) [2,8,9].
According to a 2019 report from FAO and GDP [2], global milk production has grown by 30% between 2005 and 2015. In the particular case of Latin America (Central and South America), the growth of milk production has increased at a rate of 2.9% annually in the same period. This continuous growth implies the demand for more resources and services, i.e., land (for grazing fields and production of feed), transportation (dairy farm inputs and product deliveries) and energy services required by dairy farms, which in turn result in a higher generation of animal waste. The supply of these growing demands inevitably results in a higher generation of GHG emissions. Between 2005 and 2015 GHG, emissions from the dairy sector increased by 18% worldwide.
Latin American dairy farms exhibit a range of intensity and characteristics, e.g., Brazil alone produces 45% of the milk produced annually in this region, and together with Mexico, Argentina and Colombia, production reaches up to 85% of the total milk supply [10]. Generally, these four countries have large dairy farms (usually owned or managed by multinational dairy companies) with sophisticated equipment and systems for raising dairy cattle, making the industry a key economic contributor [11][12][13]. For the remaining Latin American countries, dairy farming is still considered as a subsistence activity, most often as a complement to agriculture and characterized by the existence of "milk cooling centers" where small farmers refrigerate the milk since they cannot afford individual cooling systems. Across Latin America around 75% of dairy cows (who supply 40% of the milk produced) are raised with a dual purpose, i.e., for the provision of milk and meat, with dairy farming considered a complementary activity [2,[14][15][16][17][18]. Small-scale dairy farmers are often organized into associations, unions and federations [7,14,15,19]. Despite this organization, which provides them representation in the economic and government sectors, the support they receive from competent institutions does not reach levels that guarantee the promotion and implementation of sustainable solutions for the provision of energy services and waste management.
Typical energy services demanded by dairy farms are electricity (for equipment operation and lighting), thermal energy services such as refrigeration (for milk preservation) and hot water (for cleaning and sterilizing equipment). Additional thermal services can be required for air conditioning and/or for drying systems [20][21][22]. Currently, in Latin American dairy farms, these services are supplied by using conventional energy solutions, mostly based on fossil fuels. Grid electricity is used for powering equipment and providing refrigeration, while hot water is supplied by either using electric heaters or, most commonly, boilers or heaters fueled by Liquefied Petroleum Gas (LPG) or Natural Gas (NG) [17]. Digester-produced biogas that would result from an adequate manure management of the farms is not in widespread use as an alternative energy source that can supply farms' energy demands [8,23,24].
Regarding GHG emissions from dairy farms, most of these emissions are methane (CH 4 ) produced by enteric fermentation (i.e., microbiological process in the digestive system of ruminants). Standard manure management results in additional CH 4 emissions along with nitrous oxide (N 2 O) emissions. The final disposal of manure (raw or treated in biodigesters) is generally to the soil as fertilizer, where microbial processes occur, generating additional N 2 O emissions. Other direct and indirect emissions are carbon dioxide (CO 2 ) emitted by food production (for livestock), transportation and energy use associated with the dairy activity [2,25,26].
Various researchers have studied biogas production using dairy waste (manure), highlighting not only the environmental benefits of this process but also the importance of the outputs, namely digesters as a means to supply energy services and organic fertilizers [23,24,27]. Other studies focus more on the process of biogas production itself [28,29], in some cases looking for improvements of the bio-digestion process considering mixtures of dairy manure with other bio-wastes such as crop residues and food waste [30][31][32][33][34]. Determining the potential of biogas production, and its economic and environmental implications when utilizing biogas for the supply of electricity and/or heat, are also topics of study [8,17,32,[34][35][36][37][38]. Several investigations have shown that biogas production with dairy/organic waste contributes positively to the reduction of GHG emissions [27,31,33,37,39], which in turn contributes to the sustainability of the livestock sector, since it promotes resource efficiency generating environmental and economic benefits. This falls on the concept of "waste-to-energy", also linked to the development of a circular economy [40][41][42]. However, most of these studies focus on specific dairy farms located in certain regions or countries far from Latin America. A recent study [43] presents the state-of-the-art "organic waste to energy" in Latin America by exploring the challenges and opportunities in this matter. Although the study considers different organic wastes as a source for energy production, it does not focus specifically on the dairy sector. Furthermore, the study remarks that "low-cost" biodigesters were successfully implemented in this region while large biodigesters are not common due to their investment costs, technical complexity and maintenance demands. A handful of other studies were found with a focus on Latin American livestock systems. Two of them analyze and discuss enteric methane mitigation strategies for different ruminants, including beef and dairy cattle [44,45], while a separate literature review study focuses on the effect of (i) the type of production system (non-grazing, semiconfinement, and pasture), (ii) the type of livestock (dairy/dual purpose), and (iii) the geographic region on the carbon footprint (GHG) and milk productivity of cattle [46]. Although these investigations present useful and relevant results for environmental assessments, they do not cover an analysis or evaluation of potential sustainable waste/energy solutions for dairy farms. Finally, another investigation that addresses the impacts on GHG emissions due to the use-occupation of land for dairy and beef cattle [47] mentions that, until 2017, only five studies in this matter were found for dairy cattle in Latin America, compared to 49 studies found in Europe. This suggests that Latin America, and specifically the dairy sector in this region, requires more attention in terms of research that can contribute to sustainable development.
Considering the findings of the literature review mentioned above, it is clear that a deeper understanding is needed concerning the integration of issues related to waste-to-energy solutions, the potential for biogas production, utilization, and GHG emission reductions in Latin American dairy farms. It is also clear that with a proper approach, biogas production on dairy farms has the potential to reduce GHG emissions (CH 4 and N 2 O) by introducing improved waste management [9,25,48] and utilizing the biogas to cover the energy demands of the farms, thereby replacing the use of conventional fossil fuel-based energy services and reducing the associated CO 2 emissions [8,23,37]. Furthermore, the organic fertilizer (often referred to as bio-slurry) that results from biogas production is highly valued in agriculture for its nutrient content. The use of this organic fertilizer, whose components are nitrogen (N), phosphorus (P) and potassium (K), would allow minimizing or avoiding the use of synthetic fertilizers and, consequently, the CO 2 emissions associated with their production [49,50]. Additionally, the use of organic nitrogen in the soil would result in lower N 2 O emissions than those generated by using synthetic nitrogen [26]. Waste-to-energy solutions that are suitable for different types of dairy farms can include: biodigesters (for biogas production), electricity generators (such as internal combustion engines or microturbines fueled by biogas), heat recovery systems (for the provision of hot water, heating, drying systems), and absorption cooling systems (for the supply of cooling/refrigeration using recovered heat, from exhaust gas, as a source of thermal energy). It can also be combined with other energy sources (solar and wind energy) and conversion devices [8,17,38,51,52]. It is expected that the application of these technological solutions would allow improvements in waste and energy management that directly address some of the SDGs, such as goals 7 (affordable and clean energy), 12 (responsible consumption and production) and 13 (climate action). Some other SDGs would also be addressed indirectly due to the economic, social and environmental effects caused by the application of these potential solutions in the dairy sector [5].
Under the scenario explored in this study, the objective of this research is to assess whether the biogas production potential of Latin American dairy farms is sufficient to cover their energy demands and quantify the potential reduction of GHG emissions that follow from an application of the proposed biogas-based solutions. An assessment of the impacts on the energy balance and a techno-economic evaluation of the solutions will allow for a verification of the energy self-sufficiency of the dairy farms. The energy service demands are gas for cooking, electricity, refrigeration and thermal energy for hot water supply. For the purpose of this study, the biogas production potential, organic fertilizers supply and the demand for energy services of the Latin American dairy farms are estimated for specified farm size categories. Various biogas-based solutions are proposed to supply the energy service demands of different farm sizes. By deriving an energy balance for each farm size category, it is possible to analyze whether the proposed solutions can cover the energy demands or whether there is likely to be a deficit or surplus of energy services. The techno-economic feasibility of the solutions is evaluated and discussed by focusing on the costs of producing biogas and electricity. Finally, the amount of GHG reductions, CH 4 , N 2 O and CO 2 that can be achieved by applying the biogas solutions are estimated (enteric fermentation is not considered).

Methodology
To perform this study the following steps were followed: • Data collection on the dairy sector in Latin American countries, including the number of dairy cows, average fuel mix for electricity generation, emission factors for CO 2 , main characteristics and efficiencies of technologies for biogas, electricity, heat and refrigeration production. • Estimation of the potential for biogas production and supply of organic fertilizers (N, P, K). • Estimation of energy service demand for Latin American dairy farms (electricity, refrigeration, thermal energy for heating water and gas for cooking). • Design of biogas-based solutions for the supply of energy services on dairy farms, considering farm size and suitable technologies to be employed. • Energy balance, demand-supply analysis of energy services required on dairy farms. • Techno-economic evaluation of the proposed biogas-based solutions.
• Quantification of the potential for CH 4 , N 2 O and CO 2 emission reductions/savings per farm size category and country. For this, step guidelines from the Intergovernmental Panel on Climate Change, IPCC [25,26] were followed.

Dairy cows and farm size structure in the Latin American dairy sector
Data about the number of dairy cows per country was mainly retrieved from the FAOSTAT database [53]. Farm size structure and number of dairy cows per farm type were taken from national and international reports of institutions related to the dairy sector [14]. The farm size structure considers the following classification: LT15, less than 15 dairy cows; 15_50, from 15 to 50 dairy cows; 50_100, from 51 to 100 dairy cows; 100_500, from 101 to 500 dairy cows; GT500, 501 or more dairy cows. Two types of manure management can be considered: "DS" refers to solid manure management, which means that manure is collected and stored in a "solid" state and in some cases manure is simply left in the field; "DL" refers to liquid manure management via irrigation and collection in treatment lagoons [54]. In this study "biogas production" is proposed as a third type of manure management. Table 1 lists the countries under investigation, arranged in descending order with respect to the number of dairy cows. This data is presented in more detail for each farm size category in the Supplementary Material-A.

Estimation of the potential for biogas production and fertilizers (N, P and K) supply
Apart from being a GHG, methane is also the main component of biogas, which is produced in biodigesters. Biogas contains 50-75% CH 4 , which provides the energy potential of this fuel; the remainder is CO 2 and traces of other compounds [23]. To determine the energy potential of biogas on dairy farms, first the annual methane production potential per cow is calculated, which depends on the farm size, manure collection rate and farm productivity level. An equation to determine this potential follows the IPCC guidelines (equation 10.23 in [25]); it is presented and explained in the Supplementary Material-B. This potential is defined as follows: BF s,t : CH 4 production potential per cow (Nm 3 /cow-year) in a farm size category "s", the type of manure management "t" is "biogas production".
Biogas production in volume per year is determined for each farm size category (considering the number of dairy cows) and is valid for estimating the total biogas production potential in a country and in all Latin American dairy farms. With the biogas potential in volume and an energy conversion factor for biogas (assumed to be 6 kWh/Nm 3 , corresponding to 60% CH 4 and 40% CO 2 volume/volume [52]) it is possible to determine the biogas potential production in terms of its energy content. The volumetric and energetic potential are defined as follows and are further explained in the Supplementary Material-B: BV s,t : Biogas production potential in volume (millions of Nm 3 /year), per farm size category "s" and the type of manure management "t" is "biogas production". BE s,t : Biogas production potential in terms of energy (GWh/year), per farm size category "s" and the type of manure management "t" is "biogas production".
The potential for the recycling and supply of organic fertilizers is determined when estimating the amount of nutrients that are contained in the bio-slurry (output product of biodigesters), i.e., nitrogen-N, phosphorus-P and potassium-K. The content fraction of these nutrients (with respect to fresh manure) does not change significantly during the bio-digestion process but at the output, these nutrients are mineralized [62]. This improves the quality of the digestate when used as fertilizer because it makes nutrients more readily available for uptake by crops and facilitates the handling of the organic fertilizer. Therefore, this organic fertilizer has the potential to replace the use of synthetic fertilizers, thereby saving N 2 O emissions for the case of nitrogen-N. The nutrient fractions in fresh manure were found to be 0.85%/0.50% for N (for high/low productive farms [25]), 0.08% for P, and 0.22% for K. These last two are average values found in Ecuadorian dairy farms [62]. The organic fertilizer content is determined by considering these  [14,53] 5.659 COLOMBIA (2017) [14,53] 3.291 MEXICO (2017) [14,53] 2.506 VENEZUELA (2017) [53] 2.265 ARGENTINA (2018) [55,56] 1.726 CARIBBEAN COUNTRIES (2017) [14,53] 1.181 PERU (2017) [14,57] 0.894 ECUADOR (2017) [53] 0.856 URUGUAY (2017) [14,53] 0.767 CHILE (2017) [53,58] 0.533 BOLIVIA (2015) [59,60] 0.404 PARAGUAY (2017) [53,61] 0.218 Total Dairy Cows in Latin America (millions of dairy cows) 37.152 nutrient fractions. It is explained in the Supplementary Material-B and is defined as: OF N/P/K : Organic fertilizer (N, P or K) potential supply for a farm size category, country or for all Latin American dairy farms (kton/year).

Electricity, refrigeration and hot water demand
A literature survey was performed to determine the range of electricity and thermal demand on dairy farms [22,[63][64][65][66][67][68]. Most of the studies were performed in developed countries and generally for large dairy farms whose characteristics may differ greatly compared to dairy farms in Latin America, especially compared to the small farms where inefficient resource management is predominant [69]. The energy utilization index (EUI) is adopted to quantify the energy (electricity) required on dairy farms, and this is given in kWh/cow-year (or kWh/kg or liter of milk produced). The EUI or energy demand (ED) on dairy farms is dependent on the use of dairy equipment, farm size and type of dairy farming, which is usually related to energy management (equipment efficiencies and operation strategies). These multiple variables cause the EUI to have different values as reported in different studies. One study found an average EUI value of 466 kWh/cow-year for different sizes of Italian dairy farms [63]. Other research focusing on Irish dairy farms showed that farms with less than 100 cows require up to 240 kWh/cow-year of electricity, while a farm with more than 100 cows needed around 170 kWh/cow-year [64,65]. On the other hand, a study performed on Iranian dairy farms specifically focuses on dairy farms of up to 100 cows, which are the most predominant in that country [70] and whose conditions are perhaps more similar to those of Latin America. This study found that the need for electricity on the farms is approximately 600 kWh/cow-year for a farm with 50 cows, without considering the electricity demand that might be required for heating water. Similarly, for an Algerian small dairy farm with 26 cows (also comparable to small Latin American farms), a EUI of 330 kWh/cow-year was found [66,67]. Under the present scenario, reference energy demands for electricity and thermal services that are in the range of reported values are adopted from a previous study [22]. These energy demands (ED) are 380 and 208 kWh/cow-year of electricity, and according to the trends of the reported demands, it is considered that the high value corresponds to farms with up to 100 cows while the low value corresponds to farms with more than 100 dairy cows. A fraction of this electricity demand is directly used by appliances and equipment (EL, as milking machines, pumps and lighting). Additional second and third fractions of the electricity demand are used to supply (i) cooling (for milk refrigeration) in compressor-driven refrigerators (RE) and (ii) hot water using electric water heaters (HW), respectively. Using as a reference the energy demand (ED) per cow, the demands for electricity and useful thermal energy for cooling and heating (for heating water) were determined (Supplementary Material-C). This is summarized in Table 2.
The total demand for these energy services in a country or region would be the sum of the demands of the different farm sizes (using the number of dairy cows in each category, equations in Supplementary Material-C). These demands are defined as follows: DEL: Demand for useful electricity (equipment and lighting), per farm size (GWh/year). DRE: Demand for useful cooling for milk refrigeration, per farm size (GWh/year). DHW: Demand for useful heat for hot water supply, per farm size (GWh/year).

Biogas for cooking
Two assumptions were made when estimating the demand for biogas for cooking by the families that are involved in the farm work within each farm size category. First an average number of cows was defined for each of the farm size categories: 10, 30, 75, 300 and 1000 cows for farm sizes LT15, 15_50, 50_100, 100_500 and GT500, respectively. With this and the number of dairy cows in each farm size category, it was possible to determine the quantity of dairy farms. The second assumption is related to the equivalent number of families that live and/or work in the facilities of each type of farm: 1, 2, 3, 5 and 9 families for farm sizes LT15, 15_50, 50_100, 100_500 and GT500, respectively. Considering the reference labor time required per cow, it is assumed that two people from each family work on the farms; these values are actually referential and depend on the farm size, whether it is a grazing farm, and the degree of mechanization, among other factors [71][72][73]. The quantity of dairy farms, the number of families and a reference cooking fuel demand per family (10.8 kWh/day or 1.8 m 3 /day per five-member family [55]) was used to determine the biogas demand for a farm size category (for a country or all Latin America). This is explained in more detail in the Supplementary Material-C and is defined as: BC s : Biogas demand for cooking on a farm of size category "s" (GWh/ year).

Design of biogas-based solutions, demand and supply of energy services
Three biogas-based solutions are proposed under the concept of waste-to-energy, which in turn promotes an efficient, circular economic use of resources. The approach of these solutions is represented by the graph shown in Fig. 1. The proposed solutions supply the energy services demanded by dairy farms together with organic fertilizers (N, P and K contained in the bio-slurry), which result from the biogas production process. Initially, each biogas-based solution is proposed for a target farm size (small, medium and large) considering suitable technologies. However, a techno-economic feasibility analysis that considers the biogas potential production in each farm size and other economic variables will determine whether these solutions are adequate enough to allow energy self-sufficiency for a given farm size.
The application of these solutions will lead to a scenario that will be referred to as the "proposed scenario". On the contrary, the case in which none of the solutions is applied will be defined as the "current scenario".
The proposed solutions consider energy conversion devices and equipment whose technical data, efficiencies and costs are presented in the Supplementary Material. These devices are used to supply the energy services required on dairy farms: electricity, electricity-heat (for the combined heat and power -CHP systems), hot water and refrigeration. The equations to determine the energy service demands, surplus of energy services and other calculations related to the following solutions are also presented in detail in the Supplementary Material-D.
Solution 1: This solution represents the base case that allows for the production of biogas from a minimum amount of manure. The target farms of this solution are farms with up to 50 cows (farm sizes LT15 and 15_50). This solution considers the production of biogas by using low-cost tubular biodigesters of the type that have been implemented in many Latin American countries for displacing firewood as a cooking fuel [49,50,[74][75][76][77]. According to these practical experiences, the relatively low cost of the biodigesters along with their simple installation and operation have allowed small farmers to use them without difficulties. This solution cannot cover all energy demands since it only considers using biogas as gas for cooking and the supply of hot water (by using pots in common stoves fueled by biogas). Despite this, the technoeconomic evaluation for biogas and electricity supply will determine if energy self-sufficiency is possible on these farms; in case of a negative result, it is most likely that the provision of electricity and refrigeration would still be dependent on conventional solutions. In this case, and if individual small farms are close together, surplus biogas has the potential to be collected and distributed to centralized facilities for the production of electricity and heat that can be used in milk processing activities, or for local farm and home heating. An equation to determine this surplus is presented in the Supplementary Material-D. Fig. 2 shows an illustration of this solution. Solution 2: This solution is intended for farms with 51 to 100 cows (farm size 50_100). The production of biogas considers the use of larger tubular biodigesters, either single or multiple in a series. Biogas is used to cover the demand for gas for cooking and water heating, as in Solution 1. However, in this solution the surplus of biogas is used for electricity production using internal combustion engines without heat recovery units. This electricity powers equipment (including refrigerators) and provides lighting. Surplus electricity is expected, which can be used for household appliances, the operation of additional equipment for milk processing, other productive activity, or be sold to the grid (equation to determine surplus electricity is presented in the Supplementary Material-D). Positive results from the techno-economic evaluation would allow these farms to be energy self-sufficient since electricity, refrigeration, hot water and cooking gas are supplied. This solution is illustrated in Fig. 3.

Solution 3:
This solution is proposed for farms with more than 100 cows (farm size 100_500 and GT500). The production of biogas is carried out in larger and sophisticated biodigesters. These biodigesters can be tubular (of larger size installed in series), geomembrane biodigesters, covered lagoons or any type of biodigester technology suitable for the installation site [77,78]. Biogas is used as cooking fuel and for supplying the following services: (i) electricity; covering the demand of equipment and lighting; and (ii) thermal energy, which is recovered from the exhaust gas of power generators such as internal combustion engines or microturbines. This thermal energy is used to cover the demand for hot water and drive absorption refrigeration systems (for milk refrigeration).
These energy solutions are known as Combined Heat and Power (CHP) and Combined, Cooling, Heat and Power (CCHP) systems [8,17,[79][80][81]. This proposed solution is actually a CCHP, but to simplify, namely considering only the products that are supplied in a "first stage" (electricity and heat), it will be considered as a CHP solution. The technoeconomic feasibility of supplying gas for cooking, electricity, refrigeration and hot water would allow these farms to be energy self-sufficient. It is also expected that any surplus of electricity and recovered heat should be used locally for maintaining an optimal digester temperature, thus enhancing its performance, heating farm buildings and dwellings, and drying feed. The calculations to determine these energy service demands and surpluses are presented in Supplementary Material-D. This solution is shown in Fig. 4.

Technical considerations of the proposed technologies
All proposed solutions are based on biogas, so the selected technologies should be designed to avoid methane leakages for minimizing fire and explosion risks and avoiding unwanted GHG emissions. Small and low-cost plastic biodigesters are more vulnerable to such risks [82]. To deal with this, improved materials such as PVC or polyethylene geomembrane are proposed for the biodigesters [77]. Larger biogas systems  can opt for more sophisticated biodigesters, which are less prone to leakage but are also more expensive. Apart from the technology itself, care in operation and proper maintenance are critical in preventing additional leaks or other potential failures [83]. Regarding the biogas power generators, various internal combustion engines and microturbines are commercially available. Usually, small biogas power generators are unable to operate continuously and require frequent maintenance. On the other hand, some microturbines can achieve long periods of operation [17,52,84,85]. Operational problems can occur if the raw biogas is not properly cleaned. In some applications cleaning equipment is required, which increases the cost of the system [23,86]. Other equipment such as heat exchangers, for heat recovery, or absorption refrigeration systems that could add complexity to the solution also have technical aspects that can result in failures. Based on these technical considerations, one way to prevent possible malfunctions of the solutions is through adequate technical training and proper operation and maintenance of the equipment [81,82,85].

Techno-economic feasibility of the proposed solutions
The techno-economic feasibility of applying the proposed solutions on dairy farms can be verified by determining the production costs of biogas and electricity, which are considered as the main resulting energy products (although fertilizers are an important product resulting from the solutions, their techno-economic analysis is outside the scope of this study). For this, the biogas production potential of each farm size category, including technical, economical, and operational aspects of the equipment, are considered. The indicator selected to determine the feasibility of the solutions is the levelized cost of electricity (LCOE). This indicator provides the cost of an energy unit throughout the lifetime of the project. In other words, the sum of the annual costs of investment capital, operation, maintenance, and fuel, among others, are divided by the energy supplied (electricity) by the system over the project's lifetime [87][88][89] (Equation (1)). By analogy, this indicator is proposed for determining the levelized cost of biogas (LCOB), where the energy supplied is the biogas in terms of its energy content [17,52]. Both levelized costs have units in USD (or USD cents) per kWh. The parameters and variables required for calculating this indicator are presented in Table 5 of the Supplementary Material.

LCOE =
Total lifetime cost of the project Total lifetime useful electricity supplied The multiple parameters (technical and economic) used to determine the LCOE or LCOB have a degree of uncertainty that results from the diversity of existing market scenarios in Latin American countries, where the costs of technologies, labor, and subsidies, among others, may differ from country to country. Uncertainties also apply to some technical parameters of the technologies involved. In order to deal with these uncertainties, a valid probabilistic method is the Monte Carlo method [87,[89][90][91], which in this study is applied to determine the LCOE and LCOB. The method consists of selecting random values of key variables (from a set variation range) and performs multiple iterations that generate multiple results (10,000 iterations in this study). These results are then presented in a set where the probabilities of occurrence of the resulting values can be observed. From there, the most probable and representative values of the results are determined. The parameters and their variation ranges are presented in detail in the Supplementary Material-G. Finally, the results of LCOE and LCOB are compared with reference prices of electricity, NG and LPG in the Latin American region to see if they have the potential to be competitive. The investment capital for producing biogas and electricity is also presented.

GHG emission reductions 2.5.1. Manure management: CH 4 and N 2 O emission reductions
Methane and nitrous oxide emissions are generated to a greater or lesser extent depending on the anaerobic conditions given by the type of manure management system on dairy farms. This type of manure management can be solid (stacking the manure in open or closed spaces), liquid (in open or covered lagoons); and the manure can be left in grazing fields and or used for biogas production. In section 2.1, the current manure management systems on Latin American dairy farms were defined as solid (DS) and liquid (DL), which mostly depends on the farm size category. On the other hand, biogas production, as a manure management system, is the basis of the proposed energy solutions.
The potential for annual reductions of methane emissions on dairy farms in Latin America is the difference between the emissions  generated in the current scenario, i.e., when no solutions are applied, and the emissions generated in the proposed scenario, i.e., when novel solutions are applied. In this case, the production and utilization of biogas is considered as the main control strategy for methane emission reduction. For this, the activity data is required, which is the number of dairy cows and an emission factor of methane, which in turn depends on the type of manure management on the farms, given in kg CH 4 /cowyear, and the fraction of manure that is handled and intensity of farming. There are CH 4 emission factors for each farm size category both in the current scenario and in the proposed scenario; they were determined following the IPCC guidelines [25]. The equations for calculating CH 4 emissions in both scenarios and for determining the potential reductions are presented in the Supplementary Material-E. The potential for methane emission reduction is defined as follows: E CH4 : Total CH 4 emission reduction (kton CH 4 /year). Nitrous oxide emission reductions are calculated similarly to methane, which is the current emissions minus the emissions that would result in the proposed scenario. These emissions also depend on the manure management type carried out on the farms. As with methane, there are emission factors (for both scenarios) for each farm size category. The selection, the values of these N 2 O emission factors and the equations to determine these emissions follow the IPCC guidelines [25] and are presented in the Supplementary Material-E. The potential for nitrous oxide emission reduction is defined as follows:

Manure/organic fertilizer's (bio-slurry) application to soil: N 2 O emission reductions
Both manure handled in a solid/liquid state or the bio-slurry that results from the production of biogas (using manure) will end up in the soil as fertilizer, along with the manure remains left in the grazing fields. The nitrogen (N) contained in this organic matter, which is added to the soil, will produce the nitrous oxide (N 2 O) that results from aerobic and anaerobic microbial processes (nitrification and denitrification). In this case, a main controlling factor to determine the amount of (direct) N 2 O emissions is the quantity of N added to the soil. These emissions, for the current and proposed scenario, are calculated considering that the amount of N applied to the soil (as manure or bio-slurry) is the same as that contained in fresh manure [62]. Therefore, the units of N 2 O emission factor are kg of N 2 O per kg of N applied to the soil. The reduction of N 2 O emissions due to soil application will be referred as E N2O SA while its CO 2 equivalent emissions are labeled as E CO2e N2O SA . These emission factors are dependent on the type of nitrogen that is applied to the soil. These calculations follow the IPCC guidelines [25] and are presented in more detail in the Supplementary Material-E.

Direct use of energy services: Carbon dioxide (CO 2 ) emission reductions
The reduction of CO 2 emissions related to energy occurs when conventional energy services (electricity, refrigeration and hot water) are replaced by energy services supplied by the biogas-based solutions. The combustion of biogas in these solutions also generate CO 2 emissions; however, these emissions are biogenic and their impact on climate is considered neutral [93].
To determine the amount of these emission savings, it is assumed that the current demand for electricity and refrigeration (produced in electric refrigerators) by the farms is supplied by using the power grid in all Latin American countries. For this, an aggregate CO 2 emission factor (ef CO2 el ) for the power system of each country is required. This aggregate CO 2 emission factor is dependent on the type of electricity generation (a higher use of fossil fuels for power generation will result in a higher emission production rate); therefore, this factor can be different in each country. The emission factors for each country are presented in section E of the Supplementary Material. Equation (2) is proposed to determine the CO 2 emissions that are avoided by displacing the use of conventional electricity. This equation is valid for solutions that supply electricity. E CO2 el = Current demand for electricity*ef CO2 el (2) where: E CO2 el : CO 2 emissions avoided (electricity) per farm size category (kton/year). ef CO2 el : CO 2 emission factor of the power system (kton/GWh).
Similarly, it is assumed that the current demand for cooking gas and heating water on farms is met by using LPG or NG (depending on the predominant fossil fuel used in each country). Equation (3) determines the CO 2 emissions that are avoided when the biogas solutions are applied, and the energy equivalent of fossil fuels that are (currently) used to supply gas for cooking and for heating water is multiplied by the CO 2 emission factor of those fuels. E CO2 th = Current demand for cooking gas and heating*ef CO2 th (3) where: E CO2 th : CO 2 emissions avoided (thermal) per farm size category (kton/year). ef CO2 th : CO 2 emission factor of LPG or NG (kton/GWh).
The total CO 2 emissions that are avoided/saved due to the application of the proposed biogas-based solutions in the proposed scenario are determined with Equation (4).

Use of surplus energy services: CO 2 emission reductions
Additional reductions of CO 2 emissions can be achieved when considering the potential uses of the surplus energy services (either inside or outside the farms) that are available from the solutions. The sale of these surpluses may be considered in some cases.
The surplus services available from the solutions are biogas, heat and electricity. In the case of biogas and heat, it is assumed that they will replace services that are supplied by using the predominant fossil fuel in each country ( Table 4 in the Supplementary Material). In this case, the energy equivalence of these surpluses are multiplied by the CO 2 emission factor of the country's predominant fossil fuel, allowing the determination of the emission reductions. Equation (5) applied to solution 1 (with biogas surplus), and Equation (6) applied to solution 3 (with recovered heat surplus), determine these reductions. The CO 2 emissions that are saved when using the electricity surplus are determined with Equation (7) and valid only for the solutions with a surplus of electricity. This reduction is calculated by multiplying the surplus electricity (from solutions 2 and 3) by the aggregate CO 2 emission factor of the power system ( Table 4 in the Supplementary Material). The total additional reduction of CO 2 emissions when using the surplus services is determined by using Equation (8).
where: E CO2 s : Additional reduced CO 2 emissions (kton/year) as related to the use of surpluses: sb, biogas; sh, heat; se, electricity; and ss, sum of surplus services.

Total potential for GHG emission reductions
The total emission reductions, considering CH 4 , N 2 O and CO 2 emissions, can be determined per farm size category, per country (the emissions of all the farm size categories of the country are counted) and for all Latin America. The reductions that can be achieved when applying the proposed solutions (i.e., producing and utilizing biogas to supply energy services on farms, and using bio-slurry as fertilizer) is determined, in kton of CO 2 eq./year, by using Equation (9).
2.5.6. Other GHG emission savings related to the production and use of synthetic fertilizers A widespread use of organic fertilizers (N, P, K and other recycled nutrients contained in the bio-slurry) can allow for additional savings of CO 2 emissions. In that case, CO 2 emissions related to the production of synthetic fertilizers would be avoided. On the other hand, using organic nitrogen (N) instead of synthetic nitrogen would also reduce nitrous oxide emissions. Determination of the avoided CO 2 emissions by the use of organic fertilizers considers the amount of the nutrient content, i.e., nitrogen-N, phosphorus-P or potassium-K along with the emission factor for the (synthetic) production of each. Thus, it is possible to determine the total CO 2 emission savings (kton/year) when displacing synthetic fertilizer usage, assuming that they will not be produced. On the other hand, the use of organic nitrogen in the soil tends to produce lower N 2 O emissions than those produced when using synthetic nitrogen. The equivalent N 2 O emission savings (kton/year) are the difference between the N 2 O emissions that would be emitted using synthetic nitrogen minus the emissions produced using organic nitrogen. Equations for determining these additional savings of CO 2 emissions related to the displacement of synthetic fertilizers used are presented in the Supplementary Material-E.

The potential for biogas production and organic fertilizer (N, P and K) supply
The energy potential for the biogas production of the different dairy farm sizes is presented in the reference graph of Fig. 5. This biogas potential is compared to the biogas (in terms of its energy value) required for cooking plus the biogas that would be required if the energy demands of the farms (electricity, cooling and hot water) were met by using electricity produced in biogas-based power plants (without heat recovery). For this latter plant, an electric efficiency of 0.37 (37% of biogas energy content is converted into electricity [80,81,85]) is considered.
It is observed (Fig. 5) that only for LT15 farms is the biogas required for covering their energy service demand slightly higher than their biogas production potential. This is due to (i) the conditions for biogas production (daily cow's excretion rate, fraction of manure collected for low productivity farms) and, mainly, (ii) the energy management in small farms where dairy cows demand more energy per capita than in larger farms. For small farms (15_50), the potential for biogas production is able to cover demand, while in medium (50_100) and large farms (100_500 and GT500), the potential production of biogas is much higher than the biogas required to meet all their energy demands. Figure 5 also shows that the total biogas production potential (in terms of energy) of the dairy farms in Latin America is around 81 TWh/ year, while 40 TWh/year of it would be required to meet their energy service demands under the conditions mentioned in the preceding paragraph. Thus, around 50% of the biogas production potential is sufficient to meet the energy demands on dairy farms. As mentioned previously, for this comparison, most of the energy services are covered by using electricity produced with biogas. However, a more energyefficient way of using this biogas could be the application of CHP systems that can allow for covering the thermal energy demands (with heat recovered from exhaust gas from power generators). In that case, the biogas required to meet the energy service demands could reduce even more, allowing for a surplus of biogas available for other purposes. Table 3 shows the estimation of biogas production potential, the organic fertilizer (N, P, and K) supply for different farm sizes (it considers the average number of dairy cows per farm size, section 2.3.2) and the potential for all Latin American dairy farms. From these results, it is seen that the potential to supply either biogas or fertilizers is directly proportional to the size of the farm. On the other hand, the total production on Latin American dairy farms shows that the highest production potential for biogas and fertilizers is found on small (LT15) and medium-sized (50_100) farms. 52% of the total biogas in Latin America can be supplied by these farms. Figure 5 shows that, theoretically, the biogas produced in Latin America could be sufficient to cover the energy service demands of all dairy farms of this region, and the lower bar in the figure is thus a reference that mainly serves to visualize the magnitude of the biogas production potential. In reality, the energy self-sufficiency of the dairy farms depends not only on the availability of the energy resource used to cover the energy demands (in this case biogas produced with organic waste), but also the real possibility of implementing the proposed biogas-based solutions. This will be determined with a techno-economic evaluation of the biogas-based solutions, including, for this, an energy balance through a demand-supply analysis of the energy services. This is presented for the different farm size categories in the next section. 2) for each of the farm size categories, as well as the energy services supplied (right side) by the proposed solutions. There is a potential for energy self-sufficiency on a farm when the supply of energy services (right side) is equal to or greater than the demand for services (left side). Solution 1 proposed for small farms (LT15 and 15_50) involves the production of biogas to be used for cooking and water heating. Electricity and refrigeration services are not supplied as can be seen in Fig. 6; however, the results of the techno-economic evaluation will show whether it is feasible to also supply electricity; meanwhile, these farms still depend on conventional energy services. On the other hand, a surplus of biogas is available (marked in the graph) which is 7.6 and 26.7 MWh/year for LT15 and 15_50 farm sizes, respectively. Figure 6 also shows the demand and supply of energy services for typical medium-sized farms (50_100) where solution 2 is applied. In this case, all the energy services have the potential to be covered. Biogas is used for cooking, water heating and electricity production. This electricity covers the demand for refrigeration, equipment and lighting of the farms. The energy self-sufficiency of these farms will be confirmed with favorable results by the techno-economic evaluation. In addition, on these farms, there is a surplus of electricity, around 72 MWh/year. Figure 7 shows that the demand for all energy services are covered when solution 3 is applied on large farms (100_500 with DS/DL manure management, and GT500 with DL). In this case, biogas is used to meet the demand for cooking, while the remaining biogas is used in combined energy systems. As described previously, this combined solution is able to supply, simultaneously, electricity, refrigeration and hot water. A positive result of the techno-economic evaluation of this solution will allow energy self-sufficiency on these farms. In addition, there are surpluses of (i) electricity that reaches 262, 297 and 998 MWh/year for farms of 100_500 (DS), 100_500 (DL) and GT500 (DL), respectively, as well as (ii) heat that can be recovered, about 314, 366 and 1234 MWh/ year for each farm size category, respectively. Solutions 2 and 3 applied to medium and large farms allow not only the potential for the energy self-sufficiency of the farms, but also opens the possibility of involving dairy farms in the energy market when it comes to the sale of surplus energy services (biogas and electricity) if they are competitive. Although solution 1 only considers covering the demand for cooking gas and hot water, it is the techno-economic assessment that will determine if energy self-sufficiency (or electricity production) is still possible in small farms; if not, exploring potential uses for the surplus biogas is necessary. Global results of this analysis for all Latin American dairy farms are presented in the Supplementary Material-F.

Techno-economic feasibility assessment of the proposed solutions: Results
The techno-economic evaluation has focused on determining the cost of producing biogas (LCOB) and electricity (LCOE) to verify the feasibility of the proposed solutions. The results of this evaluation are shown in Figs. 8 and 9. The LCOE and LCOB presented in these graphs are average values that result from applying the Monte Carlo method (for each value represented in a bar, 10,000 iterations were performed). It is also shown (with error bars) what the variation is between the maximum and minimum values that were obtained from the iterations. These results show the most probable and approximate prices of producing biogas and electricity for the different farm sizes when considering the variability of various techno-economic assumptions. Additionally, the results are presented to compare the effect of different discount rates on the LCOB and LCOE, with reference prices of LPG, NG and electricity in the Latin American region provided by the World Bank [94] and the Inter-American Development Bank [95].
As mentioned previously, LCOB and LCOE have been calculated considering the uncertainties generated by the variability of certain parameters such as the installation cost of a biodigester per m 3 (of liquid volume), the capital cost of a power generator per kW e installed, the cost of the manure required for biogas production, the cost of biogas required for electricity production, operation and maintenance costs, as well as the project's lifetime, the escalation factor, and the capacity factor (for the biodigester and power generator). From these parameters, one that should be approached carefully is the manure cost, which is the main resource for biogas production. Usually, this residue is not considered to be of high monetary value and is generally used only as fertilizer. It is possible that using this manure for biogas production can generate an expectation of higher monetary value; therefore, its variability has to be taken into account. Similarly, the operation and maintenance costs that are also related to the labor cost (for those who are going to operate these solutions) can vary greatly from country to country. The mean values of these parameters and their variation ranges were found in the literature (or provided by the authors' own experience), and they are presented in detail in the Supplementary Material-G. It should be noted that, to determine the LCOE, the LCOB was first determined, since biogas is the inlet fuel for the production of electricity, thus its annual cost has to be considered.
In Fig. 8, for a discount rate of 6 %, the LCOB varies from 1.7 to 3.7 Table 3 Biogas production and fertilizer (NPK) supply potential on Latin American dairy farms. USD cents/kWh. The lower value corresponds to large dairy farms (GT500) and the higher small farms (LT15). The feasibility of producing biogas can be confirmed by comparing the LCOB with the prices of equivalent conventional fuels in Latin America. These fuels are LPG and NG, and although their prices are highly fluctuating and vary from country to country, reference values are used for the comparison. These average prices for the entire Latin American region were found to be 9.4 and 3.8 USD cents/kWh for LPG and NG, respectively [95]. From Fig. 8, it can also be concluded that applying the proposed Solution 1 in small farms (LT15 and 15_50) is feasible (for a discount rate of 6%) since the cost of producing biogas is lower than the reference NG price and much lower than the LPG price. For higher discount rates (9 and 12%), the LCOB of small farms (LT15) tends to exceed the NG price but is still lower than the LPG price. In the rest of the farms, producing biogas seems to be highly competitive and has the potential to be used for the supply of other energy services. However, this analysis should be done for each country, since there are countries that apply subsidies for fossil fuels, which can make biogas production less attractive and competitive in their markets. Solution 1 (presented in Section 2.4) was proposed for small farms (LT15 and 15_50) without considering the production of electricity. Despite this, the cost of producing electricity (LCOE) has been determined for all farm sizes; these results are shown in Fig. 9. It is observed that producing electricity on small farms (LT15) is technically feasible but not economically viable, since its LCOE exceeds the reference price of electricity in the region, therefore it is verified that solution 1 is adequate for these farms (however, from the previous section, these farms have surplus biogas that can be used). This high cost is mainly due to the higher costs related to the technology (economy of scale); for example, power generators of a minimum capacity have to be installed and generally at a higher installation cost (per kW e ) than larger generators. Operation and maintenance costs may also be higher, since spare part costs and the labor costs of technicians in case of failures are high in comparison to the overall cost of such a small power system. Surprisingly, it was found that on small farms (15_50), electricity production is economically viable, and as in the rest of the farms, the price of producing electricity (LCOE) is lower than the reference prices, even for higher discount rates. From here it can be deduced that solution 2 can be applied not only to farms (50_100) but also to small farms (15_50); in this way, solution 2 applied to this range of farms would allow for their energy self-sufficiency.
Regarding solution 3, which is proposed to be applied to large farms (100_500 DS/DL and GT500 DL), it can be seen that producing electricity is economically viable. Therefore, it is assumed that a CHP system that recovers heat (which has no cost) from the combustion gas will allow the production of refrigeration in a feasible way. Otherwise, electricity can be used for refrigeration systems (same as in solution 2). In any case, energy self-sufficiency in large farms is also guaranteed with the results of this techno-economic evaluation.
The most representative LCOE, in Fig. 9 and for a discount rate of 6%, Fig. 6. Demandsupply of energy services for farm size categories LT15, 15_50 and 50_100.
ranges from 6 to 12 USD cents/kWh (excluding LCOE of LT15 farms). This shows that it is feasible to produce electricity in most of the dairy farms since their LCOE are lower than the reference prices of electricity in Latin America. These reference prices were found to be 21 USD cents/ kWh (median value, year 2019 [96]) and 17 USD cents/kWh (average value, year 2014 [95]). However, as in the hydrocarbon's case, several Latin American countries provide subsidies to electricity services (either directly by lowering prices for target users, or indirectly, when subsidizing the price of NG for power plants). This can make producing electricity less competitive [95,97]. For this reason, this analysis should be done at the level of each country, considering its own market conditions. It was found that the investment capital required for farm sizes LT15, 15_50, 50_100, 100_500 (DS), 100_500 (DL) and GT500 (with an average number of cows of 10, 30, 75, 300, 300 and 1,000, respectively) is 2,383; 4,222; 18,798; 59,887; 66,824 and around 198,677 USD for biogas production and around 900; 984; 6,960; 18,445; 20,535 and 27,540 USD for electricity production, respectively. Although it was found that the production of electricity in small farms (LT15) is not economically viable, the investment cost of the power generator is presented, which can be useful in some cases. The detailed results of applying the Monte Carlo method for LCOB and LCOE (average, maximum and minimum values), and the main characteristics (sizes) of the biodigesters and power generators, are presented in Supplementary Material-G.
Another important product that results from the solutions are the mineralized organic fertilizers (N, P, and K). Their availability has the potential to reduce the use of expensive artificial fertilizers. Therefore, dairy farmers are expected to save money or, if they sell the fertilizers, they can earn extra income, thus contributing to the economic feasibility of the solutions.
From these techno-economic results it can be concluded that the proposed solutions are adequate for all dairy farms in Latin America. The production of biogas and electricity is feasible in most of the farms, allowing for energy self-sufficiency. Solution 2, initially proposed only for medium-sized farms 50_100, can also be applied to small dairy farms 15_50 allowing for their energy self-sufficiency. In this case, from a techno-economic point of view, it is concluded that energy selfsufficiency is possible on around 22% of Latin American dairy farms. The rest of the individual small farms (LT15) can produce biogas in a feasible way, but not electricity (and the rest of the energy services), and accordingly, the potential use of the surplus biogas that results from these farms is discussed in the following paragraphs.

Energy services surpluses and their potential use
It was found that the application of the proposed solutions allows having surpluses of energy services, namely biogas (solution 1), electricity (solution 2 and 3) and surplus heat (solution 3), which have the potential to be used in many applications inside or outside the dairy farms.
For example, on small dairy farms where solution 1 is applied, the surplus biogas can be used either on each of the farms (individual systems for heating, cooking, drying, etc.) or for implementing centralized polygeneration plants (considering existing organizations for milk cooling centers). This could include the supply of additional energy services, such as electricity, refrigeration and organic fertilizers required by associations of small dairy farmers [17]. In this case, the proximity between farms is an important factor to consider, as this will determine if it is more effective (techno-economically viable) to produce biogas on each small farm and then centralize the biogas surplus (through pipes) at a point where a polygeneration plant can be set. An alternative would be to collect (and centralize) the cows' manure for producing biogas, as it can then be used in the plant and the surplus can be distributed to the farms as cooking gas.
The surpluses of electricity that come from the application of  solution 2 and 3 in medium and large-sized farms have the potential to cover additional power demands in the farms or be sold to potential customers, including the nearby power grid company. The surplus of heat that results from the application of solution 3 on large farms can be used for heating biodigesters, which would improve the anaerobic process by allowing for a higher yield of biogas production, water/air heating for domestic purposes, heating for cows' stables and energy for drying systems. An additional benefit of using these surpluses will be the contribution to a further reduction of GHG emissions since the need of conventional energy services can be reduced or avoided. Table 4 presents the GHG emissions (in CO 2 eq.) that can be reduced/ saved when applying the proposed biogas solutions. For this, methane (CH 4 ) and nitrous oxide (N 2 O) from manure management, nitrous oxide (N 2 O) from manure/bio-slurry applied to the soil, and carbon dioxide (CO 2 ) from the direct use of energy services and the use of surplus energy services are considered. The results are presented for each farm size category (individual farms) where any of the solutions are applied. Total reductions per farm size category, per solution, and for all dairy farms in Latin America are also shown. Table 4 shows that CH 4 emissions that come from manure management (MM) are reduced to a lesser extent on farms with solid manure management (DS), while in large farms with liquid manure management (DL) this reduction is much higher (% reduction last column). It can be seen, for example, when solution 1 is applied to LT15 farms (DS), the CH 4 emission reductions from manure management are only 11% (last column), while solution 3 applied to 100_500 farms (DL) produce a reduction of 88% of the CH 4 emissions. This happens since, in the "current scenario", liquid manure management on large farms allows for anaerobic conditions that promote the generation of CH 4 . Therefore, CH 4 captured through biogas production on these large farms allows for a higher impact of these reductions. The opposite occurs with N 2 O from manure management; although the difference is not that high, solid manure management has higher emission factors than liquid management, resulting in higher reductions.

GHG emission reductions/savings due to the application of the proposed solutions
Regarding N 2 O emissions, which comes from manure/bio-slurry application to the soil (MSA), the application of manure as a fertilizer (considering its nitrogen content) will produce the same N 2 O emissions as when applying bio-slurry (according to the emission factors). However, the solutions propose a higher fraction of manure collection for biogas production than in the "current scenario". It does not affect farms with DS since manure (left on grazing fields and stocked in open spaces) and bio-slurry from biodigesters have the same N 2 O emission factor, thus these farms do not have emission reductions. On large farms with DL systems, there is a fraction of manure that remains inside the stables without producing N 2 O emissions (assuming there is no direct interaction with soil); this occurs in the "current scenario". In this case, biogas production (as part of the solution) would result in less manure remaining inside the stables; instead, there would be more bio-slurry for soil application. Therefore, N 2 O emissions related to DL farms would slightly increase in the proposed scenario (Table 4). Finally, it is important to mention that bio-slurry (from biodigesters) provides mineralized nitrogen (that improves the soil), making this nutrient easy for uptake by plants.
CO 2 emissions are saved (Table 4) due to the direct use of biogasbased energy services (DEU). This occurs when LPG or NG (generally used for cooking and heating water) is replaced by biogas and when electricity from biogas-based solutions replace the need of electricity that comes from conventional power systems. Electricity production is only considered on medium and large farms where solutions 2 and 3 allow for supplying this service.
The use of the surplus energy services (SEU) -electricity, biogas and heatallows for a higher displacement of the use of conventional solutions (fossil fuels used for cooking and heating, and electricity from the grid) and, consequently, avoids their associated CO 2 emissions. The CO 2 emissions that would be saved if surplus services were used are (i) biogas (solution 1) on small farms, (ii) electricity (solution 2) on medium-sized farms, and (iii) electricity and heat (solution 3) on large farms, as presented in Table 4. These surplus energy services have the potential to be used inside or outside the farms to meet various additional energy-related demands apart from those required specifically on dairy farms. This would allow an additional emission savings that, in cases such as 100_500 farms (DS), will make the total emission reductions even higher than the emissions generated in the current scenario. This is actually due to the energy potential of biogas, which allows for surplus energy services. The use of these surpluses contributes greatly to the reduction of GHG emissions. As expected, the reductions/savings in GHG emissions on dairy farms are linked to the size of the farms; larger farms have the potential for larger emission reductions. In the Latin American context, the GHG emission reduction potential is 32.8 Mton of CO 2 eq. per year. Solution 3, applied to large farms, contributes to 60% of this reduction while solution 1, applied to small farms, and solution 2, applied to mediumsize farms, contributes to 27% and 13%, respectively. When looking at the GHG emissions of the current scenario, it is observed that the application of these solutions (proposed scenario) would contribute, in total, to reducing 88% of the current scenario emissions. This high reduction does not yet consider additional emission reductions that can be achieved due to the displacement of the use of synthetic fertilizers that would be replaced by the massive use of organic fertilizers (supplied by the proposed solutions). Thus, from a broad perspective, these solutions can be considered a highly effective alternative for GHG emission reductions.
The results presented in Table 4 show the potential of GHG emission reductions when the biogas solutionsinitially proposed under certain assumptionsare applied to dairy farms. However, from the technoeconomic evaluation, it has been concluded that solution 2 can also be applied to small farms of 15_50. This means that electricity can be produced on these farms, and therefore in the "proposed scenario" for all farms of 15_50 (Table 4), the GHG emissions due to the use of conventional electricity (DEU) changes from 0.53 to zero Mton CO 2 eq. per year. Instead of having a surplus of biogas, there will be a surplus of electricity (SEU), whose use will allow emission reductions of 1.46 Mton CO 2 eq./year. These changes partially modify the global results that were presented in the previous paragraph; the proportion of GHG emission reductions due to the application of solution 1 change from 27% to 18%; solution 2 change from 13% to 20%; while solution 3 change from 60% to 62%. When looking at the total potential for GHG emission reductions, applying solution 2 to small farms of 15_50 will produce a slight decrease on the total reductions but an increment on the number of dairy farms where energy self-sufficiency is possible. These emission reductions will change from 32.8 to 31.9 Mton CO 2 eq. per year. Although it is not a significant change, these results are especially relevant since they show the economic potential of reducing GHG emissions on Latin American dairy farms.

GHG emission savings related to the replacement of synthetic fertilizers by organic fertilizers (recycled nutrients)
As mentioned in Section 2.5.6, if the use of organic fertilizer (bioslurry), with its nutrients, nitrogen-N, phosphorus-P and potassium-K, is highly extended and prioritized over the use of synthetic fertilizers, then the production of those would be avoided. The CO 2 emissions that would be avoided by stopping production of these synthetic nutrients would reach up to 6.6, 0.21 and 0.26 Mton of CO 2 /year for N, P, and K, respectively. The total potential of these savings would be 7.1 Mton of CO 2 /year (from using Equations 37 and 38 in the Supplementary Material-E). On the other hand, the CO 2 eq. emissions of N 2 O generated when synthetic nitrogen is applied to soil would be higher than those generated when using organic nitrogen (from bio-slurry). In this case, the emissions that would be saved reach 9.9 Mton of CO 2 /year (from using Equation 39 in the Supplementary Material-E).
Considering this, it is estimated that an additional potential for GHG emission savings, related to the production and use of fertilizers, would reach 17 Mton of CO 2 per year. Figure 10 shows the distribution of the emissions that are reduced/ saved when applying the proposed biogas solutions; this is the total for all Latin American dairy farms. Methane, nitrous oxide (in CO 2 eq.) and carbon dioxide (CO 2 ) emission (from direct use of biogas-based energy services and from the use of surplus services) reductions/savings are considered. It also includes the additional potential reduction of carbon dioxide emissions related to the massive use of organic fertilizers, which allows for avoiding or displacing the use of synthetic fertilizers.
In Fig. 10, the results show that the potential for CO 2 eq. emission reductions/savings when applying the proposed biogas-based solutions on Latin-American dairy farms can reach about 32.8 Mton/year. This is without considering the additional reductions due to organic fertilizer use, which adds 17 Mton/year (this can be considered as an extra potential for reductions, so it is not included in this analysis). From these 32.8 Mton/year, reductions related to CH 4 reach around 42%, and together with the reductions of N 2 O reach 60%; this is the most important contribution to the total reductions and can be considered as direct emission reductions. This means that manure management through the production and use of biogas is the most relevant and direct action for reducing GHG emissions. On the other side, the displacement of the use of conventional energy (and fossil fuel-based) services results in indirect emission savings (for CO 2 ) that represent about 11%. Finally, the potential of CO 2 emission reductions due to the use of surplus energy services represent 29%. In total, and considering the additional potential emission reductions related to the use of organic fertilizers (17 Mton/ year), it would be possible to achieve around 50 Mton/year of GHG emission reductions. It should be noted that this additional potential alone represents around a third of the total potential reductions. The GHG emission reductions are disaggregated and presented in Supplementary Material-H (Fig. 3).

Potential of GHG emission reductions in Latin American countries
The reductions/savings of CO 2 eq. emissions that can be achieved in the different farm size categories for each of the Latin American countries are presented in Table 5. The equivalent CO 2 emission reductions that can be achieved due to the massive use of organic fertilizers, N, P and K (recycled nutrients from bio-slurry) are also presented in parentheses in Table 5.
It is evident that the potential for emission reductions/savings is proportional to the intensity of dairy farming in each country. Brazil is the country with the highest potential CO 2 eq. emission reductions, representing 35%, and together with Colombia, Mexico and Argentina would allow for reducing 61% of the potential reductions of GHG emissions from dairy farms. Table 5 (last row) also shows that in Latin America, biogas solutions applied to small-sized farms (LT15 and 15_50) can allow for reducing CO 2 eq. emissions by 27%. Medium-sized farms (50_100) can contribute with around 13%, and together with small farms they represent 40% of all the potential reductions. Biogas solutions applied on large farms (100_500 and GT500) contribute by reducing the remaining emissions (60%).
If the techno-economic feasibility that allows for applying solution 2 to small farms (15_50) is considered, results from Table 5 vary slightly: the total GHG emission reductions for 15_50 farms will change from 3,123.48 to 1,729.26 kton of CO 2 eq./year (a reduction of about 45%). In this scenario, small farms, LT15, where solution 1 is applied, can contribute with about 18% of emission reductions, and farms where solution 2 is applied would contribute with 6% and 13% for farms sizes 15_50 and 50_100, respectively. The remaining 63% of emission reductions would be contributed by farms of 100_500 and GT500, where solution 3 is applied.
When exploring strategies for implementing these biogas-based solutions on dairy farms, the results from Table 5 should be considered at a country level; in this way, given the techno-economic feasibility, farms with higher GHG emission reduction potential can be prioritized. For example, compare two countries with very different results, Bolivia and Brazil. In Bolivia half of the potential for reducing GHG emissions can be achieved with the application of solutions on small farms, as there are no large farms (with more than 500 dairy cows). On the contrary, Brazil, whose total reduction potential is more than 50 times that of Bolivia, has a high potential for reducing emissions not only on small farms but also on large farms.

Final remarks, limitations and future work
From the results presented, it is clear that the potential for biogas production on Latin American dairy farms is high. Using this biogas in different technological solutions allows for covering most of the energy demands of this sector (cooking gas, electricity, refrigeration and hot water). From the energy balance and techno-economic evaluation it was found that energy self-sufficiency is possible on dairy farms of all sizes (except those with up to 15 cows, LT15); small farms (LT15) can still produce biogas in a feasible manner and reach complete energy selfsufficiency, where the use of the surplus biogas in centralized polygeneration systems (CHP/CCHP plants) can be an alternative solution. For this, the geographical location of the farms should be considered, since their proximity to each other would facilitate the collection of farm waste required for biogas production. The centralized biogas plant can also supply organic fertilizers, electricity and offer milk-cooling services for dairy farmers [17]. This solution can reach small and medium-sized farms that can be part of the implementation of medium/large-scale plants, instead of small-scale-individual solutions. In this case, the supply of various energy services can benefit not only dairy farmers but also other potential consumers that can purchase the available surplus services and products.
Additionally, organic fertilizers (nitrogen-N, phosphorus-P and potassium-K) that result from bio-digestion processes are supplied by the solutions on all type of farms.
With respect to GHG emissions, the reductions of CH 4 and N 2 O emissions are found to be dependent on the farm size and emission factors that were calculated (or selected) considering the characteristics of dairy activity. On the other hand, savings of CO 2 emissions are achieved when replacing the use of conventional energy services by the proposed biogas-based energy services. These savings of CO 2 emissions are dependent on country-specific emission factors for the use of conventional energy services (electricity, LPG and NG) and can be considered a co-benefit of the application of the proposed solutions. Finally, additional savings of CO 2 eq. emissions are possible when considering the widespread use of organic N, P, and K, avoiding the GHG emissions generated due to their production and use in the soil.
The proposed solutions promote the farm's energy self-sufficiency, an efficient and proper management of waste under the concept of "waste-to-energy" contributing to the sustainability of the dairy sector. Biogas, obtained from farm waste, becomes the source of energy to meet the various energy demands of farms. This concept promotes the circularity of resources and has a positive effect on reducing GHG emissions, since the demand of conventional energy services and synthetic fertilizers is displaced. Finally, several of the SDGs are promoted along the lines of a circular economy that could also bring economic benefits to this sector.
One of the limitations identified in the development of this study is related to the difficult access to specific information (by countries/regions) on the particular parameters required to estimate biogas production and energy demands on Latin American dairy farms. For this reason, average or default values (given by IPCC [25,26]) of the required parameters have been used; although they are properly justified, these may vary at the time of obtaining specific data for each country. For example, the biogas yield factor may be different even within the same country, due to climatic conditions, the breed of animals and type of farm management. On the other hand, the calculation of carbon dioxide emissions for conventional energy services has been carried out considering country-specific emission factors from the year 2015 (while other data are from nearby years), which can also change over the time; however, the parameters were carefully selected. Due to the existence of several parameters with certain variability, the Monte Carlo method was applied to determine the costs of biogas and electricity (LCOB and LCOE). Then the results are approximate estimates valid for different dairy farms in Latin America. In this case, better accuracy would be achieved when analyzing each country separately. This can be seen as another limitation. In any case, the results from this study show a first scenario that could be considered as the basis for future studies and a deeper exploration of strategies that can promote the application of these sustainable energy solutions in specific locations. Regarding the methodology applied in this work, this could be considered an important contribution for promoting the sustainability of the sector since stakeholders and policymakers, focusing on a specific country or region, can use it in a more precise way. Future studies should analyze financing alternatives, policies/regulatory issues and even social/organizational aspects. The techno-economic evaluation has not considered economic estimates related to the organic fertilizers, but it is clear that their use (or sale) can contribute to the feasibility of the solutions. The results of biogas and electricity costs are attractive but require an investment capital. Considering that large farms are usually managed by large companies, it is probably easier for them to implement solutions with private capital. On the other hand, for small and medium sized farms it is necessary to explore financing mechanisms. One option would be to redirect fossil fuel subsidies (where possible) to the implementation of these solutions that greatly contribute to the sustainability of dairy farms through proper energy and waste management.
Since this work focuses on the dairy farms, the only waste considered as determining the potential for biogas production was cows' manure. However, particular studies focusing on specific geographic locations could also include different organic residues/wastes, for example, domestic, agricultural (biomass), industrial and other animal wastes that can be used as a co-substrate for biogas production. This could allow for increasing the biogas production potential even more. Finally, the biogas-based proposed solutions have the potential to be applied to other productive sectors with the availability of organic waste (as a source for supplying organic fertilizers) and a simultaneous demand for electricity and thermal services.

Conclusions
The waste-to-energy approach was applied to Latin American dairy farms, where cow's manure is proposed for the production of biogas and the application of different biogas-based solutions. The solutions supply not only energy services demanded by dairy farms (gas for cooking, electricity, refrigeration and thermal energy for heating water) but also organic fertilizers (N, P and K). The potential of biogas production was estimated to verify whether this is sufficient for covering the farms' energy service demands. Energy balance (through a demand-supply analysis) and a techno-economic evaluation of the proposed solutions were performed to evaluate the energy self-sufficiency of the farms. Finally, GHG emissions, which are reduced/saved with the application of the proposed solutions, were quantified. The specific conclusions are as follows: • Theoretically, the biogas production potential of Latin American dairy farms is sufficient to meet their own energy demands. The biogas production capacity reaches 81 TWh/year, while the energy service demands would be covered with around 50% of it. • The total potential for recycling organic fertilizers (through biogas production) on dairy farms in Latin America was found to be around 2.4, 0.28 and 0.75 Mton/year for the nutrients nitrogen-N, phosphorus-P and potassium-K, respectively. • From the techno-economic evaluation it was found that producing biogas and electricity on almost all types of dairy farms is feasible. This has the potential to allow energy self-sufficiency based on the available organic waste. However, electricity production on small farms with up to 15 cows is not as attractive as it is on the rest of the farms. That limits the use of biogas to only cooking and heating water. In this case, energy self-sufficiency might be achieved with the implementation of centralized polygeneration plants where the surplus biogas (7.6 MWh/year) can be used for the supply of various energy services. • Biogas-based solutions for medium and large farms are feasible, allowing for their energy self-sufficiency. In addition, these solutions generate surpluses of electricity, which reach 72 and up to 998 MWh/year for medium and large farms, respectively. There is also a surplus of heat (thermal energy) on large farms, which reaches up to 1,234 MWh/year. • The relevant levelized costs of biogas (LCOB) and electricity (LCOE) were found to be in a range of 1.7-3.7 USD cents/kWh and 6-12 USD cents/kWh, respectively. In most cases they are lower than reference prices of LPG, NG and electricity in Latin America. • The application of biogas-based solutions allows for reducing CH 4 and N 2 O emissions from manure management; this reduction, in CO 2 eq., is about 19.6 Mton/year for all Latin America. The effect on N 2 O emissions of applying bio-slurry (organic fertilizer) to the soil is negligible when compared to the current scenario where no solutions are applied. • Replacing the use of conventional energy solutions (electricity from the grid, LPG/NG) by biogas-based energy services results in CO 2 emission savings. These reductions/savings reach up to 3.6 Mton/ year for the direct use of biogas-based services, while using the surplus energy services allows for savings that reach 9.6 Mton/year. • The total potential for CO 2 eq. emission reductions/savings that can be achieved with the application of the proposed biogas-based solutions on all dairy farms can reach 32.8 Mton/year. • Additionally, the extended and massive use of organic fertilizers would allow for avoiding the production and use of synthetic fertilizers. It will lead to additional CO 2 eq. emission savings of up to 17 Mton/year. Considering this, the actual potential for GHG emission reductions on Latin American dairy farms would be around 50 Mton/ year. • The reductions of GHG emissions are proportional to the dairy intensity in Latin American countries. Implementing biogas-based solutions on the dairy farms of Brazil, Colombia, Mexico and Argentina would allow for reducing 60% of the current GHG emissions generated from manure management, soil-application, and energy use. Moreover, the most predominant dairy farms in Latin America are small, with up to 50 cows (93%), and their potential for reducing these emissions is only 27%.
Finally, these solutions promote energy self-sufficiency on dairy farms, the utilization of organic waste and the implementation of sustainable energy systems. This generates environmental benefits due to the waste management and displacement of conventional energy services and synthetic fertilizers. Furthermore, this study considers the possibility of incorporating the dairy sector in the energy market when it comes to the sale of surplus energy services. This would allow not only local economic development but also improve access to energy services for the surrounding populations. In general, the implementation of these solutions based on resource efficiency will produce positive effects in different areas, in accordance with the guidelines of the sustainable developmental goals (SDGs).

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. special thanks to the research group Air Quality and Greenhouse Gases Program (AIR). Thanks to Lena Höglund Isaksson, and thanks to Adriana Gomez.
This study has been carried out as a part of SIDA's research cooperation (Sweden) with Universidad Mayor de San Simon (Bolivia), while financial support (for YSSP) was granted from the Swedish Research Council for Sustainable Development -FORMAS.