Upgrading Biogas from Small Agricultural Sources into Biomethane by Membrane Separation

The agriculture sector in Poland could provide 7.8 billion m3 of biogas per year, but this potential would be from dispersed plants of a low capacity. In the current study, a membrane process was investigated for the upgrading biogas to biomethane that conforms to the requirements for grid gas in Poland. It was assumed that such a process is based on membranes made from modified polysulfone or polyimide, available in the market in Air Products PRISM PA1020 and UBE UMS-A5 modules, respectively. The case study has served an agricultural biogas plant in southern Poland, which provides the stream of 5 m3 (STP) h−1 of biogas with a composition of CH4 (52 vol.%), CO2 (46.3 vol.%), N2 (1.6 vol.%) and O2 (0.1 vol.%), after a pretreatment. It was theoretically shown that this is possible to obtain the biomethane stream of at least 96 vol.% of CH4 purity, with the concentration of the other biogas components below their respective thresholds, as required in Poland for gas fuel “E”, with methane recovery of up to 87.5% and 71.6% for polyimide and polysulfone membranes, respectively. The energetic efficiency of the separation process is comparable for both membrane materials, as expressed by power excess index, which reaches up to 51.3 kWth kWel−1 (polyimide) and 40.7 kWth kWel−1 (polysulfone). In turn, the membrane productivity was significantly higher in the case of the polyimide membrane (up to 38.3 kWth m−2) than those based on the polysulfone one (up to 3.13 kWth m−2).


Introduction
The model of a circular economy and the European Union's policy on biomass energy use are parts of the overall research and technological development strategy in Europe. Intensive research and development work is focused on new methods of processing biomass into components for motor fuels and chemicals [1][2][3][4][5][6]. Biogas, which is a by-product of the biological decomposition of organic substances under anaerobic conditions, belongs to the important renewable energy sources (RES) [1,7,8]. Apart from landfills and sewage treatment plants, it may come from biogas plants processing the agricultural or food industry waste. In Poland itself, the potential of the agri-food sector in terms of biogas generation is estimated at over 7.8 billion m 3 per year [9]. Energy from biogas is particularly useful in the combined production of electricity and heat. Additionally, indeed, most of the biogas produced in Europe is burned in cogeneration units. However, due to the fact that biogas plants are located at a considerable distance from built-up areas, the cogenerated heat cannot be utilized at a satisfactory level. An alternative is to upgrade biogas to biomethane as an energy carrier. This can be generally carried out by absorption, adsorption, cryogenic or membrane separation [7,[10][11][12][13][14]. Membrane processes compete with other separation methods by compact module setups, easy scaling-up of the continuous process, low energy consumption (due to the lack of phase transitions) and no need for additional sorbents [15][16][17][18][19][20][21]. As limitations, both the necessity to compress the gas to pres-sures of 1-2 MPa [7,8,12,15,[22][23][24][25] and the initial preparation of biogas [7,[10][11][12]14,22,23] are mentioned.
Membrane processes in the context of biogas enrichment have been investigated intensively for a decade and have already found practical application in large-scale installations with a capacity of several hundred m 3 h −1 of biogas, operating at a pressure higher than 1 MPa [7,15,22,26]. Such processes consist of several stages, including raw gas preparation (H 2 S and solid particles removal, dehydration), compression and membrane separation [22]. In Poland the membrane biogas upgrading from various sources, including agricultural waste, has been studied, among others, by Chmielewski et al. [20]. However, an installation which produces biomethane from biogas is still to be implemented in the country, while in 2019 there were 725 such units in Europe [27], including 173 membrane setups [28]. Among the main reasons for the slow development of the biogas and/or biomethane market in Poland are the lower than expected level of support for investors, low social awareness of the benefits of using biogas and the lack of clear legal and administrative conditions. Moreover, in Poland, small and dispersed farms prevail, where a biogas plant, if exists, has a small capacity of a few m 3 h −1 of biogas. Therefore, an implementation of a biomethane upgrading technology is not just a matter of downgrading existing solutions. With such a small scale, the energetic efficacy and overall profitability of the investment may be harder to achieve.
The main gaseous components of biogas from agricultural waste are methane (53-85 vol.%), carbon dioxide (14-48 vol.%), nitrogen (0.5-7.5 vol.%) and oxygen (<1 vol.%) [11,12,19,20,23,25,29,30]. In turn, two main impurities of the raw agricultural biogas are water vapour (1-10 vol.%) and H 2 S (10-30,000 ppm). If biogas is to be injected into the natural gas transmission network, it should be standardized. Requirements concerning the grid gas vary significantly for different countries [14], therefore a prospective biogas upgrading technology has to be adapted to them. According to Polish regulations [31], gas fuel "E" should have the heat of combustion ≥ 10.56 kWh m −3 , the total amount of combustible components ≥96 vol.%, less than 4 vol.% of nitrogen, 3 vol.% of CO 2 , 0.2 vol.% of oxygen and 5 ppm of H 2 S. In order to meet these requirements, it is possible to perform the separation of all six components listed above in a process which uses commercial cellulose acetate, polyimide, polysulfone or polycarbonate membranes [11,19,20,26]. However, due to the high risk of formation of corrosive compounds, it is still necessary to remove or at least significantly reduce the concentration of water vapor and H 2 S before the essential separation process.
The main goal of this study was to assess the possibility of reaching a biomethane quality which conforms to the requirements for grid gas fuel, while upgrading biogas from a small agricultural source in a membrane process. As a case study, an agricultural biogas plant in southern Poland provides a stream of 5 m 3 (STP) h −1 of biogas with a composition of CH 4 (52 vol.%), CO 2 (46.3 vol.%), N 2 (1.6 vol.%) and O 2 (0.1 vol.%) after a pretreatment. In the membrane process investigated in this paper, two membranes-that is, polyimide and polysulfone-were considered, which are used in commercial UBE UMS-A5 and Air Products PRISM PA1020 modules, respectively. The performance of these modules were preliminary assessed in the experimental separation of CH 4 /CO 2 mixtures. Then, the enrichment of methane in the four-component agricultural biogas stream was investigated theoretically, especially in terms of required membrane area and the excess of thermal power that is carried with the biomethane stream, over the electric power necessary to carry out the essential separation process. The model developed and validated for the capture of CO 2 from flue gases in a membrane and hybrid process was used in the study after additional validation, based on experimental data from the separation of CH 4 /CO 2 mixtures. The model was fed with permeance coefficients of pure CH 4 , CO 2 , N 2 and O 2 , which were experimentally determined in our laboratory in UMS-A5 and PRISM PA1020 modules.

