Predictive Dynamic Model of a Smart Cogeneration Plant Fuelled with Fast-Pyrolysis Bio-Oil

Small-scale biomass-based cogeneration has the potential to contribute significantly to a clean, flexible, secure, and cost-efficient energy system. It provides flexibility to future energy systems by balancing variable intermittent renewable energy sources. A smart control unit is needed to exploit its flexibility. A dynamic system model is required to enable smart control of a cogeneration unit and to determine its optimal working points. This study aims to develop, parameterise and tune a dynamic model of a cogeneration plant fuelled with fast-pyrolysis bio-oil. The system is a hybrid diesel generator/flue gas boiler plant for electricity generation and water/space heating. The plant has two unique features: (i) pyrolysis bio-oil is the new fuel for both engine and boiler and influences their operation and emissions, (ii) power and heat generation are partially decoupled and hence nonlinearly correlated. The paper presents the integration of the components ' dynamic models into a system model. The model is parameterised and partially validated using measurements from a turbocharged four-cylinder diesel engine and a swirl burner, both running on fast-pyrolysis bio-oil. Preliminary controls are designed and evaluated. The applicability and usefulness of the model for cogeneration system analysis and control design evaluation are also illustrated. Results show that the feasible operation region area of the hybrid engine/boiler system is 100% larger than that of the CHP engine. The hybrid plant can achieve energy efficiencies above 85% in response to fluctuating load demand of a hospital.


INTRODUCTION
Small-scale biomass-based cogeneration has the potential to contribute significantly to solving the challenges Europe faces while pursuing to make its energy system smart, clean, flexible, secure, efficient and cost competitive. High efficiencies are achieved by combining heat and power generation; even cooling can be integrated into the such concept. Small-scale cogeneration is considered a technology that provides flexibility to future energy systems by balancing variable intermittent renewable energy sources. Such plants may be designed and implemented in mobile applications. cylinder wall heat transfer and intake/discharge gas exchange processes. Detailed dynamic models also enable incorporating the interaction of a user and its surrounding environment with a micro-CHP plant, such as user load profile [31], water and space heating temperature preference, or the surrounding air temperature [32]. Moreover, the effect of the operating mode of the prime movers, such as steady-state, warm-up and shut down, on power and thermal production and energy efficiencies may be investigated [33]. In [34], the model of an enginebased cogeneration system can predict the fuel use, thermal output, and electrical generation of a cogeneration device in response to changing load, coolant temperature and flow rate, and control strategies. This paper employs a detailed modelling approach of the hybrid cogeneration system, i.e., diesel generator/boiler/gas treatment system, to enable such investigations.
The contribution of this paper is twofold. Firstly, it starts with the dynamic models developed for similar components by already published studies. Then it modifies, parameterises, and fine-tunes the models to fit best with the modified diesel engine and the newly designed swirl flue gas burner. The models are fine-tuned with experimental data from these two components operating on FPBO. It is the new fuel for both systems and has challenging characteristics for combustion in the existing CHP components. FPBO contains about 20 % water and is viscous and acidic. Therefore, its combustion and the products from its combustion differ from those of diesel fuels. The models for the oxygen content of flue gas and NOx emissions are particularly parameterised based on the unique characteristics of FPBO. Secondly, the developed dynamic model incorporates the unique design of the cogeneration plant, which calls for new process modelling. For example, the flue gas burner uses only the oxygen of engine flue gas as its oxidiser, which affects FPBO combustion and emissions from the burner. Due to the high availability of oxygen in the flue gas at a low engine load, the boiler has more freedom to produce a wide range of thermal power. Whereas, at a high engine load, low oxygen availability limits the boiler, which cannot effectively produce heat. A semidecoupled cogeneration concept with a nonlinear relationship between heat and power generation appears relevant. Heat losses in different plant sections are also a function of FPBO combustion. These aspects necessitate new dynamic modelling at both the components and system levels. To the best of our knowledge, there is no dynamic model published in the literature that could be used or fit directly for predictive simulation of this plant.

BRIEF PROCESS DESCRIPTION
The technical concept of the cogeneration plant is presented in Figure 1. Heat and power generation are combined in a hybrid diesel generator and flue gas boiler system. One unique and new feature of this plant is that it is fuelled with fast-pyrolysis bio-oil (FPBO) originating from different types of biomasses. Fast pyrolysis converts biomass into a uniform liquid intermediate called FPBO, and high feedstock flexibility characterises the process. Nowadays, FPBO is produced on a commercial scale in Europe.
The input air is heated before entering the diesel engine through a heat exchanger that recovers heat from diesel engine flue gas. FPBO is combusted in the diesel generator to generate heat and power. Heat is extracted from the engine jacket and carried by engine coolant through a heat exchanger. The flue gas burner/boiler solely uses engine flue gas's oxygen content to combust FPBO. Depending on heat and power demand profiles, either only the CHP engine is operating, or both the engine and burner are on. When power demand is high and heat demand is low, there is no need to generate extra heat, and only the diesel generator will be operating, and the burner will be off. If heat demand is high and power load is low, heat from the CHP engine might not be enough to cover heat demand; therefore, extra heat will be generated by the burner/boiler. The hybrid diesel generator − flue gas boiler system provides a flexible heat-to-power ratio. In this sense, the plant is a flexible cogeneration unit that can deal with the fluctuating energy demand and varying wind/solar power availability.
The plant also includes a newly designed flue gas cleaning system downstream of the boiler. It includes oxidation catalyst (OC), which reduces carbon monoxide (CO) and unburned hydrocarbons (HC), diesel particulate filter (DPF), which reduces particulate matter (PM) and CO and HC, if any, and selective catalytic reduction (SCR) with urea for NOx reduction. Urea solution is injected upstream of SCR into the flue gas stream. Heat is extracted from the cleaned flue gas by heat exchangers or condensation units. In the current research project, SmartCHP [35], a prototype of such a plant is under development.

