Introduction

With regard to the transformation of the energy system towards renewable energy sources, there is a transition from fossil fuels to green fuels. Gaseous green fuels are mostly based on methane or hydrogen resulting from many different production processes. Electrical energy from wind or solar power can be transformed and stored in chemical form as hydrogen or hydrocarbons. The resulting hydrogen may be used to enrich methane. Biogas from biomass or organic waste is a mixture of several gases, with the main components methane and carbon dioxide. Hydrogen may also be used to enrich methane.

For a successful transition, the use of these gases and gas mixtures as fuels has been investigated with regard to combustion and operation of furnaces and engines. In addition, questions referring to the storage of these gases and gas mixtures have to be addressed. For a high volumetric storage capacity of green gaseous fuels like methane and hydrogen, the gases have to be compressed to very high pressures (up to 100 bar for methane and up to 700 bar for hydrogen) or cooled to very low temperatures (− 160°C for methane and − 250°C for hydrogen). The demand of the energy needed for compression and cooling is relatively high with regard to the stored energy in the gaseous fuels. In addition, the demands on the storage equipment for very high pressures and very low temperatures are high, leading to expensive storage vessels (i.e., type IV tanks for hydrogen storage and double-walled cryotanks). These factors prohibit the propagation of gaseous fuels.

A less expensive alternative is adsorption storage, using the adhesion of the gas particles on the wall of a porous material like nano-carbons, metal–organic frameworks, or metal hydrides.1,2,3,4,5,6 Thus, in a tank with fixed volume at a given pressure and temperature level, more gas can be stored together with the porous adsorbent material.

Much research7,8,9,10,11,12,13 has been carried out into appropriate adsorption material: on the one hand, it should have a high volumetric and gravimetric storage capacity, ideally at ambient conditions, while on the other hand, it should be produced readily and conveniently. The range of possible materials extends from reprocessed waste to designed structures in the nano-range. In addition to physisorptive bonding, chemisorption may also be used to enhance the bonding. Here, the focus is on the application and modeling of physical adsorption.

Due to the heat of adsorption, the temperature decreased during charging and increases during discharging, thus affecting the adsorption equilibriums: with decreasing temperature, the adsorption capacity decreases, while, with increasing temperature, the adsorption capacity increases. Thus, the ability of quickly charging or discharging the tank is influenced by the ability to adjust the temperature in the adsorbent. An optimization of the charging and discharging process includes the sizing of the tanks, the shape of the adsorbent material, additional cooling/heating of the tanks, adaption of the pressure level, and mass flow rates for single tank and tank bundles.

Adsorption gas storage is of particular interest for applications with high volumetric storage capacity, i.e., as fuel tanks in vehicles (e.g., ANG tank, Ingevity, North Charleston, SC, USA). Thus, some experience is already available concerning the storage of methane (natural gas) and hydrogen (for fuel cells).4,5,6,7,8,9,10,11,12,13,14,15,16 There are also seasonal energy storage applications (hydrogen stored in metal hydrides) for domestic use (e.g., LAVO Energy Storage, Sydney, Australia or Picea, Home Power Solutions, Berlin, Germany).

The charging and discharging has been modeled based on the adsorption equilibrium and the mass end energy balance. With regard to the distribution of the concentration and temperature, lumped parameter models and computational fluid dynamics (CFD) models14,15,16 have been used. For simple geometries and cooling by natural convection only, the temperature and pressure distribution is roughly uniform. For real-life applications, the geometries are more complex, and the distribution is not uniform. In order to reduce the time for charging and discharging, temperature control may be applied. With a large number of sorption and desorption cycles, the storage capacity deteriorates. With regard to the storage of gas mixtures, there are fewer data available.

Hydrogen storage in a cylindrical reaction chamber is described in Ref. 17 with an empirical model and a machine learning model based on data from a numerical simulation. In Ref. 18, an adsorption model based on machine learning methods successfully describes the adsorption behavior of supercritical CO2 and CH4 on three types of coal, based on measured data. Thus, in addition to physical models and empirical correlations, machine learning models are a viable alternative to describe the adsorption process.

Physical adsorption models are complex, leading to expensive computations. Therefore, a more efficient and effective approach for design and optimization purposes is desirable. One possibility is to use data-driven models which are computationally less expensive than the physical models based on nonlinear and differential equations. Here, we will develop a machine learning model for the adsorption equilibrium and the mass end energy balance. It might be used for the application of tanks with nearly constant temperature and concentration distribution in the adsorbent. It can also model the adsorption heat and mass transfer in a control volume implemented in a CFD simulation. Especially for the latter case, the iterative solution and time consuming coupling of additional differential equations is replaced by the solution of algebraic equations.

Here, the feasibility of replacing the physical model of the adsorption with a data-driven model and its application to the charging and discharging of gaseous fuels in adsorption tanks is investigated. The charging of a methane hydrogen mixture in activated carbon (NORIT RGM1) has been chosen as an example to implement this approach.