Experimental Setup
Gas permeation studies were performed in an experimental setup with the exchangeable membrane module, which is presented schematically in Figure 1. The setup is equipped with the gas preparation section, which consists of gas cylinders, a mixer and a thermostat. The gas from 1 or 2 gas cylinders passes through a mixer, which is a steel column with a diameter of 20 mm and a length of 500 mm. Its temperature was further established in the water thermostat (Julaba F12, the accuracy of temperature stabilization: 0.1 • C) before entering the membrane module. The module, the feed gas and the permeate and retentate lines, are insulated. Pressure, temperature, flow rate and composition (in the case of gas mixtures) were measured and recorded during experiments for the three gaseous streams. In the case of composition, the three-channel Varian (CP-4900) microchromatograph was used, thus the concentration of the mixture components was measured in the feed gas, permeate and retentate at the same time with an accuracy of 0.01 vol.%. The pressure was measured with pressure transducers (Cole-Parmer P series) with an accuracy of 0.1 psi. For the temperature measurement, Cole-Parmer Digi-Sense was used, which provided an accuracy of 0.1 • C. Aalborg GFM37 flow meters with an accuracy of 0.1 L min −1 were used to measure the feed gas, retentate and permeate flow rates.

Membrane Modules
Two hollow-fibre modules were used: PRISM PA1020, provided by Air Products, and UMS-A5, provided by UBE. The first one has a membrane formed of modified polysulfone and in the UBE's module, a polyimide membrane was used. Both modules were designed mainly for air separation but were also successfully implemented in a hybrid, adsorptive membrane process for CO2 capture [32,33]. The modules were used in the experimental setup as supplied, and parameters used in the experiments were within the pressure and temperature ranges recommended by the manufacturers. The membrane area in these modules was 2.24 m 2 in the case of PRISM PA1020 [33,34] and 0.167 m 2 [35] in the case of UMS-A5. Other technical parameters of the modules were given in [29].

Gas Permeation Studies
Permeance coefficients of pure CO2, N2 and O2 in both modules were determined experimentally in our previous studies [34,35]. In the case of pure methane, the permeance was determined experimentally at 295 K. For this purpose, the feed gas pressure was changed within the range of 0.12-0.72 MPa (a) and the corresponding permeate flow rate was measured. The absolute permeate pressure was close to the ambient pressure, but was recorded for every single experimental point. The permeate flow rate is a basis for the determination of the gas permeance, as follows:

Membrane Modules
Two hollow-fibre modules were used: PRISM PA1020, provided by Air Products, and UMS-A5, provided by UBE. The first one has a membrane formed of modified polysulfone and in the UBE's module, a polyimide membrane was used. Both modules were designed mainly for air separation but were also successfully implemented in a hybrid, adsorptive membrane process for CO 2 capture [32,33]. The modules were used in the experimental setup as supplied, and parameters used in the experiments were within the pressure and temperature ranges recommended by the manufacturers. The membrane area in these modules was 2.24 m 2 in the case of PRISM PA1020 [33,34] and 0.167 m 2 [35] in the case of UMS-A5. Other technical parameters of the modules were given in [29].

Gas Permeation Studies
Permeance coefficients of pure CO 2 , N 2 and O 2 in both modules were determined experimentally in our previous studies [34,35]. In the case of pure methane, the permeance was determined experimentally at 295 K. For this purpose, the feed gas pressure was changed within the range of 0.12-0.72 MPa (a) and the corresponding permeate flow rate was measured. The absolute permeate pressure was close to the ambient pressure, but was recorded for every single experimental point. The permeate flow rate is a basis for the determination of the gas permeance, as follows: where A-membrane area (m 2 ); Q-permeance-kmol h −1 MPa −1 or GPU; P ω -permeate flow rate (kmol h −1 ); p F and p P -feed pressure and permeate pressure, respectively (MPa). The ideal separation factor (α) of carbon dioxide, nitrogen and oxygen vs. methane may be defined, in this case, as follows: Although Q is virtually independent of the feed gas flow rate, the permeation of pure gases was measured at two values of the feed gas flow rate of 0.025 and 0.038 kmol h −1 (PRISM PA1020), and at three values of the feed gas flow rate of 2.5 × 10 −4 , 5.0 × 10 −4 and 7.5 × 10 −4 kmol h −1 (UMS-A5), in order to check for experimental errors as well as for consistency of the setup and methodology.
The separation of two component mixtures containing 50 and 60 vol.% of methane in the mixture with carbon dioxide was investigated experimentally for the feed gas flow rate of 0.038 kmol h −1 (PRISM PA1020) and 2.5 × 10 −4 -9.6 × 10 −3 kmol h −1 (UMS-A5), at the temperature of 294-296 K. The performance of the separation process was evaluated on the basis of CO 2 concentration in the retentate and permeate, as well as the cut ratio, as follows: where F α -feed gas flow rate (kmol h −1 ). At a given pressure and flow rate, one experimental session consisted of the following steps: the establishment of parameters of feed gas, reaching the steady state and monitoring of the process in the steady state. The process parameters (i.e., pressure, flow rate, composition and temperature) of the feed gas, retentate and permeate were monitored and recorded during the entire experimental session. The recording of the concentrations was started every 5 min and it took about 4 min. Other parameters were recorded in a continuous way. The concentrations and flow rates reported in Section 3.2 are their average values determined in the steady state within a reasonable long time period (~100 min).