RESEARCH METHOD AND PROCEDURES
The research method, as presented in Figure 2 and Table 1, is formulated to serve the research objective. This objective is to develop, parameterise, and tune a dynamic model of the cogeneration plant. First, the inputs and output variables of the model are defined. Then the procedure to implement the system model is outlined.

Control design
• Components-level controls including engine rotational speed control, air-ratio control of burner, NOx emission controller that regulates ammonia injection in SCR • Plant-wide level controls and operating modes, including power-led and heat-led modes; in this study, only the power-led mode is implemented Energy efficiencies • Engine electrical efficiency, the ratio of generated power to primary fuel energy • CHP engine thermal efficiency, the ratio of generated heat from the engine to its primary fuel energy • Boiler fuel efficiency, the ratio of the generated heat to primary fuel energy • Plant energy efficiency, the ratio of total generated heat and power to primary fuel energy

SYSTEM MODEL
The cogeneration system consists of a diesel generator, a flue gas boiler, a dedicated flue gas cleaning system, and a heat exchanger and condensers. The focus here is on the flue gas path and simulating the behaviour of system components most affected by the biofuel properties and the resulting flue gas characteristics, i.e., its temperature and its composition. Figure 3 shows the system configuration that reflects this focus point and indicates the state variables of the components. The diesel generator, represented only by diesel engine components on the flue gas path, includes fresh air heating, compressor, intake receiver, cylinders, outlet receiver, and turbine. It is noted that engine rotational speed − the parameter describing engine and alternator interface − is present in the system model. An adaptive PI controller regulates the FPBO injection to keep the engine speed constant at 1500 RPM. The next component is the flue gas boiler with a burner running on FPBO and using the remaining engine flue gas oxygen as an oxidiser. The interface between the burner and diesel engine is the tail pipe R4, which is modelled as a reservoir element and allows for modelling the backpressure by the burner or by the cleaning system in the case engine flue gas is directed to the cleaning system and the boiler is bypassed. The boiler model includes a hot water heat exchanger.
The flue gas from the boiler finds its way to the cleaning system. The first component is OC, which may affect the NO2/NOx ratio. After OC, the DPF is placed that might cause significant backpressure due to the accumulation of PM inside it. This backpressure is modelled by the reservoir component R7 placed between OC and DPF. The last component in the cleaning system is the SCR unit. It consists of a hydrolysis part where the injected urea solution vaporises and forms a flow of NH3 and SCR cells where NOx is reduced by the NH3 absorbed on the surface of the SCR catalyst. Last, a condensation unit downstream of the cleaning system absorbs heat from flue gas. The system model also includes the dynamics of fuel injection devices in the engine and burner and urea solution injection device in the SCR unit.

SUB-MODELS
As described above, the SmartCHP plant consists of various components. This paper focuses on three main components that are the target for control design: diesel engine, boiler burner and SCR. The following sections present dynamic models of these components.

