1. Introduction
Ejectors are standard devices in the process industry for gas extraction or vapor from the specific system or container. An ejector can be considered as a compressor or vacuum pump, with no moving parts, relatively inexpensive and easy to maintain. It uses a high-pressure carrier fluid to drive a low-pressure suction fluid subject to an intermediate back pressure.
Despite the extensive use of ejectors, it is complex to predict mixture characteristics, mainly when operating with multiphase flows. Nevertheless, mixture pressure control is necessary to satisfy process requirements or avoid performance problems in most cases.
In this context, realizing a Digital Twin (DT) of the ejector can allow the operators to overcome these difficulties to have real-time control of the system performance. The notion of DT assumes a greater importance in a digital real-time image of a physical entity, system, or the like, which grants companies the performance improvement. The connection between the digital and physical systems is made easier thanks to the increased development of embedded sensors technology [
1], signal processing algorithms [
2], and wireless communications systems [
3,
4]. Since the DT provide a Realtime tracking of the physical world for monitoring, adjusting, and optimizing actual processes by various modeling techniques, such as simulation-, mathematics-, or data-based modeling.
In the literature, it is possible to find various techniques used to solve ejector modeling and theoretic and investigational analysis about motion in the multiphase fluids system. These techniques study the dynamic behavior of the ejector and the fluid-dynamic behavior of the liquids/gas passing through it to predict and optimize its operation considering several working conditions [
5]. Predicting ejector performance was one of the first approaches to ejector modeling that was proposed [
6]. The authors proposed a 1D analysis, i.e., a mathematical model using a set of algebraic equations, differential equations, and conservation equations of thermodynamics, which characterizes the behavior of the ejector. This method has also been used by other authors such as [
7]. In addition, one of the leading modeling/analysis techniques of ejector fluid dynamics behavior, still used today, is the Computational Fluid Dynamics analysis (CFD). For the purpose described above, various authors have used this technique [
8,
9,
10,
11]. CFD analysis can solve complicated equations, which characterize the motion of fluids, whose analytical resolution is instead feasible only when considering laminar (not turbulent) flows. This technique generally performs calculations/operations with a high computational cost. Reference [
12] introduced the Shock Circle Model and showed that the latter is more straight forward than the one-dimensional modeling approaches and can foresee the ejectors performance in binding modes with more precision.
The mentioned methodologies are characterized by the fact that they use vector calculations and algebraic/differential equations that can be complex. Moreover, sometimes they imply, for their resolution, the knowledge of certain physical quantities specific to fluids, such as enthalpy or entropy, which in many cases are not measurable. Another critical aspect to consider is that the model carried out does often have to interface easily with other components of the plant (pump and tank) to create a DT of the overall plant. Such complexities would make the realization of the virtual model of the ejector very complex or sometimes impossible.
By analyzing the literature, there are no papers that propose a DT for managing an ejector. The proposed approach tries to overcome this gap by developing a DT that, throughout the evaluation of steady states, the analysis of past problems, and the forecast of potential tendencies, can offer complete support in the decision-making process to comprehend the ejector behavior. The proposed DT framework is tested in an experimental plant for multiphase ejector modeling.
It is essential to highlight that most simulation applications could solve only one specific design and offline optimization [
13]. Thus, the application of DT features needed a significant change in the simulation approach [
14]. In light of this, the application of proper simulation techniques brings DTs to life, thus becoming testable [
15]. Hence, a Digital Twin Simulation Interface (DTSI) is essential for meeting all the requirements associated to the product or the simulation of the item life cycle. In particular, through customized interfaces, the interaction between the DT and the physical system can easily simulate different scenarios to identify proper actions to be applied to the second one.
In this paper, the Digital Twin is equipped with a simulation tool based on supervised machine learning techniques to overcome these problems and guarantee maximum interface ability and versatility. Through simulation tools, DT can help operators to understand physical objects as complex as an ejector system and predict the suction and motive fluids mixture characteristics.
The simulation model is one of the essential tools of the DT, and it must allow operators to examine the relationships established among the various variables of the problem. It must have low computational complexity and a low need for computational resources to minimize the system latency. For this reason, not only the Artificial Neural Networks (ANNs) but also the Swarm Intelligence (SI) algorithms have been decided to be used to evaluate as simulation tools. The implementation of SI algorithms is not complex, and the cost associated with these types of projects is not high, conversely to the ANNs. Moreover, the ANNs are essentially a “Black-Box”, which means that the networks do not allow to examine the relationships established among the various variables of the problem in the individual stages of elaboration but only provide “the obtained solution”. Finally, unlike the SI algorithms, ANNs present a high computational complexity. They need more computational resources. The proposed paper aims to demonstrate how emerging AI techniques, such as Swarm Intelligent algorithms, can allow developers to realize a valid tool for advanced system monitoring. In particular, they can be used onboard of the considered item with no strict requirements in terms of computational power and device features.
The proposed study is organized as follows:
Section 2.1 shows the multiphase system and ejector modeling literature review. A description of used techniques is briefly reported in terms of advantages, disadvantages, and application fields. Then,
Section 2.2 describes the Digital Twin framework used for the multiphase ejector installed in an experimental plant. In
Section 3, the research approach for developing the simulation tool and resulting models are described. Finally, in
Section 4, the discussion and conclusions are presented.
3. Results
The core of the DT framework proposed in this work is the simulation tool of the ejector. For this reason, this section focuses on explaining what steps have been taken to develop a supervised simulation model based on machine learning algorithms. The Glossary Section summarizes and describes the terminologies and abbreviations adopted in the text. All the realized algorithms have been implemented in a Matlab 2020 environment for research purposes and in python to be uploaded on a Raspberry device positioned onboard the ejector.
As mentioned above, it was chosen to opt for a supervised method because we needed a low-computational-cost tool. The model must easily interface with other Digital Twins of the plant (pump and tank).
The most-used supervised simulation models are Artificial Neural Networks (ANNs). In this work, the Swarm Intelligence (SI) algorithms were also tried because operators need to examine the relationships established among the various variables of the problem and not only the model result through a “black box”.
The development of both types of algorithms (ANNs and SI) for the simulation models followed the following steps:
Preprocessing—this consists of the preparation of the dataset for analysis. The preprocessing phase incorporates all the steps for the “preparation of the dataset”. The feature engineering step plays a fundamental role in how the data and the analysis previously made are used to create new entries within the dataset that allows the use of the machine learning system with as much information as possible.
Split Data—it is an analytical step to understand how best to train the machine learning system. There are two parts to machine learning systems: the first is “training”, which trains the system. Then, the system is ready to perform what has been learned and test whether the training performed in the previous phase was successful; this is conducted through the “score” or “test”.
Choice of Models and Comparison Method—the training needs input from the theoretical model to be used and trained. It is not necessary to choose in advance what the best model is. It is possible to train more models and choose the best performing one after the results are obtained.
Practical Comparison between the Models—the various algorithms are evaluated to choose the one that performs best in the model designed and developed. In general, the performance of the model in its generality is evaluated. Thus, the comparison of the involved algorithms is performed in terms of computational time in the proposed paper. All models are evaluated concerning the prediction accuracy, referring to the Variance Inflation Factor (VIF) and other indicators [
37].
3.1. Dataset
The data available collected experimentally represent the operating conditions under which the plant has worked over the years. In particular, taking into consideration the plant characteristics, the pressure and flow rate of the motive fluid (see
Figure 4 and
Figure 5), P
liq and Q
liq, vary from a minimum of 1.9 bar to a maximum of 10.38 bar and from a minimum of 1.44 m
3/h to a maximum of 282.39 m
3/h. The constraint pressure imposed on the tank, P
serb, varies from a minimum of 1 bar (atmospheric pressure) to a maximum of 3.8 bar. All possible ejector configurations are defined concerning the size of the fluid outlet nozzle diameter, D
1, and the diffuser, D
2 (from a minimum of 5.2 mm to a maximum of 62 mm). These parameters have a considerable influence on the determination of the flow rate of air sucked by the ejector, Q
gas, at atmospheric pressure (P
gas = P
atm). The pressure inside the diffuser, P
diff, varies from a minimum of 0.96 bar to a maximum of 1.96 bar.
Table 2 shows an extract of the data collected for the ejector configuration currently mounted on the system (D
1 = 11 mm and D
2 = 29 mm).
To identify the best model to be used for the digital twin realization, the available dataset has been normalized and divided into two classes: one for the model training and one for its testing. The same dataset has been used for both the ANN and SI evaluation to compare them more significantly.
3.2. The ANNs Model
An ANN is a set of artificial neurons that model those in a human brain. Each connection transmits a signal to the others like areal synapses. The “signal” is a real number, and the output is computed by functions that reprocess those inputs. A weight characterizes all neurons and connections and changes as learning progresses, increasing or decreasing the strength of the signal in the connection under consideration. In addition, neurons may have a threshold that inferiorly limits the transmitted signal. The learning rate describes the number of corrective steps that must be taken to fix errors in the observation. Specifically, a high learning rate shortens the training time with lower final accuracy, while a lower learning rate takes longer but is characterized by better accuracy. To avoid network oscillations, the improvements use an adaptive learning rate to increase or decrease as appropriate. The momentum concept allows the balance between the gradient and the last change to be weighted so that the weight adjustment depends to some extent on the last change. In this work, the momentum and batch size parameters have been set to equal 0.9 and 150, respectively. The momentum has been fixed according to [
38] since it is considered to be optimal. For evaluating the other parameters, a systematic trial has been carried out to evaluate the best configuration. Specifically, the number of network neurons increases from 1 to 40; the hidden layers range between 1 and 2 (since the dataset is not so complex); the epochs numbers range from 1 to 1000; and, finally, the learning rate is evaluated to be 0.01, 0.05, and 0.1. The activation function between the various layers is logistic, while the optimization algorithm used is a gradient descent.
Once the systematic experimentation has been performed, the best configurations are selected for each adapted learning rate (0.01–0.05–0.1), at 1–10 neurons, 10–20 neurons, and 20–40 neurons. At this stage, the best configuration is defined by evaluating the prediction accuracy on the test dataset.
Comparing the observed variable with what was obtained from the neural model with 1 hidden layer and 10 neurons (
Figure 6) shows that the interpolation error is contained. The model realized correctly follows the air intake flow rate measured by the system. In particular, the mean quadratic error (MSE) obtained from the training dataset is equal to 8.25 × 10
−11 (comparable to zero, given the machine error committed using the Matlab software).
Using then, a percentage of about 15% of the original dataset both to perform a first testing and model validation, we obtain for the first case an MSE equal to 3.29 × 10−9 and in the second case equal to 1.09 × 10−9. The correlation between the observed and estimated signal is about 0.9123 (p-value equal to 3.2546 × 10−28 at a significance level set at 5%). Given the R-value of the Pearson index and considering that the p-value is much lower than the level of significance, there is a strong correlation.
The multilayer perceptron (MLP) neural network with two hidden levels, the number of the input and output neurons, activation function, and activation algorithm that are concerned, retains the same characteristics as the one-level hidden network.
The same considerations of the hidden-layer model can be made for the two-hidden-layers neural network. Comparing the observed variable with the one obtained by the neural model (
Figure 7) shows how the interpolation error is contained and how the realized model correctly follows the air intake flow rate measured by the system. In particular, the mean quadratic error (MSE) obtained from the training dataset is equal to 1.49 × 10
−10; therefore, given the machine error committed using the Matlab software, it is comparable to zero.
Comparing the results and the performance obtained with one-hidden-layer neural network model (ten neurons) and two hidden layers shows that the improvements do not differ. This implies that, with the same dataset, using a more complex network does not improve the performance of the simpler network.
3.3. The SI Model
Among the bioinspired algorithms, a particular class of algorithms has been developed, taking inspiration from the intelligence of the swarm. The algorithms in this class are swarm intelligence, also called Si-based. In particular, the SI techniques aim to determine the optimal solution of a given problem, exploiting the global behavior of a “swarm” of homogeneous agents. While each agent can be considered “non-intelligent”, the whole system of several agents shows a self-organizing behavior guaranteeing a sort of collective intelligence. Each agent shares information and experiences, managing, in this way, to solve even very complex tasks. The Swarm Intelligence group is vast and includes procedures that take into consideration the collective behavior of insects, such as ants, bees, and fireflies, and other animals such as flocks of birds, shoals of fish, and wolves. The main algorithms belonging to this class are Particle Swarm Optimization (PSO), Artificial Bee Colony algorithm (ABC), and Ant Colony Optimization (ACO). These are agent-based optimization techniques specific to problems in which the objective function can be decomposed into independent partial functions. Each agent maintains a hypothesis that is tested iteratively by evaluating a randomly chosen partial objective function.
In this study, eight SI algorithms were tested to identify the ejector model, and several functions were implemented concerning the parameters.
Figure 8 briefly describes the general framework used by SI algorithms.
The user defines the swarm population size (nPop) and the maximum iterations number (MaxIt) at the initial step. At this point, for each swarm member, an initial position and its relative positional cost are defined according to a specific function decided by the user. In this paper, the Root Mean Squared Error was chosen since it describes the data concentration around the best fit line.
The position with the minimum cost value is assumed to be the temporary best solution. The iterative phase starts until the maximum number of iterations is reached, or the error between the solutions of two consecutive iterations is equal to a fixed threshold. According to the specific SI algorithm adopted, each position is corrected with respect to the best one during this phase. Specifically, it is possible to refer to
Table 3 to analyze how each algorithm defines the new position for each swarm member.
Table 4 shows an extract of the analyzed scenarios (experiment number, intercept present or not, function type, population size, and maximum iteration number).
Table A1, in
Appendix A, shows all the functions, f, considered in the scenarios analysis.
The essential parameters for using the SI algorithms and the regression function are the number of maximum iterations to perform (MaxIt) and the agents number to use for the solution determination (nPop). Specifically, several simulations were carried out to test the various algorithms examined, each of which considers a particular function, a value of iterations between 30 and 90, and, finally, a swarm size between 30 and 90, for 144 simulative scenarios.
The different scenarios aim to identify the best parametric combination so that the solution is the best possible in terms of error for the observed signal but at the same time involves an acceptable computational effort and is evaluated in terms of calculation time.
In particular, the choice of the agents number in the swarm and the iterations number is fundamental to the computational balance since the total iterations number up to the end of the algorithm is equal to (nPop × MaxIt). The demonstration of the above is reported, although only in some cases, in
Table 5.
It is evident that as the combination of swarm size and the maximum number of iterations increase, the reliability of all the algorithms decreases enormously until the algorithm in question cannot be used. An example is the Bat Colony that is computationally expensive and without a positive effect on the system. The values are obtained considering the averages of the parameters for all sixteen functions considered.
By limiting the analysis to only good computational and estimation accuracy algorithms,
Table 6 shows the models with high correlation and solution validity (Variance Inflation Factor (VIF) is more significant than 5), which all correspond to the linear model with zero intercept.
Comparing VIF and Time composition for the considered algorithms, the best estimating algorithm for the realization of the digital ejector twin through SI algorithms is the Grey Wolf with a swarm size equal to 60 and the number of maximum iterations equal to 60 (the mathematical model reported in Equation (1)). Regardless, Relative Standard Deviation (RSD) analysis highlights how the SI algorithms are affected considerably by the set of parameters since the high values referred to each algorithm [
49].
An example of the fitting is shown in
Figure 9. It shows a mean absolute error equal to 0.4 m
3/h and a standard deviation equal to 0.5 m
3/h for an adjusted R2 value equal to 0.998 and a
p-value close to 0, considering an alpha of 0.05.
3.4. Model Selection
Several tests have been performed to evaluate the optimal model to be implemented as Digital Twins of the ejector, and some are summarized in
Table 7. Specifically, they concern possible operating situations of the plant in question considering the current configuration, i.e., with D1 = 11 mm and D2 = 29 mm.
Figure 10 shows the comparisons between the airflow rate measured on the system and those estimated using the neural network at a hidden level and ten neurons and the Grey Wolf model. Both the neural network and the SI model correctly follow the real one, despite the oscillations it shows. In any case, the neural network constantly shows a significant deviation from the actual value.
Tests 1 and 2 show an overestimation of the actual value, while tests 3 and 4 show an underestimation. By contrast, the model realized through swarm intelligence algorithms presents a behavior constantly superimposed on the real one and much more stable than the neural model.
Table 8 and
Figure 11 show how the variability of the estimation error obtained with the neural network presents a minor variability but a very high average estimation error. The average error ranged from a minimum of about 0.42 m
3/h to a maximum of 1.33 m
3/h on all the tests considered. The standard deviations of the error, when related to the relative mean value, show very low relative standard deviations. By contrast, the variability of the estimation error obtained with the Grey Wolf algorithm has a higher variability but a deficient average estimation error. The average error ranged from a minimum of about 0.38 m
3/h to a maximum of 0.57 m
3/h on all tests considered. The standard deviations of the errors, when related to the relative mean value (Relative Standard Deviation), show very high, albeit minor, relative standard deviations.
Following these experiments and considering the need to realize a light computational application, between ANN and the one through Swarm Intelligence, the second one was chosen to realize the Digital Twin of the ejector present in the plant. The demonstration is summarized in
Table 9 and
Figure 12.
The
t-test returns an evaluation on the null hypothesis that the estimated data originated from a Gaussian distribution with a zero mean and unknown variance. The alternative hypothesis is that the distribution has no null mean. The H0 result, in
Table 9, is 1, if the test rejects the null hypothesis at the 5% (or 10%) significance level and 0 otherwise. The value
p is the probability of observing a more extreme test statistic than the value observed under the null hypothesis. Small values of
p question the validity of the null hypothesis, and, in particular, for all tests obtained with ANN, the null hypothesis is rejected (H0 = 1), and the
p-value is close to zero. The Pearson test computes the correlation coefficients and
p-values of a normally distributed variable.
Table 9 shows in the Pearson section the correlation coefficient R and the relative
p-values for testing the null hypothesis. Moreover, Rl and Ru identify the lower and upper bounds for a (1-α) confidence interval.
The smaller
p-values related to SI interpolations than NN underline how the SI algorithms perform a better estimation than the artificial neural network. Indeed, by analyzing
Figure 12, it is possible to see how the relationship between the actual inlet air flow rate and the esteemed one is quite linear.
The realized estimator was connected to the actual plant, and the working conditions, not used for the estimation phase, were tested to validate the obtained estimator.
Figure 13 compares the actual airflow rate (blue line) and the esteemed one (red line) considering the inlet water flow rate (Q
liq) to be equal to about 10 m
3/h at a pressure (PresLiq) equal to about 5.5 bar and the internal tank pressure (PresSerb) equal to 1.5 bar.
The actual mean value for the inlet air flow rate (Qgas) is about 13.9 m3/h with a standard deviation equal to 0.22 m3/h; conversely, concerning the esteemed variable Q*gas, its mean value is equal to 14.12 m3/h, and standard deviation is equal to 0.04 m3/h.
Always considering the working conditions explained before, at cycle 142 for 500 cycles, the valve VM7 (see
Figure 3) was opened to simulate a tank loss of pressure. The VM7 total opening implies a value of pressure inside the tank approximately equal to that of the atmosphere. In the absence of a pressure constraint, the actual inlet air flow rate is more significant than 13.9 m
3/h, the value identified in the regime condition. By analyzing
Figure 14, this increase is evident both for the actual value (blue line) and the esteemed one (red line).
Figure 13 and
Figure 14 show a reasonable estimation of the inlet air flow rate with an estimation error close to 3% that can be considered suitable since the numerical approximation is due to the adopted algorithms and the noise introduced by the sensors. The research has highlighted the necessity of revamping some old sensors with a high noise level on the readings.
4. Discussion and Conclusions
This paper proposes a reference model for implementing a Digital Twin of an ejector system operating with multiphase flows to analyze and predict the system performance.
The model encompasses all the critical phases of Digital Twin design and implementation. It starts with the analysis of the existing system. It ends by developing a helpful platform for researchers and technicians to provide a means to simulate and investigate scenarios that are otherwise too costly to explore. Moreover, the realization of a Digital Twin of the ejector aims at allowing the operators to have real-time control of the suction and motive fluids mixture performance.
The DT platform must be lean and easy to use. It must allow for the integrated management of all installation components and the prediction of the ejector performance. It involves implementing digital components that can be integrated without excessive computational effort so that the platform can be used by many users and on many different devices simultaneously. For this reason, a machine learning supervised model is necessary. Artificial Neural Networks and Swarm Intelligence algorithms were compared to identify the best one. Artificial Neural Networks were identified as the most used tool for the multiphase flow ejector, but, at the same time, no applications of Swarm Intelligence algorithms were identified for the same purpose. Swarm Intelligence algorithms were analyzed since they allow operators to examine the relationships established among the various variables of the problem in every individual stage of elaboration. Moreover, they require low computational complexity and low need for computational resources to minimize system latency.
Swarm Intelligence algorithms were identified as the best-performing ones for prediction error and computational effort by comparing the results. In particular, the Grey Wolf optimizer proved to be the best one among those used. The ease of implementation and use of the approach based on SI algorithms guarantees the possibility to realize the Digital Twin without problems. Moreover, its computational lightness allows for the improvement of the model continuously and almost instantaneously after new acquisitions.
During the test in the lab, it was possible to highlight the advantages and disadvantages of the use of the two methodologies.
Thanks to their structure, ANNs can work in parallel to process a lot of data while, in traditional calculators, each datum is processed individually and in succession. However, if some system units were to malfunction, the whole network would have performance reductions but would hardly meet with a blockage. Likewise, for SI algorithms, multiple agent systems can be easily parallelized so that large-scale optimization becomes more practical and faster from the implementation point of view. This property defines the ability of agents to perform a multitude of actions in different locations at the same time. It is fundamental, as it allows for the development of more flexible systems capable of self-organizing into groups that simultaneously consider different aspects of a particular problem. The multilayer perceptron has a nonconvex loss function in the presence of multiple local minima, highlighting how, in these cases, different random initializations of the weights can lead to different validation accuracies. Furthermore, the multilayer perceptron is related to numerous hyperparameters (the number of hidden neurons, layers, and iterations) and is sensitive to scaling characteristics.
By contrast, the search for an optimal solution in Swarm Intelligence does not rely on derived functions but on different social interaction mechanisms between artificial individuals.
Among the disadvantages of swarm intelligence, it is possible to mention premature convergence. Some types of SI (such as PSO) usually suffer from premature convergence when multiple optimization problems occur. The basis of this problem is that the particles converge at a single point, which is on the line between the best global positions and the best personal positions. In this way, the chances of being trapped in the local minimum are significantly reduced. The second disadvantage of SI algorithms is related to their sensitivity to the setting of various parameters. For example, increasing the value of inertia weight, w (in the PSO), increases the particle velocity resulting in increased exploration (global research) and lower concentration (local research) and vice versa. Setting parameters is therefore not an easy task and varies from problem to problem.
In this context, further research should focus on developing less sensitive approaches to the data provided with the same reliability as the results obtained.