Mathematical Model
A gaseous mixture introduced to the membrane module is divided into two outlet streams: the permeate, which is the stream transported through the membrane, and the retentate, which is the stream remaining on the feed side of the module. The permeate may flow co-currently or counter-currently to the feed gas, or it may be locally unhindered [36]. Taking into account that the permeate is collected in the inter-tubular space and its flow is unforced, we assumed the plug flow on the feed side and unhindered flow on the permeate side in both modules. Such an attempt was successfully validated and used in our studies concerning membrane and hybrid processes of CO 2 capture from mixture with nitrogen. The flow pattern is schematically presented in Figure 2.
It was also assumed that there are no interactions between the permeating components (therefore, the permeances are the same as for pure components), that the pressure drop and axial dispersion are negligible on both sides of the membrane, that the process is isothermal and that concentration polarization is also negligible on both sides of the membrane. The final forms of model equations and boundary conditions are presented in Table 1. All phenomena accompanying the transport of gas through the membrane are included in permeances, which may be measured directly, as described in the previous section. = + (12) Retentate flow rate (Fω): where δ-pressure ratio (=p P /p F ); x-mole fraction on the feed side; N-number of components. Local mole fractions (y i + ) of the other permeate components (i = 2, . . . , N): Gas composition on the feed side (i = 1, . . . , N -1): where R-permeation number (=AQ 1 p F /F α ); x α -mole fraction in the feed gas; y-mole fraction on the permeate side. Mole fraction of component N on the feed side: Mole fraction of component 1 in the permeate: Mole fractions of the other permeate components (i = 2, . . . , N-1): (9) Mole fraction of component N on the permeate side: Boundary conditions at z = 0 (i = 1, . . . , N): Permeate flow rate: Membranes 2021, 11, 938 6 of 20 The set of first-order ordinary differential equations with accompanying algebraic equations and boundary conditions, as presented in Table 1, was implemented and solved in a C++ numerical simulator. The Runge-Kutta method of the 4th order, with a given integration step dz, was used, and the integration started from the feed gas inlet and ended at the retentate outlet.

Permeability and Ideal Selectivity of Main Biogas Components
The permeance (Q i ) of methane in both investigated modules, determined from single gas experiments, was shown graphically in Figure 3 for feed gas flow rate of 0.038 kmol h −1 in the case of PRISM PA1020 and 7.5 × 10 −4 kmol h −1 in the case of UMS-A5. As can be seen in the figure, the permeance is virtually independent of pressure in the experimental conditions. Since it is independent of feed gas flow rate as well, presented in Table 2 are their average values from experimental data, concerning feed gas flow rates of 0.025 and 0.038 kmol h −1 in the case of PRISM PA1020 and 2.5 × 10 −4 , 5.0 × 10 −4 and 7.5 × 10 −4 kmol h −1 in the case of UMS-A5. The permeance coefficients of other main biogas components, i.e., carbon dioxide, nitrogen and oxygen, determined at 293 K in our previous studies, are also given in Table 2 as a reference. The set of first-order ordinary differential equations with accompanying algebraic equations and boundary conditions, as presented in Table 1, was implemented and solved in a C++ numerical simulator. The Runge-Kutta method of the 4th order, with a given integration step dz, was used, and the integration started from the feed gas inlet and ended at the retentate outlet.

Permeability and Ideal Selectivity of Main Biogas Components
The permeance (Qi) of methane in both investigated modules, determined from single gas experiments, was shown graphically in Figure 3 for feed gas flow rate of 0.038 kmol h −1 in the case of PRISM PA1020 and 7.5 × 10 −4 kmol h −1 in the case of UMS-A5. As can be seen in the figure, the permeance is virtually independent of pressure in the experimental conditions. Since it is independent of feed gas flow rate as well, presented in Table 2 are their average values from experimental data, concerning feed gas flow rates of 0.025 and 0.038 kmol h −1 in the case of PRISM PA1020 and 2.5 × 10 −4 , 5.0 × 10 −4 and 7.5 × 10 −4 kmol h −1 in the case of UMS-A5. The permeance coefficients of other main biogas components, i.e., carbon dioxide, nitrogen and oxygen, determined at 293 K in our previous studies, are also given in Table 2 as a reference.  The permeance of all gases in UMS-A5 with the polyimide membrane is significantly higher than that in PRISM PA1020 with the polysulfone one. More importantly, the ideal selectivity of CO2, O2 and N2 vs. methane was also visibly (2.4-2.8 times) higher in the  The permeance of all gases in UMS-A5 with the polyimide membrane is significantly higher than that in PRISM PA1020 with the polysulfone one. More importantly, the ideal selectivity of CO 2 , O 2 and N 2 vs. methane was also visibly (2.4-2.8 times) higher in the UMS-A5 module. Thus, in terms of separation properties, the module with the polyimide membrane is expected to perform better. The permeance of CO 2 , N 2 and O 2 presented in Table 2 concerns fresh, unused earlier modules and was used in a simulation study, discussed in Section 3.4. In the case of the experimental study discussed in Section 3.3, both modules have been used in other separations for a few years and their separation properties have changed [34]. In this case, current permeance coefficients of CO 2 were determined and used for the purpose of model validation, which were equal to 128.1 and 992.2 GPU in PRISM PA1020 and UMS-A5, respectively.
In the case of PRISM PA1020 the permeance coefficient of CH 4 measured in our laboratory (4.2 GPU) as well as the ideal CO 2 /CH 4 (36.4), O 2 /CH 4 (6.55) and N 2 /CH 4 (0.89) are selectivity in conformity with data given in [37] for the similar Air Products PRISM module. In the case of the UBE UMS-A5 module with polyimide, the permeance of methane was not previously reported, but that of CO 2 and N 2 as measured in our laboratory agrees well with data provided by [38], i.e., CO 2 permeance of 1300 GPU and the ideal CO 2 /N 2 selectivity of 41 at 298 K.