First, the governing equations and the output of the computations are presented. Then, the methods used for machine learning are described. Finally, the results are shown and the feasibility of this approach is discussed.

Physical Model

A lumped parameter model for a cylindrical adsorption tank with area-averaged pressure and temperature values has been derived based on the mass and energy balance equations and an adsorption isotherm model. This model is described in detail in Ref. 19.

The change in the gas mass stored in the tank results from the amount in the gas phase and the adsorbed phase, with the adsorbent total porosity known. The gas density has been computed with the ideal gas equation of state.

The inflow and outflow (mass flow rate) are prescribed. Charging has been implemented by a positive mass flux and an increase in pressure, discharging by a negative mass flux and decreasing pressure.

The changes of the averaged temperature are given by the energy balance resulting from the heat of adsorption and the heat flux to the ambient in dependence of the effective heat capacity, the heat transfer coefficient to the ambient, the exterior surface, the packing density, the heat of adsorption, and the amount of adsorbed gas.

The gas phase and the adsorbed phase are assumed to be in equilibrium and are described by the Dubinin–Astakhov equation for the adsorption isotherm. The adsorbed gas density was computed from the boiling temperature and liquid density at boiling point and the thermal expansion of the liquefied gases. The adsorption potential was determined by the saturated vapor pressure calculated from the critical values. The total volume adsorbed was computed from the pure vapor adsorption volumes, assuming volume proportionality. The reference amount for each component was calculated at the total pressure.

The data for the adsorbent (NORIT RGM1), are taken from the literature, as well as the data for the adsorbed gases and the property values.9 Mean values of the properties for the pressure and temperature range considered in the simulation have been used.

The differential equations were discretized with a Euler-forward scheme. The time steps were adjusted to ensure a steady change in the area-averaged pressure. The step size was chosen to ensure the independence of the numerical solution from the step size (average deviation smaller 1%). The adsorption equilibrium was solved at every time step by iteration. In order to facilitate the convergence and the computational effort, constant property values have been used.

Some of the results for the charging of methane and hydrogen are shown in Figs. 1, 2, and 3.

Fig. 1
figure 1

Charging of cylindrical 33-L tank filled with nano-carbon with gas. Pressure (a) and temperature (b) distribution for hydrogen, methane, carbon monoxide, carbon dioxide, and krypton at mass flux 3.9 10−3 kg/s; data from Ref. 19.

Fig. 2
figure 2

Charging of cylindrical 33L tank filled with nano-carbon with hydrogen. Pressure (a) and temperature (b) distribution for low mass flux 3.93 g/s and high mass flux 7.87 g/s; data from Ref. 19.

Fig. 3
figure 3

Charging of cylindrical 33-LKe tank filled with activated carbon with hydrogen. Pressure (a) and temperature (b) distribution for 0.482 g/s up to 35 bar, 3.85 g/s up to 350 bar, and 7.7 g/s up to 700 bar.

The computational costs are relatively high: the step size is restricted due to the explicit computation (of particular importance with high storage pressures as for hydrogen) and the adsorption equilibrium was solved by iteration. Thus, an alternative formulation, which is computationally significantly less expensive, is desirable. One possibility is to use a data-driven machine learning model.

Machine Learning Model

The final target is to develop a machine learning model which can act as a digital twin of the adsorption gas storage system. The significant amount of varied data can be computed by physical models validated by experimental results. As a first step, the feasibility of this approach has been investigated and appropriate methods identified.

We will investigate the prediction of the charging process of hydrogen, methane, carbon dioxide, carbon monoxide, and krypton in activated carbons in a cylindrical tank. The temperature, pressure, and the mass of the adsorbed species have been computed as a function of time, mass flow rate, maximum storage pressure, and cylinder height and diameter.

The methods used for machine learning are artificial neural networks (ANN) and Gauss process regression (GPR), and the models have been used as implemented in Matlab.20

The datasets used for training, validation, and testing were generated with the method described in Ref. 9, and the parameter ranges are shown in Table I. The ambient conditions were 300 K and 100 kPa. The parameters of the Dubinin–Astakhov equation are taken from the literature.21,22 As the data points are generated for each time step, there are significantly more data points in the time range than for the other variable ranges. The value range for NORIT RGM1pressure and mass span two orders of magnitude. The data ranges of the variables characterizing the species have only five supporting points for the chosen species.

Table I Parameter ranges of design variables for machine learning

Neural networks are suitable for large datasets with no prior input about the underlying features. They do not scale well for very large datasets. GPR is therefore used for modeling smaller datasets with some knowledge about the dependencies, and they do scale well for very large datasets.

The dataset available has been divided into a training and a validation set and, if possible, also a test set. The amount of data has to be sufficient. With the training/validation dataset, a five-fold cross validation was performed.