Engine flue gas temperature and composition
An overview of the typical system structure of a diesel engine is presented in Figure 4. The gas exchange system includes a turbocharger, cylinder as a volumetric pump, exhaust gas recirculation (EGR), and a variable geometry turbine. The fuel injection system, engine inertia, and turbocharger inertia are also present. The figure also indicates the input and output variables (input commands) used by the electronic control unit. Compressor. It is a resistance/flow component. A "compressor map" is the basis for compressor input-output calculation. The inputs to a compressor map are: • The pressure up-stream (p1) and down-stream (p2) of the compressor; • Compressor speed (ωtc); • Temperature upstream of the compressor (T1). The outputs are: • Mass flow leaving compressor (ṁc); • Compressor efficiency ( ), representing both isentropic efficiency and technical imperfections in the compressor realisation. The power consumed by the compressor (Pc) to compress the gas (air) mass flow from its input to its output pressure level is: is the pressure ratio over the compressor, and k = cp/cv where cp and cv are specific heats at constant pressure and constant volume, respectively. The torque consumed by the compressor is: The increased air temperature after compression is: Intake manifold. It is the first dynamic subsystem modelled as a reservoir/volume component [9]. The following ordinary differential equations (ODEs) describe pressure and gas temperature dynamics inside this receiver.
where VIR is the receiver volume. Note that this receiver has two inflows: air from the compressor and recirculated flue gas from EGR. Here the first law of thermodynamics for open systems is applied. It is assumed that no heat transfer through the walls is occurring, the fluids can be modelled as ideal gases, the specific heats for fresh air and flue gas are the same, and flowrates have a fixed, known direction.
The cylinder subsystem. It determines air (or mixture, in the case of EGR) mass inflow (̇) and the combustion outputs, which are the torque generated by the engine and the temperature (Te) of flue gas at the outlet valve before entering the outlet receiver. The engine, modelled as a volumetric pump, transports air (or mixture) from the intake manifold to the outlet manifold. Air (or mixture) mass flow aspirated from the intake manifold into the cylinders is: is the gas density at the intake side, Vd is engine displacement volume, is engine rotational speed, and N=2 for four-stroke engines (in every two rotations of the crankshaft, one full-cylinder gas volume is transported). The volumetric engine efficiency indicates what portion of the full displacement volume is effectively used to pump the gas in and out the cylinders. This volumetric efficiency consists of two terms, one dependent on pressure ratio over the cylinders, and the other is a parabolic function of engine speed. = , , where cr is the engine's compression ratio, e = 3 2 is the pressure ratio over cylinders, k is the ratio of specific heats, and , , , , , , are constant coefficients.
EGR mass flow rate. As an indirect input, it is a function of EGR valve opening (uegr) and the pressure ratio between intake and exhaust manifolds ( e ). For a control-oriented model, EGR mass flow is approximated by an orifice equation: where Note that is a function of EGR valve opening. In the EGR pass, there might be a heat exchanger to cool down the EGR flow. EGR may also need a pumping device to create the required flow if the pressure on the exhaust side is lower than on the intake side.
Engine torque. The calculation starts with fuel mean effective pressure (pmf): = (12) where is the lower heating value of the fuel, and = ̇2 is the amount of fuel burned in each combustion cycle (consisting of four strokes). The brake mean effective pressure is a portion of determined by engine thermodynamic efficiency ℎ minus total pressure losses ( ): Total pressure loss includes losses by engine friction (pmlf) and gas exchange (pmlg): For a diesel engine, pressure loss for gas exchange is the pressure difference over the cylinders: Pressure loss by friction is modelled as a second order function of engine speed: where 1 and 2 are constant coefficients. Engine thermodynamic efficiency η th consists of different terms dependent on engine speed, air-to-fuel ratio, and injection timing.
The speed-dependent efficiency term is a parabolic function of engine speed: where * is the speed with maximum efficiency and a ℎ, is a constant coefficient. The term dependent on air-to-fuel ratio is parametrised as: where , is the maximum value for this term, and 1 ℎ,λ and a2 ℎ,λ are non-negative constant coefficients. The term dependent on injection timing is: (20) in which ζ * is the optimal start of injection angle and a ℎ,ζ is a non-negative constant coefficient. The engine torque finally is: = 2 (21) and mean engine power is: When load power Pload acts on the engine, the ODE describing the engine speed dynamics is: ̇= − (23) where is the engine's moment of inertia. The mass flow that leaves the cylinders is the total of air mass inflow and fuel mass flow: ̇=̇+̇ (24) The balance of energy in the cylinders requires that the sum of the energy of input air (or mixture) and the combustion be equal to the sum of produced mechanical energy, heat losses to the coolant, and the energy that leaves the cylinders by the enthalpy of exhaust gas. This requirement gives the equation for exhaust gas temperature at the outlet valve: ,̇ (25) in which kcool indicates how much of the available heat flux is carried by the exhaust gas. The coolant removes the remaining heat flux. The coefficient kcool is parameterised as: where a0:2,cool are constant coefficients, and Me is engine torque. Coolant temperature may affect especially in automotive applications when biofuel is used [36]; however, for stationary power generation is assumed a function of engine torque.
Exhaust manifold (receiver). It is another dynamic subsystem modelled as a reservoir/volume component. The following ordinary differential equations (ODEs) describe pressure and gas temperature dynamics inside this receiver.
−̇� (27) where VOR is the exhaust receiver volume. Note that there are two outflows from this receiver, flue gas to turbine (̇) and recirculated flue gas back to the intake receiver (̇). It is assumed that the fluids can be modelled as ideal gases, and flows have a fixed direction. Despite (convection/radiation) heat losses through the receiver walls are not considered for the intake manifold, these losses are quite significant on the exhaust side because of higher temperatures. Therefore, for the gas temperature dynamics inside the exhaust receiver, the heat losses from flue gas to the receiver wall (̇) through convection are also modelled: where and are the coefficient and surface area for convection losses. An additional ODE is required to describe the dynamics of exhaust manifold wall temperature ( ). It is assumed that the heat transfer from the exhaust manifold wall to the ambient is only through radiation and is given by: where WAmb is a coefficient for radiation heat transfer, and Amb is ambient temperature. The ODE for exhaust manifold wall temperature is: When EGR is implemented, the states of the intake manifold and exhaust manifold are affected by EGR mass flow (̇). EGR also affects the dynamics of air-to-fuel ratio and oxygen availability in the engine flue gas. In the dynamic model of the EGR path, the intake and exhaust manifold states are represented by the mass of fresh air and recirculated flue gas in these reservoirs. The ODEs for the mass of air and flue gas inside the intake manifold are: where 2, = 2, 2, + 2, are the contents of air in the intake and exhaust manifolds, respectively. The ODEs for the mass of air and flue gas inside the exhaust manifold are: In the above ODEs, ̇0 is the amount of air needed for complete stoichiometric combustion of fuel mass flow ̇, where 0 is the stoichiometric air-to-fuel ratio.
Note that with this EGR model and perfect gas law, pressures inside manifolds (i.e., p2 and p3) are functions of their mass and temperatures.
The air-to-fuel ratio at the start of combustion is: Assuming perfect mixing of gases inside the exhaust manifold, the weight content of oxygen in the engine flue gas is: where X is the molar weight of compound X. Assuming CO2, H2O, N2 and O2 are the main flue gas species, the molar presence of H2O and CO2 in the flue gas from the complete combustion of FPBO is needed to calculate the molar oxygen content of flue gas. For oxygenated FPBO with averaged chemical formula CaHbOc, (e.g., C3.6H7.8O1.6), a complete FPBO combustion reaction reads: Note that the averaged chemical formula is not referring to a real existing chemical compound of FPBO. It is based on the calculated average number of carbons, hydrogen, and oxygen atoms in one mole of FPBO. The published surrogate mixture of pyrolysis bio-oil is the basis for such calculation ( [37]). Accordingly, the weight content of CO2 in the engine flue gas is: (38) and for H2O: Then, the weight content of N2 in the engine flue gas is calculated by subtraction: Finally, the molar content of oxygen in the engine flue gas is: Turbine. It is a flow/resistance component. A "turbine map" is used for fluid-dynamic turbines to estimate their mass flow as a function of turbine pressure ratio and rotational speed. For a control-oriented model, turbine mass flow is approximated by an orifice equation: is pressure ratio over the turbine, , is discharge coefficient, is the open area of the turbine. In the case of a variable geometry turbine, and are functions of turbine vane opening or nozzle area. The discharge coefficient is parameterised as a second-order function of turbocharger speed: where 0 , 1 , 2 are constant coefficients. The power (or torque) generated by the turbine depends on its isentropic efficiency. In some control-oriented applications, turbine efficiency has been assumed constant. Experimental data are needed to model turbine efficiency as a function of pressure ratio, rotational speed, and nozzle area opening. Once turbine efficiency is modelled, the power generated by the turbine is: where is turbine efficiency. The torque generated by the turbine is: The temperature of flue gas after the turbine is: Friction is usually included in the turbine efficiency model. However, if efficiency is considered constant, then one could add a speed-dependent friction torque to the ODE of turbocharger speed: where: in which , is a constant coefficient, , is turbocharger friction torque, and is the turbocharger's moment of inertia.
The dynamics inside the tailpipe receiver are modelled similar to the exhaust manifold. The relevant state variables are p4 and T4 for pressure and temperature inside the receiver and TTRW − temperature of the tailpipe receiver wall. For the sake of brevity, the formulations of the ODEs are not presented here. Note that the ODEs of the tailpipe receiver require the estimation of mass flow out of this receiver (̇). This mass flow may be directed to the boiler burner or bypass the flue gas cleaning system through a valve/throttle. The backpressure created by the downstream components will determine the flue gas mass flow out of the valve/throttle. NOx formation in a diesel engine is a function of torque generation, oxygen availability and engine speed. A mean-value model of the engine assumes all processes and effects are spread out over the engine cycle (4-stroke). Therefore, the mean-value NO concentration (cNO) is modelled statically by: where p1, T1, and HM1 are pressure, temperature and humidity of intake air; Me, yO2,eg and ωe are engine torque, the oxygen content of flue gas, and engine rotational speed, respectively.