Separation of CH 4 /CO 2 and Model Validation
The separation of methane and carbon dioxide mixture was investigated in both modules for different CH 4 concentrations (50 and 60 vol.%) at the module inlet, as well as for various feed gas flow rates (2.5 × 10 −4 -9.6 × 10 −3 kmol h −1 ) in the case of UMS-A5. In such a situation, the main product is retentate, which is enriched in methane. However, in this section, the analysis was focused on carbon dioxide since this is the main undesired component in the raw biogas and the efficiency of its removal determines the general separation performance of the membrane biogas upgrading process. Experimentally measured, using a three-channel Varian microchromatograph, CO 2 content in the retentate, permeate and flux cut ratio against the pressure ratio of the feed gas and permeate are presented in Figure 4 for Air Products PRISM PA1020. Each experimental point marked in Figures 4 and 5 is the arithmetic mean determined from 10 measurement points. As can be seen in Figure 4, CO 2 concentration in permeate passes through a maximum while the feed to permeate pressure ratio is increased. On the retentate side, carbon dioxide content is monotonically decreased with p F /p P rise to 5.26 vol.% at the maximum p F /p P value. Thus, for the current feed gas flow rate (0.038 kmol h −1 ) and CO 2 content (50 vol.%), the feed to permeate pressure ratio would have to be raised above 5.7 in order to meet the requirements for carbon dioxide content in biomethane. However, this would be done at the cost of a further increase in the cut ratio (well above 0.6), i.e., a drop in the enriched methane stream.
On the other hand, CO 2 content in retentate in the UMS-A5 module is well below 3 vol.% at the feed gas pressure of 0.4 MPa (a) and the lowest flow rate. In this paper, the authors use absolute pressure. This can be seen in Figure 5, where experimentally determined CO 2 concentration in the retentate and permeate, along with flux cut ratio against feed gas flow rate, are presented for this module. The cut ratio is about 0.6 for this lowest feed gas flow rate. Carbon dioxide concentration in retentate raises quickly with the increase in the feed gas flow rate, especially in the region of its lower values. The module has a small membrane area; therefore, a moderate drop in contact time significantly lowers the amount of carbon dioxide transported through the membrane, despite rather high CO 2 permeance.
While some conclusions presented in this section seem obvious, the experiments provided the necessary data to perform a validation of the mathematical model presented in Section 2.4. Results of numerical simulations, shown by lines in Figures 4 and 5, fit well with the experimental data in the whole range of feed to pressure ratio, carbon dioxide content in the feed gas and gas flow rate at module inlet. The qualitative agreement between experimental and numerical data seems to be very good. From a quantitative point of view, the average relative error between experimental data and the results of simulations lies in the range of 1.9-3.9% and 14.3-30.2 in the case of CO 2 concentration in permeate and retentate, respectively, and 14.5-40.1% in the case of cut ratio.
while the feed to permeate pressure ratio is increased. On the retentate side, carbon dioxide content is monotonically decreased with pF/pP rise to 5.26 vol.% at the maximum pF/pP value. Thus, for the current feed gas flow rate (0.038 kmol h −1 ) and CO2 content (50 vol.%), the feed to permeate pressure ratio would have to be raised above 5.7 in order to meet the requirements for carbon dioxide content in biomethane. However, this would be done at the cost of a further increase in the cut ratio (well above 0.6), i.e., a drop in the enriched methane stream.  On the other hand, CO2 content in retentate in the UMS-A5 module is well below 3 vol.% at the feed gas pressure of 0.4 MPa (a) and the lowest flow rate. In this paper, the authors use absolute pressure. This can be seen in Figure 5, where experimentally determined CO2 concentration in the retentate and permeate, along with flux cut ratio against feed gas flow rate, are presented for this module. The cut ratio is about 0.6 for this lowest feed gas flow rate. Carbon dioxide concentration in retentate raises quickly with the increase in the feed gas flow rate, especially in the region of its lower values. The module has a small membrane area; therefore, a moderate drop in contact time significantly lowers the amount of carbon dioxide transported through the membrane, despite rather high CO2 permeance. While some conclusions presented in this section seem obvious, the experiments provided the necessary data to perform a validation of the mathematical model presented in Section 2.4. Results of numerical simulations, shown by lines in Figure 4; Figure 5, fit well with the experimental data in the whole range of feed to pressure ratio, carbon dioxide content in the feed gas and gas flow rate at module inlet. The qualitative agreement between experimental and numerical data seems to be very good. From a quantitative point of view, the average relative error between experimental data and the results of simulations lies in the range of 1.9-3.9% and 14.3-30.2 in the case of CO2 concentration in permeate and retentate, respectively, and 14.5-40.1% in the case of cut ratio.
The more visible quantitative discrepancy between the model and experiments can be seen in the case of cut ratio, especially for UBE UMS-A5. As can be seen from Equations The more visible quantitative discrepancy between the model and experiments can be seen in the case of cut ratio, especially for UBE UMS-A5. As can be seen from Equations (13) and (14), the retentate and, consequently, the permeate flow rate, are derived from calculated CO 2 mole fractions in these streams and thus depend directly on the accuracy with which they are determined. Taking into account that the model presented here reflects experimental conditions and was successfully validated in other separation cases, the problem probably lies in the fact that ideal instead of actual permeance coefficients were used. Both modules have glassy polymer membranes and, since the plasticization induced by carbon dioxide was not observed in the investigated modules [34], the competitive sorption in fractional free volume seems to be responsible for the varying change in permeances of both mixture components.
The problem was lately raised by Miandoab et al. [39] in their attempt concerning strict modelling of biogas upgrading in a module with a Matrimid membrane. They used the dual mode sorption (DMS) model in order to determine the concentration of gases in the glassy polymer. The required DMS parameters are usually not known or are not possible to determine in the case of the membranes that are used in commercial modules, as investigated in the current study. However, this problem should be taken into account in the development and optimization of the membrane biogas upgrade process, based on such modules. For the purpose of this study, the values of pure component permeance were further used, since a general agreement between experiments and simulations is still acceptable.

