## 1 Introduction
### Gasification for Distributed Cogeneration  
A mature and efficient technology currently available in some countries such as India, China and the USA for successful biomass waste management and valorization is gasification. This technology involves the production of a gaseous fuel, usually referred to as producer gas or synthesis gas (syngas), whose main components are hydrogen, carbon monoxide, methane, water, nitrogen and carbon dioxide [12; 13]. The producer gas  
Figure 2: Parts of almond fruit (**left**) and almond processing by-products (**right**). can be used for distributed cogeneration, defined as the simultaneous generation of electrical and thermal power in the close vicinity of end-users. Additionally, the solid remnant residue from gasification, known as biochar, has a potential application as soil enhancer. During the gasification process inside the reactor, a gasifying agent (air, pure oxygen and/or steam) is required so as to transform the feedstock into producer gas through a series of exothermic and endothermic reactions [12], which determine four different stages depending on the temperature at which they occur: drying, pyrolysis, combustion/oxidation and reduction [13]. Gasification is an autothermal process, through which the exothermic combustion reactions provide enough energy for the endothermic reactions responsible for the producer gas formation to take place. Gasifiers are generally classified according to the contact between the gas-solid medium (bed) and the gasifying agent. Thus, they can be grouped into three main types: fixed or moving bed, fluidized bed and entrained flow [12; 13]. Each type of gasifier is used in a given range of thermal power output [13]. For gasification plants on a distributed generation scale with small thermal power (10 kW\({}_{\text{th}}\)-10 MW\({}_{\text{th}}\)), fixed bed gasifiers are generally more suitable because of their simplicity and ability to generate a moderately energy-dense producer gas (4-6 MJ/Nm\({}^{3}\)). Fixed bed gasifiers are further classified as updraft and downdraft gasifiers, depending on whether the gasifying agent is supplied from the bottom (counter-current) or the top of the reactor (co-current), respectively [13; 14]. Updraft gasifiers are typically more efficient than downdraft gasifiers, but lead to a producer gas with a greater tar content (30-150 g/Nm\({}^{3}\)) [14], which hampers its use in internal combustion engines. Downdraft gasifiers, however, are able to generate a producer gas with much lower tar content (\(<\)3 g/Nm\({}^{3}\)) [14], since tars are cracked down in the combustion zone. For intermediate thermal powers (5 MW\({}_{\text{th}}\)-100 MW\({}_{\text{th}}\)), fluidized bed gasifiers are a better choice; whereas for large powers (\(>\)50 MW\({}_{\text{th}}\)), entrained flow gasifiers are the most appropriate reactor configuration [13]. Table 2 shows a comparison of the most relevant operating parameters for each type of gasifier and their power application range [13; 14]. There are already numerous theoretical and simulation studies of gasifiers coupled to small-scale power plants and distributed generation technologies such as gas microturbines [15; 16], gas engines [17; 18], external combustion turbines [19; 20] and steam engines based on organic Rankine cycles [21; 22; 23]. Although the electricity generation efficiency of this technology is relatively low (around 15-20%), CHP efficiencies over 50% can be achieved. Biomass gasification is slightly less efficient than combustion, with conversion efficiencies up to about 85%. However, it has greater application potential, since it allows using raw materials with higher moisture and ash content. Biomass gasification also leads to significantly lower emissions of carbon dioxide, particulate matter and even nitrogen oxides, since the reaction temperature is lower than that of combustion [13]. The fixed-bed gasification technology also produces a solid residue with a high carbon content commonly referred to as biochar.