Boiler flue gas temperature and composition
The boiler system consists of three components: a fuel injection system, combustion chamber, and heat exchanger. Fuel injection includes injection pump and injectors lifting. The combustion chamber model includes flame temperature, combustion reactions and the formation of pollutant emissions. The heat exchanger determines heat transfer from flue gas to water. The idea is to develop a detailed model to describe the transient short periods (start-up and cool-down). These periods are important for pollutant formation when the system should frequently respond to changes in the operating point of the upstream diesel engine (due to changes in power demand) and changes in hot water demands.
A first-order low-pass filter describes the dynamics of a fuel injection device. The parameters of such a model can be identified from experiments. The boiler/combustor system (combustion chamber and heat exchanger) involves some significant dynamics. Figure 5 presents a schematic view of the boiler/combustor system with its control-oriented input/output variables.
Assuming complete adiabatic combustion of FPBO in the boiler burner, the control-oriented boiler dynamic model starts with calculating the usable power on the gas side as: in which ̇ is the useful power (amount of heat transferred from flue gas to water), ̇ is the heat generated by adiabatic combustion, ̇ − the heat flux into the system by the enthalpies of the three system inputs (air, fuel, and engine flue gas), ̇ − ambient heat losses in the combustion chamber, and ̇ − the heat flux out of the system as the enthalpy of boiler flue gas. The formulations for these terms are as follows.
The heat generated by the adiabatic combustion is: where ℎ( ) is specific enthalpy of gas flowing in the combustion chamber. The sum of input enthalpies reads: The total energy input to the combustion chamber is the sum of the heat generated by the combustion and input enthalpies. Therefore, the enthalpy of gas in the combustion chamber is: Ambient heat losses in the combustion chamber and burner box are assumed proportional to the heat input to the combustion chamber.