Background to the Simulation of a Biogas Upgrade Membrane Process
Polysulfone and polyimide membranes used in Air Products PRISM PA1020 and UBE UMS-A5 modules, respectively, were assessed theoretically in the process of upgrading the stream of 5 m 3 (STP) h −1 (0.223 kmol h −1 ) of pretreated biogas from an agricultural biogas plant in southern Poland. The membrane process analyzed in this section is presented schematically in Figure 6 and the basic parameters used in the simulation are given in Tables 2 and 3. The mathematical model, presented in Section 2.4, was used in this analysis, which deals with two process options. In the first one, biogas is upgraded in a single stage, where the feed mixture is compressed and split into two gas streams. The biomethane leaves the module as retentate at the same pressure as the feed gas. In turn, the permeate stream is derived at the ambient pressure. This case is highlighted by a dashed red line in Figure 6. In the two-stage configuration a CH 4 -enriched stream from the first stage is directed after the compression to the second stage, from which the final biomethane stream is derived as retentate, along with the second waste permeate stream. In this configuration it was assumed that the same membrane is used in both stages. Pressure ranges applied in the simulations are in conformity with the requirements for the commercial modules investigated in this paper. where pn, psi in and psi out -pressure under standard condition, before and after the compressor in "i" stage, respectively (Pa); κ-heat capacity ratio; Fs1 in -flow rate before the compressor in "i" stage (kmol h −1 ); η-efficiency of the compressor. Membrane productivity can serve as a rough indicator for the investment costs and can be defined as follows: Power excess index and membrane productivity are associated with specific energy and membrane area, respectively, which are reported in other studies. Indexes used in this study were also more convenient because the grid gas fuel consumption in Poland is billed on the basis of its heat of combustion.
The recovery of methane and carbon dioxide is defined below. In the two-stage configuration, the retentate parameters in Equation (18) concern the second stage and the permeate parameters in Equation (19) concern the first stage.    An assessment of the efficacy of a biogas upgrading process should be based, of course, on its economy. Such an analysis, which has to embrace also economic and/or process optimization, is beyond the scope of this paper. For the purpose of this study, the process was assessed in terms of the membrane productivity and the excess of thermal power carried with the biomethane stream, over the electric power necessary to carry out the essential separation process. The latter is a direct measure concerning the energetic efficiency of the essential separation process, but it also shows whether any profit from the production and sale of biomethane can be expected at all. It was defined as follows: where HHV CH4 -the heat of combustion (kWh th m −3 ); [CH4] BM -methane concentration in biomethane (vol.%); . V BM -biomethane flow rate (m 3 (STP) h −1 ); P s1 and P s2 -compressor power in stage 1 and 2, respectively (kW el ).
Parameters of biomethane in Equation (15) concern the retentate derived from the one-stage configuration or the second stage in the two-stage configuration. The power of the compressor may be expressed as: where p n , p si in and p si out -pressure under standard condition, before and after the compressor in "i" stage, respectively (Pa); κ-heat capacity ratio; F s1 in -flow rate before the compressor in "i" stage (kmol h −1 ); η-efficiency of the compressor.
Membrane productivity can serve as a rough indicator for the investment costs and can be defined as follows: Power excess index and membrane productivity are associated with specific energy and membrane area, respectively, which are reported in other studies. Indexes used in this study were also more convenient because the grid gas fuel consumption in Poland is billed on the basis of its heat of combustion.
The recovery of methane and carbon dioxide is defined below. In the two-stage configuration, the retentate parameters in Equation (18) concern the second stage and the permeate parameters in Equation (19) concern the first stage.

