Carbon-Energy Impact Analysis of Heavy Residue Gasiﬁcation Plant Integration into Oil Reﬁnery

: A gasiﬁcation plant may partially replace an industrial thermal plant and hydrogen production plant by polygenerating valuable products (hydrogen, power, steam) from low-value materials. Carbon energy analysis is one way of conceptually evaluating such processes. In this paper, the integration of a heavy residue (HR) gasiﬁcation plant into a mid-size oil reﬁnery (5 million t per year crude processing rate) is conceptually assessed via the comparison of electricity, natural gas and heavy residue consumption, and CO 2 emissions. The main purpose of the integration is to reduce the consumption of natural gas currently used for hydrogen production at the expense of increased HR consumption and to achieve a reduction in CO 2 emissions. Two case studies with different modes of operation were compared to base case showing that annual reduction of 2280 GWh in natural gas consumption with constant heat and hydrogen production is possible, accompanied with a slight increase in electricity purchase by 28 GWh per year. HR processing in the reﬁnery increases by over 2800 GWh per year. The reﬁnery’s CO 2 emissions increase by more than 20% (up to 350 kt per year) as a result, while, after incorporating external emissions into the balance, a decrease of more than 460 kt CO 2 per year can be achieved. This conﬁrms that the integration of gasiﬁcation plants within industrial enterprises and clusters has a positive environmental and energy impact and supports the idea of converting low-value material to more valuable products in polygeneration plants. The economics of HR gasiﬁer integration in varying operations under real reﬁnery conditions remain to be explored.


Introduction
Modern society is characterized by rapidly increasing crude oil consumption. According to British Petroleum, the consumption of crude oil increased three times (from 30,840 kilo barrels per day to roughly 95,000 kilo barrels per day) from 1965 up to the present day [1]. The processing of such huge amounts of feedstock yields substantial shares of low-valuable by-products. Actual trends in the refining and petrochemical industry are based on searching for suitable solutions to utilize every oil product, especially those with lower value that are often called "bottom of the barrel" [2].