Neural Networks

For the machine learning task, ANN were used. An ANN is comprised of a network of artificial neurons (nodes) which are connected to each other. The input nodes take in information in a form which can be numerically expressed. This information is then passed through the network, through hidden layers, until it reaches the output nodes, then from node to node, based on the connection strengths (weights and biases) and the transfer functions. When the network is being trained, the difference between predicted values and actual values will be propagated backward so that the weights and biases of each node can be adjusted according to the error of that node.

The size (number of neurons) and number of hidden layers are varied, as well as the transfer function. A shallow network is sufficient for this problem. The transfer functions considered are the rectified linear unit, hyperbolic tangent, and sigmoid. The best results were obtained here using a rectified linear unit activation function. The Levenberg–Marquardt back propagation algorithm was used as a training function for the weights and biases. The neural networks were used as implemented in Matlab.20 The number of data needed to train and validate the neural network was investigated.

Gauss Process Regression (GPR)

GPR models have been widely used in machine learning applications because of their representative flexibility and inherent uncertainty measures over predictions. GPR is a non-parametric approach that can be used for regression problems and is particularly suited for small datasets. It is based on the assumption that the output variable is a realization of a Gaussian process, which is a collection of random variables, any finite number of which have a joint Gaussian distribution. First, a prior distribution is specified, then the probabilities are relocated based on the evidence (i.e., the observed data). Unknown points are predicted assuming a Gaussian distribution. The prior distribution is described by a mean function and a covariance function. The forms of the mean function and the covariance kernel function in the GPR are chosen and tuned during model selection. The mean function chosen is constant (mean of the training dataset) and the covariance kernel function chosen is varied using the function implemented in Matlab.20 Here, the best results were for the exponential kernel and the squared exponential kernel.

Results and Discussion

For the modeling of the dependence on the operating conditions and on the species concentration, respectively, a dataset of 1747 × 11 points for teaching and validation and a dataset of 1168 × 11 points for testing were computed. Two types of models were generated: models for single species (methane, hydrogen, carbon dioxide) and one model for all the species (methane, hydrogen, carbon dioxide, carbon monoxide, krypton).

As input variables, time, maximum storage pressure, mass flow, and tank diameter and height were used. The different gas species were characterized by their molecular weight, critical temperature, and critical pressure. The output variables were pressure, temperature, and adsorbed species concentration in the tank. Fivefold cross-validation was used for the teaching and validation datasets. The values of R2 were computed by Matlab as implemented, R2 = 1– ∑(yi−yi, Model)2/∑(yi−yMean)2 as well as the root mean square error (RMSE) = (∑(yi−yi, Model)2/n )1/2.

Some of the results of the machine learning and testing are shown in Tables II and III. There are only small differences with regard to the GPR method used (see Table II). The ANN with 2 layers of 10 neurons performs best of all the ANN, but still predicts worse than the GPR models (see Table II). The best results are for the GPR method with an exponential covariance function, so this ML model was chosen for the analysis. The training and validation data as well as the test data for the pressure and temperature values were predicted with very good accuracy. Nevertheless, the test data for the adsorbed mass was predicted with very poor accuracy by the all-species model (see Table III). The prediction of the test data with a one-species model was fairly accurate, with R2 equal to unity. Here, the amount and variety of the input data with regard to the constants of the adsorption isotherm model used in this analysis to generate the all-species model was not sufficient.

Table II Correlation results of machine learning pressure distribution
Table III Correlation results of machine leaning for the all-species-model, and different output variables

Using the one-species model, the charging of methane in a tank filled with activated carbon was computed and compared with measured data from the literature15 (see Fig. 4). The predicted values are slightly lower than the measured values, with an average deviation for the computed pressure of 20% and, for the computed temperature, of 17%. The deviations are higher for higher pressure values, as the modeling error accumulates during the charging process. The deviations of measured and computed data are mostly due to the simplifications with regard to the time- and space-averaged property values of the physical model used as basis for the machine learning model.

Fig. 4
figure 4

Charging of a cylindrical 1.82-L tank filled with activated carbon with 1 L/min, 10 L/min, and 30 L/min methane. Comparison of computed and measured values (data from Ref. 15) for pressure (a) and temperature (b).

Conclusion

Machine learning models are a viable approach to describe adsorption phenomena The generated machine learning models may be used to predict the charging process of gases like methane, hydrogen, carbon dioxide, carbon monoxide, or krypton in cylindrical tanks filled with activated carbon. The influence of tank geometry and the temperature and pressure transients during charging have been reproduced. Taking into account the distribution of the property values will improve the prediction of experimental values. Most challenging is the modeling of the adsorption characteristics and species properties. Here, the datasets used for teaching and validation should appropriately represent the value range, without regard to actual real materials and species.