Biogas Enrichment in One-Stage Configuration
Figures 7 and 8 show methane and carbon dioxide concentrations in retentate as a function of membrane area at the different feed gas pressures, when the separation of the four-component biogas is performed in the one-stage membrane configuration. As may be seen in the figures, in every case when CH 4 concentration reaches 96 vol.%, i.e., the required level for combustible components in biomethane, the content of carbon dioxide has already been dropped below the required threshold of 3 vol.%. The other components of the biogas, nitrogen and oxygen have inlet concentrations below its threshold (4 and 0.1 vol.%, respectively). Oxygen permeates significantly faster than methane and nitrogen in both membrane materials and quickly passes to the permeate side. Its concentration was not shown in figures for the sake of their improved clarity, neither was the nitrogen content. Although, the latter is increased slightly during the separation but was always well below 4 vol.%.   As expected, an increase in the feed gas pressure leads to the drop in the membrane area required to achieve the separation goal, which is unambiguously determined in this case by a line of 96 vol.% of CH 4 in Figures 7 and 8. As can be seen in these figures, the concentration profiles become sharper when the pressure of the feed gas is raised. Therefore, again related to the lowering of the membrane area, it is more pronounced in the low pressure region. Thus, in the case of polyimide membrane (UMS-A5), the required membrane area is significantly reduced (from 12.7 to 1.7 m 2 ) while raising the feed gas pressure from 0.4 to 1 MPa. However, after a further increase in pressure from 1 to 1.6 MPa, the membrane area drops only to 0.7 m 2 . The same effect is observed for polysulfone membrane used in PRISM PA1020, except that the required membrane area is much higher and is equal to 56.7, 13.6 and 0.6 m 2 for a pressure of 0.4, 0.8 and 1.2 MPa, respectively. The other difference between the two membrane materials is the shape of the concentration profile of methane in the retentate. In the case of polyimide from UMS-A5, CH 4 content in retentate continues to rise monotonically with an increase in membrane area after passing the 96 vol.% thresholds. On the other hand, in polysulfone membrane, the methane concentration passes through this threshold and, after reaching a maximum, decreases with a further increase in membrane area, which is the sign that a significant amount of this gas is derived from the product to the permeate. This lower general separation performance of the polysulfone membrane, in comparison with the polyimide one, follows from lower permeance of components, which are accompanying methane in biogas, and lower ideal selectivity, as was shown in Table 2.  The recovery of methane which is associated with 96 vol.% of CH4 on the concentration profiles in Figure 7; Figure 8 is equal to 53.4, 82.5 and 88.6% at 0.4, 1 and 1.6 MPa, respectively, for the polyimide membrane and 30, 61.8 and 71.6% at 0.4, 0.8 and 1.2 MPa, respectively, for the polysulfone one. At the highest pressures, this recovery is in line with theoretical data concerning the trade-off between CH4 purity and CH4 recovery, reported by Scholz et al. [19] for the separation of 50% CO2 and 50% CH4. Methane recovery is presented in Figure 9; Figure 10 as a function of membrane area at the different feed gas pressure along with carbon dioxide concentration and recovery in permeate. The values of CH4 recovery at higher pressures are thus acceptable in the case of the one-stage  [19] for the separation of 50% CO 2 and 50% CH 4 . Methane recovery is presented in Figures 9 and 10 as a function of membrane area at the different feed gas pressure along with carbon dioxide concentration and recovery in permeate. The values of CH 4 recovery at higher pressures are thus acceptable in the case of the one-stage system based on the polysulfone membrane, and even very good for the polyimide membrane. Thus, it can be stated that an upgrade of this particular biogas to biomethane is possible in a one-stage membrane process based on UMS-A5 or PRISM PA1020 module types. However, as is discussed in detail in the following section, a high methane recovery is not necessarily accompanied by a favorable relationship between thermal power, carried with the biomethane stream, and the electric power necessary to carry out the essential separation process. stream and further enriched in the next membrane stage. In Figure 10 was shown a case when 80% of carbon dioxide is to be recovered in a one-stage system with Air Products polysulfone membrane. In this case, purity of 82.8 vol.% CO2 in permeate can be achieved at 0.4 MPa and the membrane area of 12.7 m 2 . When raising the feed gas pressure to 0.8 MPa, the CO2 purity is increased to 90.2 vol.% and the membrane area is decreased to 3.2 m 2 . The corresponding methane recovery in the retentate stream is equal to 85.7 and 92.4% at 0.4 and 0.8 MPa, respectively.

Biogas Enrichment in Two-Stage Configuration and Its Energy Efficiency
In a two-stage configuration considered in this paper, the CH4-enriched stream derived as retentate from the first stage is fed to the second membrane stage after a further compression (cf. Figure 6). It was assumed that feed gas pressure (and, accordingly, the retentate pressure) in the first stage was equal to 0.4, 0.6 or 0.8 MPa. The pressure of feed gas at the inlet to the second membrane stage was further increased (up to 1.6 MPa in the case of the module with UBE polyimide membrane and up to 1.2 MPa in the case of the module with Air Products polysulfone membrane). As mentioned above, in the first membrane stage, the majority of carbon dioxide amount is intended to be removed from the biogas. Thus, in the case of polyimide membrane, it was assumed that CO2 concentration in permeate derived from the first stage should be at least 95 vol.% at the given flow rate, pressure and composition of biogas as well as the membrane area. The latter was determined in the single-stage simulations discussed in the previous section. For the second membrane material, it was assumed that 80% of CO2 is recovered from biogas in the first stage. The parameters concerning this stage (pressure, membrane area, the composition of retentate and permeate) were summarized in Table 4. Retentate composition and flow Carbon dioxide in the feed biogas is a ballast, which should be compressed before separation, and the main component of permeate-the waste stream from the process. Therefore, the general efficacy of a membrane biogas upgrade process is closely related to the effectiveness of the transport of large amounts of CO 2 through the membrane. From this point of view, the biogas upgrading process may also be associated with carbon dioxide capture [10]. Since carbon dioxide has the highest permeance and CH 4 /CO 2 ideal selectivity, it can be removed to a large degree in the first stage of a two-stage process at the lower feed gas pressure. The separation goal in such a first stage may be focused on the obtaining of a CO 2 -rich stream for further treatment and utilization or a high CO 2 recovery. As it was shown in Figure 9, when the goal is on 95 vol.% of the CO 2 purity in permeate, 55% of carbon dioxide could be initially removed in a stage with the UBE polyimide membrane of 0.76 m 2 . When the pressure is increased to 1 MPa, the CO 2 recovery is raised to 86.4% and the required membrane area drops to 0.39 m 2 . At the same time, 97.7% (at 0.4 MPa) and 96.4% (at 1 MPa) of methane may be recovered in the retentate stream and further enriched in the next membrane stage. In Figure 10 was shown a case when 80% of carbon dioxide is to be recovered in a one-stage system with Air Products polysulfone membrane. In this case, purity of 82.8 vol.% CO 2 in permeate can be achieved at 0.4 MPa and the membrane area of 12.7 m 2 . When raising the feed gas pressure to 0.8 MPa, the CO 2 purity is increased to 90.2 vol.% and the membrane area is decreased to 3.2 m 2 . The corresponding methane recovery in the retentate stream is equal to 85.7 and 92.4% at 0.4 and 0.8 MPa, respectively.