̇=
(̇+̇) =̇, ℎ( , ) where is the heat loss coefficient. This term refers to heat losses through convection and radiation, parameterised by a third-order polynomial of Tgcc.
Heat flux out of the boiler chimney by the enthalpy of flue gas is: where � g,out is steady-state temperature of flue gas out of the boiler chimney. Boiler thermal efficiency is defined by: Thermal efficiency is parameterised as a function of boiler operating point (represented by Tg,cc): Then � g,out is calculated as: When assuming perfect gases with constant cp,g, the specific enthalpies expand as: Two thermal reservoirs exist in the boiler model: thermal capacity of water (including its piping) and thermal capacity of flue gas, mainly due to the mass of flue gas tubes. Two ODEs describe the dynamics of these reservoir temperatures [11].
Assuming a lumped parameter model for the water subsystem, i.e., fixed volume water reservoir with homogeneous temperature all over the reservoir and a constant water flow rate and temperature, the ODE for the temperature of water in the reservoir reads: where Cw is the thermal capacity of the water reservoir (water+piping) and cp,w is the specific heat of the water. The dynamics of flue gas temperature out of the boiler (at the chimney) are described by the following ODE: where Cg is the thermal capacity of flue gas reservoir (e.g. metal tubes) and cp,g is the specific heat of flue gas.
Sub-model of the oxygen content in the flue gas. A general chemical formula for FPBO and its complete combustion reaction (with fresh air) reads: When the flue gas from the engine is used as an oxidiser in the boiler burner, the reaction for complete combustion reads: α β γ δ + 1 2 + 2 2 + 3 2 + 4 2 → 5 2 + 6 2 + 7 2 + 8 2 Oxygen available for the burner flame temperature is the sum of the oxygen content of flue gas and oxygen from fresh air, if any. It should be noted that although in this boiler dynamic model, the fresh air inflow is considered as an input, it is not meant to be present in the final design of the boiler system. Obviously, one can eliminate the fresh air element from the model (̇= 0) but it is present in the model for the sake of model generality and flexibility.
Oxygen mass flow present in the fresh air is: where the molar oxygen content of fresh air is 21%. Assuming CO2, H2O, N2 and O2 to be the main species of flue gas, and when the oxygen content of flue gas is O2,eg , then the mass flow of oxygen present in the flue gas is: Note that the molar contents of CO2, H2O, and N2 in the flue gas ( 2, , 2 , , 2, ) are dependent on FPBO chemical formula and oxygen content of flue gas. The total available oxygen mass flow is: When an FPBO-fuelled flue gas burner uses the oxygen in engine flue gas as an oxidiser and the air-to-fuel ratio is constant, NOx formation in such a burner is a multiple linear function of engine flue gas temperature and oxygen availability where a , , i = 0, 1, 2 are the constant coefficients of the multiple linear regression model.
Adiabatic flame temperature. The adiabatic flame temperature at constant pressure Tadiab is a function of inputs, particularly the oxidiser/fuel ratio. When engine exhaust gas is used as an oxidiser, the equivalent oxidiser-to-fuel ratio is: where 0 is the stoichiometric oxidiser/fuel ratio. The only oxidiser in the SmartCHP boiler system is the engine flue gas. Obviously, the equivalent oxidiser-to-fuel ratio depends on the oxygen content of the engine flue gas. Assuming complete combustion of FPBO in the burner and a lean oxidiser/fuel mixture, the balance of energy before and after combustion requires: where Hl is the lower heating value of FPBO. In a lean mixture, the equivalent oxidiser-to-fuel ratio is greater than unity (λ ≥ 1). When a mixture of air and engine exhaust gas is used as an oxidiser, then we have: and the balance of energy leads to: In a rich mixture of oxidiser/fuel (λ < 1), however, the available oxidiser amount determines the combustion rate, and the balance of energy before and after combustion requires: Selective Catalytic Reduction Figure 6 depicts an SCR unit with its injection device. The SCR gas treatment will require urea/ammonia as its reducing agent. A complete control-oriented model of the SCR system includes the dynamics of the urea solution injection device, the decomposition (hydrolysis) of water-urea solution into gaseous ammonia and CO2, the reducing chemical reactions, and the dynamics of the NOx/NH3 sensor. A first-order low-pass filter could represent the dynamics of the urea injection device. One can identify the parameters of such a model from experiments. The NOx/NH3 sensor dynamics depend on the sensor's type and quality. An ideal perfect NOx sensor gives a direct and accurate measurement of NOx. An actual sensor measurement, however, may be corrupted by crosssensitivity to NH3. The output of the such sensor may require some filtering before it is used for control design.
The assumptions for the control-oriented model of hydrolysis reactor are the following: • The water-urea mixture is at ambient temperature before injection and will be heated up to the temperature of the hydrolysis reactor after injection (perfect mixing).

US injector
• The flue gas temperature out of the hydrolysis section is the same as that of the hydrolysis reactor (lumped parameter). • No heat losses to the ambient are considered as these are included in the thermal model of SCR cells. Figure 7 shows the hydrolysis reactor's mass and heat flow in/within/out. The ODE for the temperature inside the reactor (TH) is: is the thermal capacity of the hydrolysis reactor considering specific heat capacity p,H and mass H .
Q̇E G−US is the heat transferred from flue gas to urea solution. This heat is consumed for water boiling, vaporising, and heating of water/urea vapour to the temperature of hydrolysis reactor.
where , , and , , are specific heat capacity of liquid water and water vapour, respectively, , is specific heat capacity of urea, and , is specific heat of water vaporisation.
where denotes urea concentration in the water-urea mixture. The molar flow of NH3 into the SCR cell is calculated statically as a function of urea solution mass injected: SCR is a continuous system in which the concentration of its species (NH3 and NOx) changes continuously along its length. However, for its control-oriented modelling, the SCR unit is usually discretised into 2 or 3 cells; inside each cell, the concentrations can be assumed homogeneous. This approximation is a control-oriented practice and might not be regarded proper for other applications. The main dynamics of an SCR cell relate to its reducing chemical reactions. Figure  8 shows a control-oriented representation of an SCR cell and its inputs-outputs. The chemical reactions included in this representation are adsorption and desorption of ammonia on the catalyst's surface, the fast SCR reaction using equimolar amounts of NO and NO2, the main SCR reaction, and the oxidation of adsorbed ammonia from the surface of the catalyst.
The reaction for adsorption and desorption of ammonia on the catalyst reads: The forward reaction rate of adsorption (rads) is proportional to gaseous ammonia concentration (cNH3) and the remaining capacity for adsorption (1 − θNH3) on the catalyst surface: The backward reaction rate of desorption (rdes) is proportional to the used capacity for adsorption: where 3 is the scaled surface coverage with ammonia, cS -the concentration of active surface atoms per gas volume, SC − the area of one mole of active surface atoms, αpr − the sticking probability, MNH3 − the molar mass of ammonia, kdes − pre-exponential factor desorption, and Ea,des is the activation energy of desorption.
The fast SCR reaction (SCR1) using equimolar amounts of NO and NO2 reads:

SCR cell ṁg,in ṅNO,in
Tg,out = TSCR Tg,in Its rate is proportional to the available adsorbed ammonia and the minimum of NO and NO2 concentrations: where kSCR1 is the pre-exponential factor, and Ea,SCR1 is the activation energy of SCR1. The main SCR reaction (SCR2) with NO only reads: The rate of reaction is proportional to the available adsorbed ammonia and the minimum of NO and O2 concentrations: where kSCR2 is the pre-exponential factor, and Ea,SCR2 is the activation energy of SCR2. The oxidation of adsorbed ammonia reads: where kox is the pre-exponential oxidation factor, and Ea,ox is the activation energy of oxidation. Note that in lean conditions, where enough oxygen is available, only NO and NH3 concentrations become important for calculating rSCR2 and rox. All the reaction rates are given in [ 3 ]. The concentration of gases in the SCR may not be uniformly distributed. Therefore, their dynamics should be expressed by partial differential equations. However, suppose the SCR is divided into a few cells arranged in series. In that case, uniform gas concentration distribution and homogeneous temperature in each cell is a justifiable (lumped parameter) assumption for an acceptable approximation of the dynamics. With this approximation, a set of ODEs can represent the dynamics in each cell.
The ODE for the concentration of ammonia reads: where = is the volume of each cell, as SCR volume Vc is divided into ncell cells, and ̇ is the flue gas volume flow out of the SCR cell. The first term on the right-hand side of this ODE is the rate of ammonia concentration change by the ammonia inflow, the second term is the rate of concentration change because of gas outflow, and the last two terms are the rate of adsorption and desorption, respectively. The volume flow rate is: where pamb denotes ambient pressure.
Similarly, the ODE for NO concentration is: and the ODE for the concentration of NO2 reads: One can express the dynamics of adsorbed ammonia on the catalyst surface by: Considering the SCR cell and its housing as a thermal reservoir, its temperature dynamics can be expressed by: where cell = p,SCR cell is the thermal capacity of SCR cell, with specific heat capacity p,SCR and mass cell = (SCR mass divided by the number of cells). The heat radiated and transported by convection from the SCR cell to its ambient is: where SCR,rad/conv and SCR,rad/conv are the coefficient and surface area for heat transfer by radiation/convection. The molar flow of the gas out of the SCR cell is calculated as a function of the cell state variables: where i is the index for species NH3, NO, and NO2. The following assumptions have contributed to the simplification of the SCR dynamic model: • The urea decomposition is fast and occurs completely before entering the first SCR cell. Therefore, the molar flow of ammonia into the first SCR cell is a static function of molar urea injection. • Reaction enthalpies and their thermal effects are neglected.
• More simplifications of the SCR model derive from only considering NOx and ammonia concentrations in their steady state. This assumption is acceptable because their dynamics are much faster than the dynamics of thermal energy storage and NH3 adsorption on the catalyst's surface [8].

Engine speed control
For parameter optimisation of the engine model, an adaptive PI controller with the structure shown in Figure 9 simulates the performance of the engine speed governor. This controller estimates the change in electrical load on the diesel engine and regulates the fuel injection accordingly.  Boiler air/fuel ratio and flue gas temperature control As a defined operating condition, the boiler flue gas temperature should be kept between 230−550 °C to minimise harm to the downstream cleaning system. Figure 10 shows a control strategy for the temperature of boiler flue gas, formulated based on the dynamic model described in the previous section. This strategy exploits switching between feed-forward (FF) control of oxidiser-to-fuel ratio and feedback control of boiler flue gas temperature. The FF controller regulates the fuel rate to keep the oxidiser-to-fuel ratio constant at a predefined reference value to ensure optimal combustion of FPBO in the combustor and better fuel efficiency. However, when the flue gas temperature exceeds/falls below the maximum/minimum temperature allowed, the PI controller decreases/increases the fuel rate to push the temperature back to its acceptable interval. This feedback action will compensate for the oxidiser-to-fuel ratio from its reference value. In the simulations presented in this paper, the feedback controller is switched off, and only the oxidiserto-fuel ratio is controlled because the experimental setting used to tune burner parameters is air ratio-controlled only. Figure 10. Structure of control strategy for boiler flue gas temperature and oxidiser-to-fuel ratio

Selective catalytic reduction control
One can use both feed-forward and feedback controllers for optimal NOx removal. Figure  11 shows the structure of a feed-forward control strategy is shown in. In this control design, the molar flow of NOx is estimated as a function of upstream plants (engine + boiler) operating point. For example, NOx formation for the engine is a function of engine torque and rotational speed. NOx formation for the burner is a function of flue gas temperature entering the burner and its oxygen content. The controller calculates the amount of urea solution injection for the estimated NOx molar flow. Figure 11. Structure of control strategy for NOx removal by SCR

PARAMETER TUNING
As the SmartCHP plant is under construction and experimental validation of its model is not possible at this stage, data from individual components are the basis for tuning their parameters. For parameter tuning, we have formulated nonlinear regression models to minimise the error between predictions by the model and the available experimental data.
The parameters of the diesel engine model are tuned to steady state measurements of compressor mass flow, flue gas oxygen, turbo pressure, and after-turbine flue gas temperature from an experimental diesel engine running on FPBO blend with methanol [39]. For more on the experimental setup, refer to [40]. The engine runs at different load steps (4−17−27−37−47 kWe) with a constant engine speed of 1500 rpm. Figure 12 compares engine measurements with model predictions. For the DPF backpressure model, the data in [13] are used where experimental measurements of volume flow rates of exhaust gas, particulate mass, and inlet exhaust temperatures are available. For OC model parameter tuning and estimation of its effect on NO/NO2 ratio, the data in [41] and [42] are used. In the experiments, an OC unit is mounted for after-treatment of exhaust gas from a 4-stroke, 4-cylinder diesel engine. The experimental setup was equipped with a non-dispersive ultraviolet analyser to measure nitric oxide (NO) and nitrogen dioxide (NO2) separately.
The data used for SCR parameter tuning are from Kwak et al. [43], where model Cu/zeolite catalysts were experimentally investigated, and their NOx reduction performance at different SCR temperatures was recorded. Figure 13b compares NOx reduction performance by the SCR model and those reported by Kwak et al. [43]. The mean absolute percentage error is 5.9%. The figure also shows NH3 reduction percentages predicted by the model.