General Principles
Heavy residues (HRs) are by-products of crude oil processing, consisting of large hydrocarbon molecules with heteroatoms embedded in their structure [2]. Due to the stepwise processing of oil, HR also contains a notable volume of heavy metals [3]. Thanks to its composition, HR is a very viscous liquid that is able to flow at temperatures above 150 • C [4]. It is difficult to upgrade it with conventional methods and, thus, it is used as low-price ship fuel or fuel for steam and power plants.
Gasification is one of the promising alternatives for the valorization of low-value by-products to increase their market value [5]. This process can be characterized as the version of liquid and solid by-products and wastes into syngas [6], utilized as a sour hydrogen [7,8]. It is a controlled exothermic reaction of feedstock with suitable gasif reagents, e.g., air, steam, and oxygen [9,10], consisting of several interconnected steps as vaporization, pyrolysis, atomization, and chemical fission [11]. Any hydrocarbon-b material can be processed in this way: coal [12,13], tires [14], biomass [15], or plastic terials and wastes [16,17]. The design of a gasification plant depends on processed stock, but usually, such a plant consists of a gasifying reactor, syngas-treating section an energy-utilizing section [18]. There are many types of gasifying reactors-fluid bed, entrained-flow, and fixed-bed reactors-and their use depends on processed stock [19]. An entrained-flow reactor is usually used to process HR [20]. This type of tor can be described as a tubular reactor with a feedstock disperser and gasifying reag inlet on one side and syngas and unreacted fractions discharge on the other.
Because gasification is an exothermic process, a large amount of technically u energy is released and can be used for cogeneration purposes [18]. Syngas compos depends on the HR composition and gasifying reagents ratio. In most cases, the la share is represented by hydrogen and carbon monoxide; other components are ca dioxide, methane, steam, hydrogen sulfide, and nitrogen [7,[21][22][23][24], while minor shar ammonia, gaseous hydrocarbons (ethane, propane, butane), carbonyl-sulfide, and o products of radical reactions can also be observed [3]. The solid phase formed in this cess is mainly composed of heavy metals, soot, and tar, which are entrained by high-s flowing syngas. Therefore, the most important and necessary syngas-treating step clude solid particle separation, cooling, acid gas separation, and the separation of hy gen [7,25]. Common means of acid gas (mainly hydrogen sulfide) separation include absorption into amine or hydroxide solution [26,27], while scrubbed sulfur can be re ered using the Claus process [7]. Hydrogen separation requires the inclusion of memb separation [28], cryogenic separation, or pressure swing adsorption [7,29], which is m used thanks to the high purity of the final product and acceptable energy-economic ditions [30].
Standalone gasification plant projects face multiple problems with legislation, s acceptance, and extra capital investment and operation costs to process all by-prod and wastes (for example, wastewaters) following environmental standards [31,32]. O contrary, a gasification plant integrated into an existing enterprise, such as an oil refi offers existing infrastructure [18], and can positively affect the operation of the enter in terms of energy, economy, and environmental aspects [33] while bringing sustain solutions to techno-legislative problems [34]. Figure 1 shows the position of a heavy due gasification plant (HRGP) integrated into the oil refinery.

State of the Art
There are multiple studies dealing with the techno-economic or exergy-economic impact of an integrated gasification combined cycle (IGCC) into an existing enterprise, mostly dedicated to biomass, coal, and plastic waste processing.
Ma et al. [35] analyzed the biomass-to-hydrogen process with/without carbon capture and storage (CCS) in terms of energy consumption and efficiency, environmental performance, and techno-economic aspects, but the integration of the process was not analyzed. Al-Rowaili et al. [36] compared methanol production via conventional steam reforming and vacuum residue gasification by the simulation of both processes, stating that gasification is more energy efficient and consumes less energy than steam reforming. IGCC integration into an oil refinery was assumed in this study, but a comparison of the operation before and after the integration was not performed. Sato et al. [37] analyzed the technical and economic aspects of an integrated coke gasifier into a Brazilian oil refinery, but they only evaluated the economic impact. They compared different scenarios of raw material and electricity prices and predicted simple payback periods varying between 7 and 10 years. Berghout et al. [38] analyzed different ways to reduce greenhouse gas emissions in an existing oil refinery (with an already-integrated HR gasifier), as well as in terms of economic benefit. According to the researchers, the most cost-effective pathway is biomass gasification with CCS.
There are several studies that compare and/or analyze IGCC vs. IGCC in combination with another technology to reach higher product qualities. A typical example of such a combination is IGCC coupled with the steam reforming of natural gas, as analyzed by Ahmed et al. [39] and Al-Qadri et al. [40]. Ahmed et al. [39] compared two cases: case 1 represented the integrated entrained-flow gasifier of law rank coal; case 2 was represented by the same type of gasifier coupled with natural gas steam reforming. Al-Qadri et al. [40] simulated and compared the same cases as Ahmed et al. while using waste tires as gasifier feed. In both studies, higher and more efficient hydrogen production was obtained in case 2 according to the techno-economy analysis; the considerable economic benefits of case 2 were also pointed out.
Other studies optimized types and purities of the gasifying agents used in IGCC or IGCC coupled with additional technology to achieve more energy-efficient production. For example, Yeoh and Hui [41] optimized an air separation unit, analyzing and comparing the most favorable oxygen concentration in air. They showed that the gasification of coal is most thermally efficient at an oxygen concentration of 45.5%. Santiago et al. [42] compared the influence of the amount of two different gasifying agents (oxygen and air-steam mixture) on syngas quality, while the syngas produced from oil sludge was combusted in a gas micro-turbine. They showed that oxygen gasification is a more energy-efficient and environmentally friendly syngas and power production method.
The current trend is either to develop new technologies or to find new suitable combinations of known technologies to increase green electricity production and to reduce CO 2 emissions. Won et al. [43] identified the optimal configuration of renewable energy sources coupled with biomass gasification. To achieve lower CO 2 emissions, different methods of carbon capture and storage have been explored. Khan et al. [44] assessed the operation economics of a biomass-fed fluidized-bed gasifier with an integrated catalytic CO 2 adsorber.
As documented by the literature review, many studies analyze and optimize IGCC on its own or find the most suitable conditions for gasification. Other papers deal with biomass or waste gasification. Many studies discuss coupling gasification with other technologies to produce higher-quality products or achieve a more environmentally friendly means of production. On the other hand, how the considered technologies are compared also varies. There are studies analyzing only economic, energetic, or environmental impacts, while others, based on estimation and mathematical modeling, strive to optimize key operation factors to achieve more efficient processes. This highlights the need for a deeper understanding of gasifier integration synergy in a suitable enterprise. This computational study aims to fill this knowledge gap by assessing the energy and CO 2 emissions of the integration of a heavy residue gasification plant (HRGP) into an existing oil refinery. The operation synergies and impact on key refinery production units are estimated and discussed, i.e., an industrial thermal power plant (TPP) and a hydrogen production plant (HPP). The operation features before and after the HRGP integration are compared, focusing on hydrogen and steam production, the consumption of HR and natural gas (NG), HR export outside of the refinery, and electric energy purchase. The amount of CO 2 emissions released in both operation states is also evaluated, pointing out the differences in possible approaches. The approach used is generally valid, and it can help decision making in practice and industry management.

Considered System Layout and Feedstock Properties
To design a plant for hydrogen production via heavy residue gasification, studies by Blažek and Rábl [7], Meratizaman et al. [18], Furimsky [20], and Corella and Sanz [25] were considered. Figure 2 shows the HRGP flow chart used in this paper with key streams and equipment designed by our team in a preliminary study [45]. impacts, while others, based on estimation and mathematical modeling, strive to optimize key operation factors to achieve more efficient processes. This highlights the need for a deeper understanding of gasifier integration synergy in a suitable enterprise. This computational study aims to fill this knowledge gap by assessing the energy and CO2 emissions of the integration of a heavy residue gasification plant (HRGP) into an existing oil refinery. The operation synergies and impact on key refinery production units are estimated and discussed, i.e., an industrial thermal power plant (TPP) and a hydrogen production plant (HPP). The operation features before and after the HRGP integration are compared, focusing on hydrogen and steam production, the consumption of HR and natural gas (NG), HR export outside of the refinery, and electric energy purchase. The amount of CO2 emissions released in both operation states is also evaluated, pointing out the differences in possible approaches. The approach used is generally valid, and it can help decision making in practice and industry management.
The properties of HR are closely related to those of crude oil. To model the gasifier, the composition and lower heating value (LHV) of HR are required. The typical elementary compositions of HR are presented in Table 1, as reported in the literature. Sulfur is the most variable element, as shown in Table 1. Its content also depends on the crude oil processing method [3,7]. The reaction of sulfur with hydrogen produces hydrogen sulfide, which has acidic properties and could have a corrosive effect on some equipment [48]. Table 2 shows the HR composition and LHV applied in gasifier modeling.

Mass and Energy Balance of the Gasifier
According to Furimsky [20], the entrained-flow reactor is most commonly used to process HR by gasification; thus, this type of reactor was chosen for this study. For its mathematical description, a kinetic model was selected [19]. High-pressure superheated steam and compressed oxygen (with 95 vol.% purity) were chosen as suitable gasifying agents. The mass ratio was set to m R2 : m O2 : m S2 = 1 : 1.1 : 0.35 according to Blažek and Rábl [7].
The literature review provided several chemical reactions that describe pathways of the complex multistep process of gasification [7,20]. The chemical reactions used in this paper are presented in Equations (1)-(5); their stoichiometry was calculated using HR composition from Table 2.
Equations (1) and (2) represent partial oxidation reactions and Equations (3) and (4) represent equilibrium reactions. "CH 1.54 " in Equations (1) and (2) represents the summary formula based on the elementary composition of HR shown in Table 2 and expresses moles of hydrogen per mole of carbon. The temperature dependence of the reaction rates used in Equations (3) and (5) was calculated via Equations (6) and (7) [24,49], and the temperature dependence of the equilibrium constants was calculated via Equations (8) and (9) [4,49].
In the case of nitrogen, which is also present in HR, the conversion from atomic to molecular was assumed. The production of nitrogen oxides via high temperature can be neglected [3]. The main syngas components, the concentration of which was calculated, are hydrogen, carbon monoxide, carbon dioxide, steam, nitrogen, sulfur hydroxide, and methane. For the numerical solution of this reactor model, the following assumptions were implemented:

•
The reactor can be balanced as a CSTR (continuously stirred tank reactor) [50] with the perfect dispersion of inlet HR. The mass balances of each syngas component and the total heat balance of the reactor are presented in Equations (10) and (11). • Syngas behaves as an ideal gas.
where index "i" stands for the syngas component and index "j" stands for reaction (3) or (4). Symbol "*" stands for the molar flow incurred in reactions (1) and (2).
The solid phase leaving the reactor is neglected in Equation (11) because of its negligible mass flow.

Mass and Energy Balance of other Equipment
In terms of the results from Figure 1, the calculation of every unit of the plant is needed to determine the mass flows and compositions of the final products and the total energy balance of the plant. The mass and enthalpy balance Equations (A1)-(A25) used in HRGP design are presented in Appendix A; the necessary parameters for the design of the whole HRGP are also provided.

Oil Refinery Balance
A typical oil refinery consists of several sub-plants that process different fractions and produce the required products. In this paper, the following oil refinery components were relevant to the conducted analysis: thermal power plant, hydrogen production plant, central steam network, and hydrogen network. Figure 3 shows a simplified refinery layout before and after the integration of the HR gasification plant.
In the case of nitrogen, which is also present in HR, the conversion from atomic to molecular was assumed. The production of nitrogen oxides via high temperature can be neglected [3]. The main syngas components, the concentration of which was calculated, are hydrogen, carbon monoxide, carbon dioxide, steam, nitrogen, sulfur hydroxide, and methane.
For the numerical solution of this reactor model, the following assumptions were implemented: • In reactions (1) and (2), carbon is converted completely.

•
The reactor can be balanced as a CSTR (continuously stirred tank reactor) [50] with the perfect dispersion of inlet HR. The mass balances of each syngas component and the total heat balance of the reactor are presented in Equations (10) and (11). • Syngas behaves as an ideal gas.
where index "i" stands for the syngas component and index "j" stands for reaction (3) or (4). Symbol "*" stands for the molar flow incurred in reactions (1) and (2).
The solid phase leaving the reactor is neglected in Equation (11) because of its negligible mass flow.

Mass and Energy Balance of other Equipment
In terms of the results from Figure 1, the calculation of every unit of the plant is needed to determine the mass flows and compositions of the final products and the total energy balance of the plant. The mass and enthalpy balance Equations (A1)-(A25) used in HRGP design are presented in Appendix A; the necessary parameters for the design of the whole HRGP are also provided.

Oil Refinery Balance
A typical oil refinery consists of several sub-plants that process different fractions and produce the required products. In this paper, the following oil refinery components were relevant to the conducted analysis: thermal power plant, hydrogen production plant, central steam network, and hydrogen network. Figure 3 shows a simplified refinery layout before and after the integration of the HR gasification plant. To analyze the refinery operations before and after HRPG integration, the following factors were compared:

•
The consumption of HR in TPP and HRGP; • The export of HR; • The consumption of natural gas (NG); • Steam and hydrogen production; • The production, consumption, and purchase of electricity; The energy assessment is based on the mass and enthalpy balances of each refinery component presented in Figure 2. The calculation premises include an HRGP feed of 60 t/h of HR and estimates of the above factors for a mid-sized oil refinery (Tables 3-5). Table 3. Assumptions applied to refinery balance.

Parameter Value Unit
Total consumption of electricity 120 MW Total amount of HR available 70 t/h Summer operation duration 5000 h Winter operation duration 3000 h Table 4. Assumptions applied to HPP (hydrogen production plant) balance.

Parameter Value Unit
Designed hydrogen production 3.5 t/h Consumption of natural gas 1 4.5 .
In the range of 50 to 100% designed hydrogen production; obtained by non-published data analysis of a real HPP. Table 5. Assumptions applied to TPP; parameters and relations based on unpublished data from a real industrial TPP and study [51].

Parameter Value Unit
Heat efficiency of steam production 0.

MW
To ensure both reliable and economical hydrogen production, the existence of two smaller HPPs was considered instead of a single larger one. Table 4 shows the assumed design and operation parameters of one such HPP.
Further assumptions need to be introduced to balance the TPP. Figure 4 shows a simplified TPP steam-flow diagram for winter and summer regimes of operation.  To analyze the refinery operations before and after HRPG integration, the following factors were compared: • The consumption of HR in TPP and HRGP; • The export of HR; • The consumption of natural gas (NG); • Steam and hydrogen production; • The production, consumption, and purchase of electricity; The energy assessment is based on the mass and enthalpy balances of each refinery component presented in Figure 2. The calculation premises include an HRGP feed of 60 t/h of HR and estimates of the above factors for a mid-sized oil refinery (Tables 3-5). To ensure both reliable and economical hydrogen production, the existence of two smaller HPPs was considered instead of a single larger one. Table 4 shows the assumed design and operation parameters of one such HPP. Further assumptions need to be introduced to balance the TPP. Figure 4 shows a simplified TPP steam-flow diagram for winter and summer regimes of operation. The difference in the steam amount between the "steam for export" and "steam export" streams represents the consumption of steam in the TPP, with the mass flow of The difference in the steam amount between the "steam for export" and "steam export" streams represents the consumption of steam in the TPP, with the mass flow of condensate considered invariant of season. Mathematical relations describing the TPP operation are shown in Table 5. Offgas obtained by hydrogen separation via PSA is a notable by-product. It is assumed that, due to its sufficient LHV, it can be used as additional fuel in the TPP with constant steam production heat efficiency (Figure 3).
HR gasification requires oxygen with high purity (above 95% vol.). Electricity consumption for oxygen separation is calculated as 0.35 . m O2 [MW] [52]. The last of the above-presented factors is the comparison of CO 2 emissions; the CO 2 emission factors used in the analysis are presented in Table 6.  Table 2 Natural gas 2.75 t/t Considered as pure methane Electricity 0.102 t/MWh Reference [53] The HR emission factor is based on its elementary composition shown in Table 2 calculated as tons of CO 2 produced by total combustion with pure oxygen per one ton of HR. The NG emission factor is calculated as tons of CO 2 produced by the total combustion of pure methane with pure oxygen per one ton of NG.

Case Study
To analyze the impact of integration, the current (base) state has to be defined, and the definition of each state after integration are as follows: A.
Current state: The total amount of available HR is split between its consumption in the TPP and export outside the refinery. Hydrogen is produced in HPPs, both of which are operated at full load. B.
New state: A significant amount of HR is processed via gasification; the rest is split between its consumption in the TPP and export outside of the refinery. The total amount of produced hydrogen is the same as in case A; a part of it is obtained via gasification and the rest is produced in one of the HPPs, while the other one is not operated. HRGP exports steam to the refinery during summer and winter. Co-produced offgas is used as additional fuel in the TPP. C.
New state 2: A significant amount of HR is processed via gasification; the rest is divided between its consumption in the TPP, and export outside the refinery is minimized. The total amount of produced hydrogen is the same as in case A; a part of it is obtained via gasification and the rest is produced in one of the HPPs, while the other one is not operated. HRGP only exports steam to the refinery during winter. Co-produced offgas is used as additional fuel in the TPP.
Case C is a modified version of case B, representing a possible strategic decision of refinery managers aiming at more beneficial, energy-efficient, and environmentally friendly production. During the refinery operation, many non-standard situations may occur (caused by weather changes, changes in feed composition, planned and non-planned shutdowns of plants, and the market demand for different products and their different quality). Switching between the B and C modes of operation can be a favorable solution to make the refinery operation more flexible.
An evaluation of the CO 2 amount emitted into air can be carried out via two approaches. The first one is based on the exact calculation of CO 2 emitted per year from the refinery via Equation (12) and considers only a part of the CO 2 emissions. The other

Preliminary Design of HRGP
The plant for heavy residue gasification was designed to process 60 t/h of HR. Its operation is described by Equations (6)-(11) and (A1)-(A25) and by data from Table 2; the results are taken from a bachelor thesis [45]. The main results of this design calculation are presented in Table 7. The results for all material flows presented in Figure 2 are shown in Appendix B.
Almost 92 kg of hydrogen per ton of gasified HR is produced, which represents 83% of the hydrogen contained in HR. During gasification, a certain amount of solid phase is produced, which is mainly composed of heavy metals, soot, and tar. This material stream is neglected in the calculations because of its low mass flow.
Thanks to the high temperature of fresh syngas leaving the reactor, 131 t/h of highquality steam (6 MPa, 460 • C) is produced in the HRSG, 83% of which is used for electricity production, while the rest serves as a gasifying agent in the reactor. More than 75% of the steam inlet into the steam turbine is expanded to low pressure (vacuum) in summer, producing condensing electricity, while this value lowers to 10% in winter when a considerable amount of steam is extracted from the steam turbine and exported out of the HRGP. Besides steam export, steam extraction is also used for desorber heating.
The amount of MDEA solution (flow M1 shown in Appendix B) used for acid gases absorption represents theoretical (minimal) amount for sour gas absorption as the complete saturation of the MDEA solution (full occupation of active centers) is assumed. The produced sour gas (flow G6) can be used for sulfur recovery using the Claus process.
The stepwise pre-heating of boiler feedwater maximizes heat recovery and improves its power production efficiency. Differences between the summer and winter regime operations of the HRGP include a lower cooling water temperature in winter, enabling higher heat power production efficiency, while different electricity production and steam exports are operational differences. As mentioned in Table 7, HRGP serves as power plant during summer and mainly as thermal plant during winter.

Case A
Case A represents reference comparative case. A graphical form of the balances' results from the TPP and HPPs in the refinery is shown in Figure 5. The exact data used in Figure 5 are shown in Appendix C.
its power production efficiency. Differences between the summer and winter regime operations of the HRGP include a lower cooling water temperature in winter, enabling higher heat power production efficiency, while different electricity production and steam exports are operational differences. As mentioned in Table 7, HRGP serves as power plant during summer and mainly as thermal plant during winter.

Case A
Case A represents reference comparative case. A graphical form of the balances' results from the TPP and HPPs in the refinery is shown in Figure 5. The exact data used in Figure 5 are shown in Appendix C. Figure 5. Energy diagram of case A (GWh per year). Source: Own elaboration. The term "Consumption" used in Figure 5 (also throughout the analysis) represents energy flows entering the relevant plant and are processed into relevant products leaving each plant, represented by "Production". As presented in Figure 4 (also throughout the analysis), "Losses" represent heat losses coupled to material streams (wastewater, cooling water, etc.) and losses by radiation.
Roughly half of the available HR is currently consumed in the refinery and the rest is sold to external consumers. TPPs can produce only 40% of the electricity consumed in the refinery. The CO2 production analysis shows that the TPP produces 954 kt of CO2 per year and the two HPPs produce 616 kt of CO2 per year. The purchase of electricity contributes to CO2 emissions of 61 kt per year (external emissions).

Case B
HRGP integrated into an oil refinery partially replaces TPPs and HPPs, thereby reducing their throughput. The results of balances after integration are shown in Figure 6. The exact data used to construct Figure 6 are shown in Appendix C. The integration of HRGP causes a reduction in HR consumption in the TPP since the produced HRGP offgas is used as additional fuel for the TPP. After HRGP integration, HR consumption increases to 82% of the available HR. The purchase of electricity increases because of the additional Figure 5. Energy diagram of case A (GWh per year). Source: Own elaboration. The term "Consumption" used in Figure 5 (also throughout the analysis) represents energy flows entering the relevant plant and are processed into relevant products leaving each plant, represented by "Production". As presented in Figure 4 (also throughout the analysis), "Losses" represent heat losses coupled to material streams (wastewater, cooling water, etc.) and losses by radiation.
Roughly half of the available HR is currently consumed in the refinery and the rest is sold to external consumers. TPPs can produce only 40% of the electricity consumed in the refinery. The CO 2 production analysis shows that the TPP produces 954 kt of CO 2 per year and the two HPPs produce 616 kt of CO 2 per year. The purchase of electricity contributes to CO 2 emissions of 61 kt per year (external emissions).

Case B
HRGP integrated into an oil refinery partially replaces TPPs and HPPs, thereby reducing their throughput. The results of balances after integration are shown in Figure 6. The exact data used to construct Figure 6 are shown in Appendix C. The integration of HRGP causes a reduction in HR consumption in the TPP since the produced HRGP offgas is used as additional fuel for the TPP. After HRGP integration, HR consumption increases to 82% of the available HR. The purchase of electricity increases because of the additional electricity consumption for oxygen separation and because of the lower power production in the TPP. The heat (steam) and hydrogen production rates remain the same. The emissions of CO 2 from the TPP decrease to 335 kt CO 2 per year. The emissions of CO 2 from the HPP decrease to 259 kt CO 2 per year due to lower hydrogen production (only one HPP is in operation). The emissions of CO 2 from HRGP are 1112 kt CO 2 per year as HRGP becomes the main consumer of HR in the refinery. CO 2 emissions from the combustion of carbon compounds contained in the HRGP offgas contribute to HRPG emissions (the same applies to case C). sions of CO2 from the TPP decrease to 335 kt CO2 per year. The emissions of CO2 from the HPP decrease to 259 kt CO2 per year due to lower hydrogen production (only one HPP is in operation). The emissions of CO2 from HRGP are 1112 kt CO2 per year as HRGP becomes the main consumer of HR in the refinery. CO2 emissions from the combustion of carbon compounds contained in the HRGP offgas contribute to HRPG emissions (the same applies to case C).

Case C
After the modification of the steam export regime from the HRGP to the oil refinery, nearly all HR produced in the refinery is consumed in the HRGP. The results of balances after the integration with this modification are shown in Figure 7 and the source data are shown in Appendix C.

Case C
After the modification of the steam export regime from the HRGP to the oil refinery, nearly all HR produced in the refinery is consumed in the HRGP. The results of balances after the integration with this modification are shown in Figure 7 and the source data are shown in Appendix C.
HPP decrease to 259 kt CO2 per year due to lower hydrogen production (only one HPP is in operation). The emissions of CO2 from HRGP are 1112 kt CO2 per year as HRGP becomes the main consumer of HR in the refinery. CO2 emissions from the combustion of carbon compounds contained in the HRGP offgas contribute to HRPG emissions (the same applies to case C).

Case C
After the modification of the steam export regime from the HRGP to the oil refinery, nearly all HR produced in the refinery is consumed in the HRGP. The results of balances after the integration with this modification are shown in Figure 7 and the source data are shown in Appendix C.  As almost all available HR is processed in the HRGP. Further increases in hydrogen production can be observed, leading to a decrease in NG consumption in the HPP of 40% in comparison to case B. The electricity purchase increases by roughly 10% in comparison to case B due to the slightly higher consumption of electricity for oxygen separation. The CO 2 emissions from the TPP increase to 350 kt CO 2 per year, while those from the HPP decrease to 154 kt CO 2 per year and from the HRGP increase to 1408 kt of CO 2 per year.

Overall Comparison of Cases
Using the data and dependences presented in Tables 4-7, cases B and C are compared to case A. The results of the mass and enthalpy balance calculations of every component of the oil refinery shown in Figure 3 are presented in Table 8. The stability of the steam and hydrogen network is ensured by producing the same total amounts of hydrogen and heat (steam) in each analyzed case (56 kt per year of hydrogen and 1682 GWh per year of heat). 1 Overall "Net electricity production" is calculated as the sum of the differences between electricity production in each considered plant and electricity consumption of each considered plant. Electricity production of HRGP is obtained as the recalculation of designed production (shown in Table 7) to the actual mode of operation (cases B and C); electricity production and consumption of TPP and HPP are presented in Tables 4 and 5. Sum of "Net electricity production" and "Electricity purchase" results in "Total consumption of electricity in the refinery" presented in Table 3.
The comparison of cases A and B shows that the consumption of HR rapidly increased almost 1.5-fold after the HRGP integration. Proportionally to that, both the HR export out of the refinery and the consumption of NG in HPP decreased, as HRGP partially replaces HPP. Due to the lower net electricity production in case B than in case A, the electricity purchase slightly increased.
Regarding CO 2 emissions, the higher the consumption of HR, the higher the emissions of CO 2 in the refinery. The total CO 2 emissions represent the emissions of consumed HR, exported HR, consumed NG, and purchased electricity. Since the sum of the consumed and exported HR is constant and the value of the NG emission factor is higher than for electricity, the reduced consumption of NG leads to a reduction in total CO 2 emissions.
The layout in case C was inspired by the HRGP design elaborated in [45]. Adjusting the steam export regime in the HRGP (case C vs. case B) causes almost all of the produced HR to be consumed in the refinery, which leads to a decrease in NG consumption, electricity purchase, and total CO 2 emissions.
Due to the TPP fuel switch (HR changed to offgas), additional technical modifications to the steam boiler construction (for example, changes to the burner type) may be needed, leading to additional capital expenses to HRGP commissioning.
The key parameters of the case comparison are the efficiency of hydrogen, heat, and electricity production. Individual efficiencies were obtained by dividing the production of the considered commodity and overall fuel consumption (HR and NG), both expressed in energy units. Table 9 shows the calculated efficiencies of each case. The reason for heat and hydrogen production efficiencies being either constant or lower is that the heat losses in cases A and B are similar and the heat losses in case C are higher (increased condensing power production). In terms of electricity production efficiency, the electricity consumption necessary for oxygen separation is decisive. To reduce losses, energy optimization is needed, which is a future research topic.
Technically, it is impossible to operate the refinery in only one way due to the many non-standard modes of operation mentioned in Section 2.5. Therefore, it is hard to deter-mine the exact differences between cases B and C, as each of them has its own benefits in the different analyzed factors.
Besides the changes in the mass and heat balances in individual cases, the amount of CO 2 produced in oil refinery depends on the emission factor for electricity, which is different for every country and region. Table 10 shows the corresponding results of refinery emissions analysis before (case A) and after (cases B and C) HRGP integration. The emission factors of several European countries with oil refineries and all continents for the 2021 energy mix were compared in [53]. The delta between cases C and A fluctuates between 134 and 197 and that between cases C and A between 340 and 360 kt of CO 2 per year; thus, it can be concluded that the impact of electricity emission factor on emission analysis is negligible. Marginal emission factor analysis is, thus, not necessary.
The emission factors of Poland and Sweden were applied in the total CO 2 emissions analysis due to a large difference in their values; the results are presented in Table 11. Table 11. Comparison of total CO 2 emissions. The "Delta" columns in Table 11 confirm that the incorporation of HRGP significantly reduces CO 2 emissions, thus contributing to industry decarbonization.

Delta (C-A) (kt per Year)
In terms of the Paris Agreement [54], Green Deal [55], and Fit for 55 plan [56], the long-term intention is to produce electricity in a more environmentally friendly way, which results in lowering electricity emission factors to near zero. The fulfilment of this goal is influenced by the actual political situation in each region, which affects the preferred means of electricity production. The results in Tables 10 and 11 can also be interpreted as the trend of CO 2 emission reduction from the actual values to the future "goal" values (with Sweden representing the future goal with emission factors as low as 0.012 t/MWh).

Analysis Validation and Discussion
Several papers dealing with the technical or techno-economic evaluation of IGCCs were presented in the Introduction. Every study, including this one, analyzes the same factors using different methods; nevertheless, some similarities can be found. Three parameters applied in technical evaluation in this study and the papers mentioned are compared in Table 12. In each study, a different level of refining technology complexity and technologic maturity is analyzed, which is one of the main factors affecting the final values of the compared parameters (for example, co-integrated CCS or steam/electrical engines affect electricity consumption, energy efficiency, and amount of CO 2 emitted). In terms of gasification, Ma et al. [35] analyzed the biomass-to-hydrogen process, while Al-Rowaili et al. [36] analyzed vacuum residue gasification coupled with methanol production in comparison to traditional steam methanol production. Sato et al. [37] analyzed an integrated coke gasifier into an oil refinery in a techno-economic way, and Berghout et al. [38] considered a heavy residue gasifier in an environmental way. Finally, the study conducted by Al-Qadri et al. [40] analyzed waste tire gasification coupled with natural gas steam reforming. All of these studies were compared to this paper, analyzing heavy residue gasifier integration into an existing oil refinery using similar energy and environmental evaluation parameters.
Ma et al. [35] compared the efficiency of CCS in a hydrogen production plant via biomass gasification. Similar technology for gasification was also considered in this study and, thanks to that, the estimated energy efficiencies are similar. The main electricity consumer in Ma et al. is CCS, as reflected in the higher specific electricity consumption per ton of produced hydrogen compared to this study.
In the study by Al-Rowaili et al. [36], the same type of gasification reactor and similar syngas outlet temperature and HR/O 2 ratio as in this paper were assumed. They compared traditional steam reforming methanol production to methanol production via vacuum residue gasification as an unconventional technique. The constant production of the main product-methanol-was assumed and the accumulation of CO 2 emissions was confirmed due to "bottom of the barrel" processing. The subsequent use of captured CO 2 in the case of CCS application can lead to a significant reduction in CO 2 emissions. This can, under certain circumstances, be a possible solution for emission reduction in case C at the expense of increased electricity purchase, provided the captured CO 2 can be used locally.
Sato et al. [37], in their analysis of coke gasifier integration into a Brazilian oil refinery, assumed the same gasification reactor (entrained flow) and the same feed consumption as in our study. The energy efficiency of the IGCC plant estimated in their study includes the electricity produced in steam and gas turbines (combusting syngas), while this paper only considers steam turbine electricity production, which is probably the reason for the low efficiency of electricity production in the integrated HRGP. They used thermodynamic analysis to prove that IGCC is suitable for electricity production, but an improvement of its integration is needed. According to our study, implementing IGCC has many advantages, for example, the maximization of hydrogen production, the high added value of low-valued by-products, and the operational flexibility of refining processes.
In the analysis by Berghout et al. [38], a large-capacity oil refinery was considered. The IGCC plant was modeled to replace 560 MW of natural gas; an approximately two-fold reduction of NG was observed between cases A and C in our analysis, which is proportionate to the different oil refinery capacities considered in the studies. As highlighted in [38], one of the disadvantages of gasification is excessive water consumption (as a gasifying reagent for steam production). Using only oxygen or air as gasifying reagents partly solves this problem, but it can decrease the H 2 /CO ratio in the produced gas and, thus, reduce hydrogen production.
Al-Qadri et al. [40] compared an integrated biomass gasification plant vs. IGCC coupled with natural gas steam reforming. Steam was used as the gasifying agent. Their energy, environmental, and economy analysis results are presented in Table 12 for the IGCC case. The results of their analysis show that IGCC with reforming is more suitable for increasing the H 2 /CO ratio in syngas used for methanol production. In comparison to our study, similar hydrogen production efficiencies were observed.
In terms of overall energy efficiency, the presented concept of HRGP integration to yield a polygeneration unit, producing hydrogen, steam, and electricity, is superior to integration layouts focused on producing only one product. Table 12 documents the highest achieved energy efficiency of over 60% in this study, while the reference studies report values of between 30 and 45%. Obviously, incorporating an additional CCS unit would consume a part of the produced energies and would lower the overall energy efficiency, as indicated by that of less than 25% reported by Berghout et al. [38] for a system equipped with CCS.
Regarding all mentioned studies, different coupled technologies were analyzed by different approaches; both considering and omitting CCS are compared. Thanks to CCS, lower CO 2 emissions are obtained in several reference studies compared to this study. To reduce CO 2 emissions as much as possible, a combination of several technologies (for example, HRGP, CCS, renewable energy sources) can be a suitable solution.
Indirect CO 2 emissions (produced in power sources balancing the changed power consumption of the industrial enterprise) have a certain impact on the total CO 2 balance, with the impact being dependent on power consumption change and electricity emission factors. In the presented HRGP integration layout, the resulting purchased power change by the refinery (Appendix C- Table A4) does not exceed +20% compared to the base case. As a result, not even the highest power emission factors considered (see Table 11 Poland: 0.739 t/MWh) cause a significant change in CO 2 balance which, for all emission factors considered, indicates an increase in emissions within refinery balance boundaries, but a decrease in emissions in total. However, a different outcome could be obtained by the HRGP focusing on power production (IGCC) with absenting CCS where a much higher change in power purchase by the refinery would be expected. Future electricity emission factors are expected to decrease and Sweden, with its current emission factor of 0.012 t/MWh, can serve as an example of how the CO 2 balance could look in the future. As indicated in Tables 10 and 11, a smaller electricity emission factor is beneficial from a CO 2 balance point of view, leading to a lower increase in CO 2 emissions within the refinery after HRGP integration (Table 10), supporting the total CO 2 emission decrease ( Table 11).
The performed analysis justifies HRGP integration into oil refineries. A deeper carbon energy analysis should include electricity consumption optimization and the minimization of heat losses, which will significantly contribute to the improved heat efficiencies of the production of three main commodities: heat, electricity, and hydrogen. Future research can also be aimed at: • Expanding emission analysis to include other greenhouse gases emitted into air (NO x , SO x ); • Economy analysis focused on HRGP integration payback period evaluation and the minimization of HRGP construction costs.
The coupling of electricity consumption optimization and heat loss minimization with the above aspects would result in the multi-level optimization of HRGP integration into oil refineries.

Conclusions
The analysis of an HR gasification unit integration into an existing mid-size oil refinery (5 million t per year crude processing) presented in this paper is based on energy impact and carbon emissions estimation. As such a gasification unit partially replaces an industrial thermal plant and hydrogen production plant, these two units together with hydrogen and steam network are considered parts of the oil refinery affected and, thus, are part of the analysis. Two modes of operation after the integration (case B and C) are compared to a base case (case A) before integration. The consumption of HR and NG, the purchase of electricity, and CO 2 emissions are the main analyzed factors.
The integration of an HRGP results in a polygeneration process converting low-value refinery by-products into valuable ones (such as hydrogen) at heat, hydrogen, and electricity production efficiencies comparable to the current state. This can, in turn, reduce natural gas consumption almost four times (or, in absolute values, from over 3000 to less than 1300 GWh per year (case B) or even to less than 800 GWh (case C) per year) compared to the current state. An overall energy efficiency of over 60% is achieved due to polygeneration, which is significantly higher than the values reported in reference studies focused on one product (electricity or hydrogen) only. Almost all HR produced by the refinery is processed by the HRGP in case C, saturating over 70% of the hydrogen production of dedicated hydrogen production plants in the base case.
Simultaneously, such integration leads to modestly increased electricity purchase by the refinery of up to +20% and to slightly increased refinery CO 2 emissions (up to +10%). However, a decrease in external emissions (expanding balance borders) outweighs this trend, and decreases in the overall CO 2 emissions of 15 to 20% (up to 350 kt per year in case B or over 460 kt per year in case C) can be achieved in comparison to the current state. The electricity emission factor is found to play a minor role in CO 2 balance, with its lower values reducing the refinery emissions increase and contributing to a higher total emissions decrease. As the electricity emission factors are expected to gradually decrease, the presented HRPG integration layout will become more feasible from a CO 2 emissions point of view.
Case C represents a more feasible solution considering the evaluated parameters than case B. However, decision making in optimal refinery operations is far more complex and is based on many more factors. Thus, operating the HR gasifier via case B may represent a better option if HR can (temporarily) be sold for a good price, or if there is a major shift in the refinery's steam balance causing the TPP to consume more HR. It is almost certain that a real integrated gasifier operation would vary among many operation states, out of which cases B and C represent only a fraction. However, if the polygeneration design is adopted, as proposed in this study, an additional gasifier operation flexibility is obtained, which would contribute to its operation feasibility in real refinery operation conditions. The real features of a refinery operation should be incorporated to our future studies dedicated to a deeper analysis of HRPG integration benefits.
This conceptual analysis is a good starting point to techno-economy analysis and deeper multi-level optimization with respect to the minimization of the HRGP integration payback period, construction costs, electricity purchase, and heat losses. Future work will be aimed at the mentioned optimization of integrated gasification plant and an appropriate method of carbon capture and storage to enhance the decarbonization impact.

Conflicts of Interest:
The authors declare no conflict of interest. The sponsors had no role in the design, execution, interpretation, or writing of the study. medium Appendix A Table A1. Mass and enthalpy balance of HRGP equipment (CW-cooling water, HRGS-heat recovery steam generator, PSA-pressure swing adsorption unit).

Equipment Equation No
.