Biogas Enrichment in Two-Stage Configuration and Its Energy Efficiency
In a two-stage configuration considered in this paper, the CH 4 -enriched stream derived as retentate from the first stage is fed to the second membrane stage after a further compression (cf. Figure 6). It was assumed that feed gas pressure (and, accordingly, the retentate pressure) in the first stage was equal to 0.4, 0.6 or 0.8 MPa. The pressure of feed gas at the inlet to the second membrane stage was further increased (up to 1.6 MPa in the case of the module with UBE polyimide membrane and up to 1.2 MPa in the case of the module with Air Products polysulfone membrane). As mentioned above, in the first membrane stage, the majority of carbon dioxide amount is intended to be removed from the biogas. Thus, in the case of polyimide membrane, it was assumed that CO 2 concentration in permeate derived from the first stage should be at least 95 vol.% at the given flow rate, pressure and composition of biogas as well as the membrane area. The latter was determined in the single-stage simulations discussed in the previous section. For the second membrane material, it was assumed that 80% of CO 2 is recovered from biogas in the first stage. The parameters concerning this stage (pressure, membrane area, the composition of retentate and permeate) were summarized in Table 4. Retentate composition and flow rate in the table are the inlet gas parameters for stage 2. Table 4. Parameters in the first stage of the two-stage membrane system, when CO 2 concentration in this stage is 95 vol.% (polyimide membrane) or CO 2 recovery in this stage is 80% (polysulfone membrane). All simulation cases were summarized in Tables S1-S8 in the supplementary material. Figures 11 and 12 show the membrane productivity and power excess index as a function of inlet gas pressure to stage 2 at the different feed gas pressure in stage 1, when CH 4 concentration in retentate derived from stage 2 reaches 96 vol.%. As it was explained earlier, in this particular separation case, it means that the concentrations of other mixture components are below their respective thresholds required for biomethane. The appropriate results for the single-stage system are represented by green lines and serve as a reference. As can be seen in the figures, the membrane productivity drops when the process is split into two stages. The difference in this indicator, as compared to the single-stage system, is the highest when the pressure in the first stage (p s1 ) is equal to 0.4 MPa, and in a general case is also increased, with the rise in the pressure in the second stage. When the feed gas pressure in the first stage is increased, the membrane productivity tends to be closer to that of the single-stage system. An adverse influence of the process splitting into two stages on the membrane productivity is much more pronounced when the separation in the first stage is focused on a high CO 2 recovery (cf. Figure 12). In this case, the membrane productivity is generally an order of magnitude smaller, compared with that presented in Figure 11, due to the lower separation performance (in terms of permeance and ideal selectivity) of the polysulfone membrane in comparison with the polyimide one.   This reported drop in the membrane productivity is due to the fact that the membrane area required for the production of biogas which is in conformity with the country's regulations becomes higher in this separation case when an additional stage is introduced. Additionally, a drop in methane recovery, and hence in the biomethane stream, was observed in the two-stage system. Therefore, in the case presented in Figure 11 the recovery changes in the range of 53.4-88.6% and 53.4-87.5% in the one-and two-stage configuration, respectively, within the pressure range of 0.4-1.6 MPa. In the second case (cf. Figure 12), the recovery varies in the range of 30.1-71.6% and 30.3-65% in the oneand two-stage configurations, respectively, within the pressure range of 0.4-1.2 MPa (cf. Tables S1-S8 in the supplementary material). The membrane productivity used in this study translates in a simple way to membrane specific area. Therefore, for example, the membrane productivity of 4.06-38.33 kW th m −2 (UMS-A5, one-stage, 0.6-1.6 MPa) is equivalent to 1.25-0.28 m 2 h m −3 (STP) of membrane specific area, as referred to biomethane flow rate. This is in line with data reported by Scholz et al. (1.57-1.7 m 2 h m −3 (STP)) for the system with a much higher biogas flow rate of 1000 m 3 (STP) h −1 [19].

Conclusions
The upgrading of biogas from a small (5 m 3 (STP) h −1 ) agricultural source in southern Poland into biomethane in membrane processes, based on membranes made from modified polysulfone and polyimide, available in the market in Air Products PRISM PA1020 and UBE UMS-A5 modules, respectively, was comprehensively investigated. It was theoretically shown that this is possible to obtain, in such a process, the stream of at least 96 vol.% of CH4 purity with the concentration of the other biogas components below their respective thresholds, as required in Poland for gas fuel "E", with methane recovery of up to 87.5% and 71.6% for polyimide (UMS-A5) and polysulfone (PA1020), respectively. It was found that both membrane materials are comparable in terms of power excess index, A real benefit of introducing a simple two-stage system for this particular case of smallscale separation system lies in the increase in the heat power in the stream of biomethane as related to the total power required for gas compression in the process. As can be seen in Figure 11, power excess index (green dashed line) in the one-stage system, based on a polyimide UBE membrane, is monotonically decreasing from 47.2 to 32.4 kW th kW el −1 with an increase in the feed gas pressure. In the two-stage system and at the inlet biogas pressure of 0.4 MPa this index is initially raising with the inlet gas pressure raise in stage two, then passes through a maximum (51.3 kW th kW el −1 ) at p s2 = 0.6 MPa and is decreasing after a further pressure raise. The relative difference between the power excess index in the single and two-stage system raises from 14.1% at 0.6 MPa to 37.9% at 1.6 MPa. The course of the power excess lines is similar at p s1 of 0.6 and 0.8 MPa, i.e a maximum is observed, however the difference between two-and one-stage configuration becomes smaller when p s1 is increased. The power excess maxima can also be seen in Figure 12 at p s1 of 0.4 and 0.6 MPa, but they are moved towards higher p s2 pressures, equal, respectively to 1 and 1.1 MPa. The highest value of the power excess index, as seen in Figure 12 (40.7 kW th kW el −1 at p s1 = 0.4 MPa and p s2 = 1 MPa), is smaller than in the other case, mainly due to the lower flow rate of biomethane, which is derived in this case. When the separation in the first stage is focused on a high CO 2 recovery, this leads to a drop in methane recovery in this stage (cf. Table 4) and consequently in the entire two-stage system, which is only strengthened by the lower ideal CH 4 /CO 2 selectivity in a polysulfone membrane, as compared with the polyimide one.
In this particular separation case, and the configuration with polyimide membrane, we focused in the first stage on a high CO 2 purity ( Figure 11); the highest efficacy from an energetic point of view is reached when the membrane productivity is rather moderate (7.06 kW th m −2 at 0.6 MPa, two stages) and there is no significant difference between the one-stage system and the two-stage system. For the lowest power excess index (32.4 kW th kW el −1 at 1.6 MPa) the highest membrane productivity is also reported (38.3 kW th m −2 ), and both values concern the one-stage configuration. In the case of polyimide UBE membrane, the limiting values of the power excess index of 32.4 kW th kW el (STP)) for the system with the biogas flow rate of 1000 m 3 (STP) h −1 [19] and by Struk et al. (0.14-0.26 kWh el m −3 (STP)) as a general index for membrane biogas upgrading processes [8].
It seems that the indicators discussed above are high enough to think about the profitability of investing in a small-scale membrane installation for the production of biomethane. Making a very rough costs estimation should make this issue more clear. In terms of current unit costs of gas fuel "E" (0.0245 euro kWh th −1 ) and electricity (0.1373 euro kWh el −1 ) for households in Poland, the power excess index translates to 9.15 (=51.3 × 0.0245/0.1373) and 5.78 (=32.4 × 0.0245/0.1373) for its two limiting cases, presented in Figure 11. Thus, one can expect that the investment in such a membrane unit for the biogas upgrade should be beneficial from the point of view of exploitation cost. The same may be true in the configuration with polysulfone membrane and focused on the high CO 2 recovery in the first stage (cf. Figure 12), where the power excess index, as expressed in the unit costs of energy carriers, varies at 1.2 MPa from 5.42 (one-stage system) to 7.23 (two-stage system, p s1 = 0.4 MPa). On the other hand, one can assess a prospective yearly economic profit from the unit area of membranes, based on the membrane productivity, which may serve as a reference concerning a ceiling for annual investment costs. Assuming that the operating time of the membrane upgrade installation during the year is 8000 h and in the configuration with polyimide membrane, we obtain 1383.8 euro m −2 year −1 (=7.06 × 8000 × 0.0245) at 0.6 MPa in two stages (cf. Figure 11), and 7506.8 euro m −2 year −1 (=38.3 × 8000 × 0.0245) at 1.6 MPa in one stage. In the configuration with polysulfone membranes, the expected membrane productivity was smaller, with 3.13 and 1.08 kW th m −2 at 1.2 MPa, for one and two-stage system, which leads to 613.5 and 211.7 euro m −2 year −1 , respectively. It is difficult to assess how it relates to the current cost of the membrane module layout. It seems, however, that there is a chance, especially in the case of a system build on polysulfone (UBE UMS-A5) membrane, for a return on investment in a reasonable payback period and economic income.