RESULTS
In this section, first, we show how power and heat generation are nonlinearly coupled. Then the simulation results and the controllers' evaluation are given for power-led mode. Some more common operating modes of micro-CHPs are power-led, heat-led, or economy modes. In a powerled mode, there is one degree of freedom, and that is to follow the power demand profile. In a heat-led mode, priority is given to fulfilling the heat demand; however, SmartCHP has a nonlinear power and heat generation coupling. An optimisation problem needs to be formulated to follow the heat demand and then, with the remaining degree of freedom, to follow power demand, minimise emissions, or maximise efficiencies. In an economy mode, priority is given to cost minimisation, profit maximisation, minimum emissions, or maximum efficiency. Neither heat demand nor power demand will be followed completely. Problem formulations for heat-led and economy modes and their solution methods are beyond the scope of this paper. They are further steps towards implementing a smart control unit for the cogeneration unit. Future research will address the mentioned optimisation problems.

Nonlinear heat and power coupling
From equation (36), the fuel mass flow that can be injected into the burner/boiler is: The heat generated from the boiler is: The heat input by engine flue gas into the boiler is: where is the share of heat exhausted from the engine in flue gas, parameterised in (26). Useful heat from flue gas from boiler and CHP engine reads: where ℎ1 is the thermal efficiency of heat recovery from the exhaust gas, and is the heat loss coefficient from the boiler burner box and combustion chamber. Useful heat recovered by the engine coolant is: where ℎ2 is the thermal efficiency of heat recovery by the engine coolant. Total useful heat is: ̇=̇, +̇, (99) Figure 14 shows total useful heat generation and heat generation from the operation of individual components, i.e., engine and boiler, as functions of engine power. Heat generation from the boiler can be controlled by adjusting the boiler oxidiser-to-fuel ratio ( ) in a feasible range 1.05−2.85 where minimum = 1.05 gives maximum boiler heat generation. This plot suggests that heat and power generation will not completely be decoupled in the SmartCHP concept. At engine power of around 10−15 kW, maximum heat generation becomes possible. Every point in the blue highlighted area is possible for power/heat generation. This plot shows that the feasible operation region area of the SmartCHP system is considerably larger (i.e., more than 100%) than that of the CHP engine. Hence, there is a certain degree of freedom for heat generation at all the engine operating points, which can be exploited for optimisation when the plant is operated in heat-led mode.

Simulation in power-led operation mode
In this section, the response of the SmartCHP plant to fluctuating load demand is predicted, i.e., in power-led mode. The primary driving parameter in simulations is the electrical load on the modified diesel engine. In the simulated scenario, the load demand profile is based on promising use cases (e.g., hospitals) for SmartCHP in connection with the market assessment [44]. The load on the diesel engine starts with a minimum of 12 kW for 5 h, then ramps up to 40 kW in one hour, and in the next 14 h, it slowly decreases to 15 kW and stays there for the rest of the day. It is assumed that heat demand is constant at 58 kW for all the hours. Simulations will show at which hours the heat from the CHP engine is not enough to respond to this heat demand thereby, and the boiler should generate extra heat. Conversely, there will be times when the heat from the CHP engine exceeds heat demand; thereby boiler should be off. We adjust system time constants for a reasonable simulation run time so that every hour shrinks to 200 s of simulation time.
Flexibility, low emission and high fuel efficiency at all power levels are the motivations for SmartCHP. Therefore, in this section, predictive simulations show the results of heat-to-power ratio, energy production, energy efficiencies, and NOx emissions. Moreover, the performance of the controllers is evaluated. The formation of NOx and the performance of SCR in reducing this pollutant are depicted. Dynamics of pressure, temperature, mass flow, and oxygen content of flue gas at different plant sections are also shown.
As the engine load in Figure 15a increases, more heat becomes available through the engine jacket and its flue gas heat recovery. When engine load decreases, the temperature of its flue gas drops but its oxygen content increases. This trend allows the boiler to bear more heat load, thereby maintaining the response to the high heat demand. In this mode of operation, the plant offers a wide range of heat-to-power ratios, as shown in Figure 15a. One can derive plant machine utilisation rates from these figures. Figure 15b shows the performance of the preliminary controllers. Engine governor design allows for satisfactory constant speed control. The burner oxidiser-to-fuel ratio controller is a feedforward type that uses estimated values of engine flue gas temperature and composition (mass flow and oxygen content) for regulating fuel injection. This controller reaction may fall behind engine flue gas changes at high engine transient. Nevertheless, the controller shows a good performance in reference tracking. Figure 15b depicts the inverse of oxidiser-to-fuel ratio (i.e., fuel ratio); when it is zero, it means the boiler is off. One can perform the efficiency analysis using energy or exergy concepts [45]. Figure 16a presents the energy efficiencies calculated as the ratio of output useful energy to input energy of FPBO with a low heating value (LHV) of 16.9 MJ/kg [46]. The assumptions are the following: • thermal efficiency of heat recovery from engine cylinder by the coolant is 60%, • thermal loss from the boiler combustion chamber and burner box is 2%, • 40% of flue gas heat is consumed for water heating in the boiler while the rest goes to the cleaning system; this number depends on tubes sizes in the boiler heat exchanger, • thermal efficiency of heat recovery from exhaust gas downstream of SCR is 95%. The efficiency of electricity generation can increase to 33% at full load, but at low engine load, the fuel efficiency of electricity generation is low. The simulations after a time of 50 s show that plant can maintain overall fuel efficiency of at least 80% at both low and high engine loads. Boiler energy efficiency also remains high at different engine loads. Note that engine flue gas enthalpy is an energy input to the boiler system, and the assumption for the calculation of boiler energy efficiency is that a high-efficiency heat recovery system is in place downstream of the boiler to recover heat from the boiler exhaust gas. Moreover, boiler energy efficiency at engine transients might hit higher efficiencies than 98% because a large heat capacity of the boiler heat exchanger can, for a short while, keep providing input energy to heating water after transient of engine flue gas. Notably, final efficiency analysis of the cogeneration plant is possible when realistic heat-recovery efficiencies are provided and input parameters are optimised (see, for example, [47]). Figure 16b depicts the formation of NOx in the engine flue gas and boiler flue gas. Most of the NOx is due to engine operation, while the boiler has a minor contribution. At high engine loads, NOx formation can reach above 3000 ppm.
The evolution of flue gas temperature at different sections of the plant is shown in Figure  17a. For an electrical load change from 12 kW to 45 kW, the flue gas temperature at engine exhaust (p3eng) and tailpipe reservoir R4 (before entering the boiler burner) increases from 300 to 530 o C. However, flue gas temperature at boiler exhaust pipe undergoes an opposite trend, with less amplitude of fluctuations (250−340 o C). When the boiler is off (between hours 5−13), the big gap between the temperature of flue gas at the engine outlet and the boiler outlet indicates the heat release to water in the boiler exchanger. After hour 13, the boiler is on again to cover the heat demand and its flue gas temperature rises. Figure 17b shows how flue gas pressure increases as diesel engine load increases. Spatially, the pressure decreases as the flue gas goes through the boiler and finds its way through the cleaning system. Every part of the cleaning system acts as a flow restriction and might contribute to pressure drop. Diesel particulate filter, due to soot accumulation, is a component causing a significant portion of this pressure drop. As engine load increases/decreases, its oxygen content drops/goes high (Figure 18a). Mass flow rate is also almost proportional to engine load (Figure 18b). The increment of boiler mass flow out relative to engine mass flow out is the extra FPBO injected into the burner. The mass of urea solution injected upstream of SCR is the difference between boiler and SCR outflows. The flue gas boiler's response to the oxygen content change also depends on heat demand. When there is enough oxygen and some heat is needed, the boiler will use the available oxygen to generate more heat; otherwise, it remains off. The performance of SCR NOx reduction with a feed-forward controller is illustrated in Figure 19a and Figure 19b. Here the SCR plant is modelled by two SCR cells. A step change in the estimated NOx excites the controller to increase urea injection. Two scenarios consider the effect of SCR temperature on NOx reduction. In the first scenario, shown in Figure 19a, 40% of flue gas heat is consumed for boiler water heating. As a result, the SCR temperature stays above 220 o C. The controller can keep NOx emission low (below 500 ppm), especially in steady state operation, but in fast transients (time slot between hours 5 and 6), there is a peak in NOx leak downstream SCR. Here, controller performance needs improvement, for instance, by adding a feedback component to respond to a sudden increase in NOx formation. Further controller design optimisation will be pursued when experimental data from the developed cleaning system of SmartCHP become available.
In the second scenario, shown in Figure 19a, 60% of flue gas heat is consumed for boiler water heating which leads to cooler SCR temperature (below 230 o C). Here, a cool converter severely degrades the performance of NOx reduction. The degraded performance of SCR in cool temperatures below 230 o C agrees with data published in the literature, e.g., see Figure 13b. This scenario points to a potential design issue normally addressed in the design phase of the boiler heat exchanger. Nonetheless, one must avoid such a cool SCR situation during normal plant operation to keep emissions within limits.
(a) (b) Figure 19. NOx reduction performance when water heating in the boiler consumes, of the flue gas heat: 40% (a); 60% (b)