Conclusions
The upgrading of biogas from a small (5 m 3 (STP) h −1 ) agricultural source in southern Poland into biomethane in membrane processes, based on membranes made from modified polysulfone and polyimide, available in the market in Air Products PRISM PA1020 and UBE UMS-A5 modules, respectively, was comprehensively investigated. It was theoretically shown that this is possible to obtain, in such a process, the stream of at least 96 vol.% of CH 4 purity with the concentration of the other biogas components below their respective thresholds, as required in Poland for gas fuel "E", with methane recovery of up to 87.5% and 71.6% for polyimide (UMS-A5) and polysulfone (PA1020), respectively. It was found that both membrane materials are comparable in terms of power excess index, which was as high as 51.3 kW th kW el −1 and 40.7 kW th kW el −1 in the case of polyimide and polysulfone, respectively. In turn, the membrane productivity was significantly higher in configurations with the polyimide (UMS-A5) membrane (up to 38.3 kW th m −2 at 1.6 MPa with one stage) than those based on polysulfone (PA1020) membrane (up to 3.13 kW th m −2 at 1.2 MPa with one stage).
The mathematical model, which was used in the analysis, has been validated against experimental data concerning the separation of CH 4 /CO 2 in the PA1020 and UMS-A5 modules, with a satisfactory general agreement between the experiment and simulations. It was found, however, that in this particular separation case the competitive sorption in fractional free volume may lead to the change in permeances of both mixture components, which should be taken into account in the strict design and optimization of a membrane biogas upgrade process, based on membranes, used in UMS-A5 or PA1020 modules.
As a result of a rough costs estimation of a small-scale, membrane installation for the production of biomethane it was concluded that there is a chance, especially in the case of a system build on polysulfone (UBE UMS-A5) membrane, for a return on investment in a reasonable payback period and economic income. However, a strict economic analysis is required, which will embrace, among others, such issues as biogas pretreatment before basic membrane separation, biomethane utilization (sale to gas fuel "E" network and/or internal consumption), second product utilization (CO 2 -rich gas), a trade-off between investment costs and energy consumption, final system configuration (one or two-stage), and level of support for investors. This is, however, an independent and wide research topic that goes beyond the goal and volume of this study. We would like to address it in a separate study, which will be communicated in due course.
Supplementary Materials: The following are available online at https://www.mdpi.com/article/10 .3390/membranes11120938/s1, Table S1: Results of the simulation of the biogas one-stage upgrade process with the polyimide membrane (UBE, UMS-A5), Table S2: Results of the simulation of the biogas two-stage upgrade process with the polyimide membrane (UBE, UMS-A5) and the pressure in the first stage of 0.4 MPa, Table S3: Results of the simulation of the biogas two-stage upgrade process with the polyimide membrane (UBE, UMS-A5) and the pressure in the first stage of 0.6 MPa, Table S4: Results of the simulation of the biogas two-stage upgrade process with the polyimide membrane (UBE, UMS-A5) and the pressure in the first stage of 0.8 MPa, Table S5: Results of the simulation of the biogas one-stage upgrade process with the polysulfone membrane (Air Products, PRISM PA1020), Table S6: Results of the simulation of the biogas two-stage upgrade process with the polysulfone membrane (Air Products, PRISM PA1020) and the pressure in the first stage of 0.4 MPa, Table S7: Results of the simulation of the biogas two-stage upgrade process with the polysulfone membrane (Air Products, PRISM PA1020) and the pressure in the first stage of 0.6 MPa, Table S8: Results of the simulation of the biogas two-stage upgrade process with the polysulfone membrane (Air Products, PRISM PA1020) and the pressure in the first stage of 0.8 MPa.