CONCLUSIONS
A control-oriented dynamic model of a newly designed cogeneration plant fuelled with fast-pyrolysis bio-oil was presented. The cogeneration plant includes a modified diesel engine operating on FPBO, a newly designed flue gas burner that oxidises FPBO only with the oxygen content of engine flue gas, and a dedicated flue gas treatment system to remove CO, HC, and NOx. According to the literature review of the existing dynamic models, no dynamic model could be directly used or fit for predictive simulation of this plant. Furthermore, FPBO is the new fuel for diesel engines and swirl burners, and the hybrid operation of the engine and boiler implies a semi-decoupled cogeneration concept. These aspects have necessitated new dynamic modelling at both the components and system levels. The plant model also integrates dynamic models of heat exchangers, condensers, tailpipe gas reservoirs, and injection devices. Predictive simulations show the potential of this plant for flexible heat/power ratio generation and its potential to respond to energy demands for a wide range of engine loads while maintaining overall energy efficiency above 85%. The performance of the control design was evaluated on the component level through dynamic simulations. Results showed the need for an advanced cleaning system control design when fast transients cause a sudden increase in NOx formation. Control design should also address keeping SCR temperature at a certain range to ensure maximum NOx reduction.
The industrial application of the proposed plant model can be in three areas. A dynamic model can be used to evaluate the operating conditions of the components at different operating modes and to find optimal working conditions. The proposed model is a tool to perform predictive simulations, evaluate component controllers' performance, and identify areas where advanced controllers are needed. The dynamic model generates input parameters, i.e., the plant's machines' utilisation rates, efficiencies, and emissions in response to a user load profile and usage preferences which are input parameters for energy cost models and feasibility studies.
The current integrated system model is based on the integration of individual models of system components, validated individually. However, validation of the system model with data from the integrated plant is yet to be performed when a prototype of the integrated system is completed and the operation data become available. The simulation results are presented only for the power-led operating mode. Based on the proposed dynamic model, formulation of optimisation problems and their solution methods to derive the best working points in heat-led and economy modes remain for future research.

ACKNOWLEDGMENTS
The SmartCHP project has received funding from the European Union's Horizon 2020 Research and Innovation Programme under Grant Agreement No. 815259. The authors would like to thank the SmartCHP project partners for the interesting discussions and provision of experimental data.