Introduction

The separation processes developed based on membrane technology causes the creation of a new method to separate chemical components, and the method is completely different from conventional separation techniques existed in chemical/biochemical industries, especially in the purification. This method of purification can separate different components, and it can be used in small scales comparing to conventional technologies. The separation process in membrane technology results in several advantages compared to other conventional methods and purification systems, such as low separation cost, modular design, and low energy demand1,2.

This technology can be used in small channels (micro scale) that is an example of small scales or microscopic observation, but the technology creates a high capacity in the separation of different components in membrane technology. Among all membrane systems, the membrane contactor systems can separate chemical components and create reactions among chemical components in a very small domain. Other applications of membrane contactors incude: membrane crystallization3,4, wastewater treatment5,6, liquid extraction7,8, and gas absorption9,10,11.

Designing a membrane technology is possible in different mathematical and numerical methods such as computational fluid dynamics (CFD), mathematical and physical approximations, such as mechanistic modeling12,13,14. Recently, numerical methods or CFD were used as a tool for modeling the internal layers of the membrane system, and therefore, the mass transfer and chemical reaction among chemical components and membrane can be fully understood. CFD could model for the fluid flow and interaction among different phases, including solid, gas, and liquid. The CFD tools also could measure the heat and mass transfer in a system. CFD has widespread applications in different industries, including the industries that use membrane technology such as wastewater treatment. As far as the fluid movement and the interaction between the phases are two significant parameters in the membrane technology, the CFD could be a suitable tool for a better understanding of the process. CFD also enables the researchers to model and optimize different components of the membrane system; for instance, the geometry size of the membrane system can be optimized by using CFD simulations. Also, CFD enables us to do the numerical method for solving from small to large scales. CFD could provide us with exact understanding of membrane technology by the complex solving of the Navier–Stokes equations, and coupling the Navier–Stokes and mass transfer equation leading to a better understanding of the separation of components in a process. Artificial intelligence (AI) and CFD solution are used together due to the high costs of using CFD for optimizing the membrane technology and long time for designing a membrane technology via CFD, boundary limitation and complex flow conditions of CFD, and numerical instability; therefore, AI methods are trained from CFD and after the training process, AI provides the results in the different domains15,16. By creating the CFD results, AI can provide us with another solution that is faster than CFD. The solution is also far from numerical instability, complex boundary conditions that they existed in CFD. This stability in the calculation of AI is tightly coupled with “non-sense learning” mechanism in the AI method which means, AI can only train the dataset, and it cannot understand the physics behind the process, including the complex boundary conditions17. Recently, An adaptive neuro-fuzzy inference system (ANFIS) was used, which is a combination of fuzzy logic system and neural networks18. The method enables the researchers to transfer numerical results of CFD to the AI domain, and the local points in the membrane system could be predicted via AI.

Owing to this point that AI needs sensitivity to reach an exact and reliable solution that can be used many times in optimization of the membrane technology, training of the AI could be done in different ways, and changing the tuning parameters is needed in training that are the functions, or the number of nodes19. To do so, in the current research, the researchers study AI and change parameters in AI, including the number of inputs in training, membership functions to achieve an exact prediction that is reliable for the optimization process. The results were compared with Particle Swarm Optimization (PSOFIS), and Genetic Algorithm (GAFIS). The time for prediction and learning were compared to study the capability of the methods in prediction and their accuracy.

CFD method

Figure 1 shows a membrane contactor module, and from one side, the aqueous phase (feed) enters the module, and the organic fluid flows in the other side (shell side). Both phases are brought into contact using the membrane. As seen in the figure, the aqueous phase entered from different chambers to the membrane technology, and by the membrane technology, the chemical components can be separated from each other. For the separation solving process, the CFD was used; furthermore, the finite element method was utilized for the discretization of the complex Navier–Stokes equation formulas. By solving the Navier–Stokes equations, the approximate method of solving for the fluid concentration, the fluid velocity, and the fluid temperature could be accessed and calculated. Mass and momentum equations are computed in CFD simulation to represent component separation in the membrane structure. Equations to solve in the chamber are written, such as20,21,22:

$$D\left[ {\frac{{\partial^{2} C}}{{\partial r^{2} }} + \frac{1}{r}\frac{\partial C}{{\partial r}} + \frac{{\partial^{2} C}}{{\partial z^{2} }}} \right] = U\frac{\partial C}{{\partial z}}$$
(1)
$$\begin{aligned} & \rho \frac{\partial U}{{\partial t}} - \nabla \cdot \eta \left( {\nabla U + \left( {\nabla U} \right)^{T} } \right) + \rho \left( {U \cdot \nabla } \right)U + \nabla p = F \\ & \nabla \cdot U = 0 \\ \end{aligned}$$
(2)

where, C represents the concentration of species (mol/m3), and U shows the velocity distribution (m/s). \(r\) and \(z\) are geometry characteristics (m), p is pressure (Pa), and F is force (N). After the numerical method for solving the membrane technology, the CFD results were used in the training process of AI, and after that, the data were inserted in the fuzzy structure for the prediction process. As seen in Fig. 2, the CFD elements were added in the AI one by one. Each of the CFD elements includes the information from fluid concentration, and point by point position of the fluid. The data were inserted in AI and after the exact training of the data, a new domain was created that relates to the nodes of AI, and nodes of neural network. As seen in the figure, the nodes are very similar to CFD and again we have the separation in membrane technology when the aqueous fluid is inserted in the chambers, and from the other side, the organic fluid is inserted from one side and getting out of the system from another side.

Figure 1
figure 1

Schematic representation of membrane separation process technology studied in this work.

Figure 2
figure 2

Schematics of CFD node connection with artificial intelligence node and prediction framework for membrane separation process technology.

ANFIS method

ANFIS is a fuzzy inference system, precisely predicts the performance of nonlinear and complex systems23,24,25. Three different kinds of fuzzy reasoning exist where if–then rules proposed by Sugeno and Takagi are extensively run in ANFIS structure26. Figure 3 represents the structure of the ANFIS method for the estimation of the hydrodynamic features within the domain. The function of the ith rule is:

$${w}_{i}={\mu }_{Ai}\left(input1\right) {\mu }_{Bi}\left(input1\right){\mu }_{ci}(input1) {\mu }_{Di}(input1) {\mu }_{Ei}(input1)$$
(3)

in which wi represents the signal out-coming from the node of the second layer. Moreover, μAi, μBi, μCi, μDi and μEi indicate the signals incoming from MFs run on inputs, to the node of the 2nd layer. Within the 3rd layer, the relative value of each rule relating to the firing strength is determined, which is equivalent to the weight of each layer over the whole quantity of firing strengths of all rules:

$$\stackrel{-}{{w}_{i}}=\frac{{w}_{i}}{\sum \left({w}_{i}\right)}$$
(4)

where \(\stackrel{-}{{w}_{i}}\) denotes the normalized firing strengths. Layer 4 employed the function of a consequence if–then rule suggested by Sugeno and Takagi26.

Figure 3
figure 3

ANFIS structure, five inputs, number of MFs = 2.

Therefore, the node function is:

$$\stackrel{-}{{w}_{i}}{f}_{i}=\stackrel{-}{{w}_{i}}({p}_{i}(input1)+{q}_{i}(input2)+{r}_{i}(input3)+{s}_{i}(input4)+{t}_{i}(input5)+{u}_{i})$$
(5)

in which pi, qi, ri, , si, , ti, and ui represent the if–then parameter rules, which are called consequent parameters. \({f}_{i}\) can be also considered as output results and function of model. The signals incoming from the forth layer are combined to attain the model output representing the estimation outcome. Detailed description of ANFIS model has been reported elsewhere27.

Results and discussion

In this study, five parameters as input and one parameter as output have been considered for the ANFIS method. Parameter T (K), weight, pco (kpa), AARD, and alfa represent the 1st–5th input of the ANFIS method, respectively, with the prediction of species concentration representing as the ANFIS method output (see Fig. 4).

Figure 4
figure 4

System ANFIS, five inputs, one output, 32 rules.

In this study, a number of maximum 500 iterations are assumed, and the P which is indicative of the number of data participating in training process shall be as equal to 60%; the membership functions (MFs) in the present study is considered to be gauss2mf (Gaussian combination membership function). The learning process was evaluated, considering one input to examine the procedure of ANFIS capability. When the number of MFs is equal to 2, then regression(R) shall be equal to 0.31, indicating 31% intelligence achievement by the ANFIS method. In order to increase the ANFIS intelligence level, the increase in the number of MFs was assessed and in accordance with Fig. 5a,b, the R-value for the MFs = 3 shall be equal to 0.39 and if MFs = 4, then the R-value will reduce to 0.34, showing that a higher number of MFs will produce the minute effect on the increase in the ANFIS intelligence level. Accordingly, the increase in the number of inputs was evaluated. Given the number of MFs = 2, the increase in R-value to 0.69, demonstrates an increase of 38% in ANFIS intelligence compared to the conditions where the input value was equal to 1.

Figure 5
figure 5

(a) ANFIS training process (number of MFs = 2, 3, 4; one input; type of MFs = gauss2mf). (b) ANFIS testing process (number of MFs = 2, 3, 4; one input; type of MFs = gauss2mf).

When the number of inputs was low in the model, the regression was low and lower than 0.32, but by increasing the number of inputs, the AI algorithm led to an increase in the prediction capability of the model. Therefore, the model could complete the prediction with better accuracy. When the number of inputs increased to 4, the R-value reached 0.99, showing that the high accuracy of the model as well as its high capability in prediction.

This increase in the ANFIS is not sufficient to reach a complete intelligence, and to fulfill this goal, further increase in the number of MFs to 3 and 4 was again investigated. As per the Fig. 6a,b, the R-value for MF = 3 shall be equal to 0.72, and for the number of MF = 4, and the R-value is 0.69 (R = 0.69), which is the indicative of the fact that given the study obtained data, the increase in the number of MFs is not effective in increasing the ANFIS prediction capability.

Figure 6
figure 6

(a) ANFIS training process (number of MFs = 2, 3, 4; two input; type of MFs = gauss2mf). (b) ANFIS testing process (number of MFs = 2, 3, 4; two input; type of MFs = gauss2mf).

In the next stage of the study, an increase from 2 to 3 in the number of inputs with a MFs value of 2 was observed. As Fig. 7a,b show, the system has witnessed an appropriate value of the intelligence in training and testing processes, and the R-value for the testing process has been equal to 0.90, which means an ANFIS intelligence value of 90%. Since an increase in the number of MFs was not extensively effective in increasing the ANFIS prediction capability, the number of inputs was increased to 4, and the learning processes were performed for the number of MFs = 2. The findings, according to Fig. 8a,b are not indicative of any increase in the system intelligence compared with the conditions where the number of inputs is equal to 3. Hence, the number of inputs was increased to 5, and the training–testing processes were conducted with the number of MFs = 2. According to Fig. 9a,b a wonderful increase in the amount of ANFIS intelligence can be observed so that an R-value of 0.99 and 0.94 for training and testing respectively shows a sharp increase in the amount of ANFIS method intelligence to 94% level.

Figure 7
figure 7

(a) ANFIS training process (number of MFs = 2; three input; type of MFs = gauss2mf). (b) ANFIS testing process (number of MFs = 2; three input; type of MFs = gauss2mf).

Figure 8
figure 8

(a) ANFIS training process (number of MFs = 2; four input; type of MFs = gauss2mf). (b) ANFIS testing process (number of MFs = 2; four input; type of MFs = gauss2mf).

Figure 9
figure 9

(a) ANFIS training process (number of MFs = 2; five input; type of MFs = gauss2mf). (b) ANFIS testing process (number of MFs = 2; five input; type of MFs = gauss2mf).

Figure 10a,b represent a comparison between the output and target data pertaining to the ANFIS method for training and testing processes. Also, Fig. 11a–j illustrate a good consistency between the ANFIS target and ANFIS output considering various input values. This constitutes a significant qualification of the artificial intelligence thanks to which one can predict the points which were absent in the learning process(see Fig. 12a–j).

Figure 10
figure 10

(a) Training process targets and outputs data (number of MFs = 2; five input; type of MFs = gauss2mf). (b) Testing process targets and outputs data (number of MFs = 2; five input; type of MFs = gauss2mf).

Figure 11
figure 11figure 11figure 11figure 11

(a) ANFIS targets and outputs nodes correlation (inputs 1 and 2). (b) ANFIS targets and outputs nodes correlation (inputs 1 and 3). (c) ANFIS targets and outputs nodes correlation (inputs 1 and 4). (d) ANFIS targets and outputs nodes correlation (inputs 1 and 5). (e) ANFIS targets and outputs nodes correlation (inputs 2 and 3). (f) ANFIS targets and outputs nodes correlation (inputs 2 and 4). (g) ANFIS targets and outputs nodes correlation (inputs 2 and 5). (h) ANFIS targets and outputs nodes correlation (inputs 3 and 4). (i) ANFIS targets and outputs nodes correlation (inputs 3 and 5). (j) ANFIS targets and outputs nodes correlation (inputs 4 and 5).

Figure 12
figure 12figure 12figure 12figure 12

(a) ANFIS prediction surface (inputs 1 and 2). (b) ANFIS prediction surface (inputs 1 and 3). (c) ANFIS prediction surface (inputs 1 and 4). (d) ANFIS prediction surface (inputs 1 and 5). (e) ANFIS prediction surface (inputs 2 and 3). (f) ANFIS prediction surface (inputs 2 and 4). (g) ANFIS prediction surface (inputs 2 and 5). (h) ANFIS prediction surface (inputs 3 and 4). (i) ANFIS prediction surface (inputs 3 and 5). (j) ANFIS prediction surface (inputs 4 and 5).

The obtained results were studied with different methods to investigate the capacity of the model for the prediction process. The ANFIS method was compared to Particle Swarm Optimization (PSOFIS) and Genetic Algorithm (GAFIS), and as shown in Fig. 13, the results in testing and training were in agreement, and they were investigated regarding their accuracy. The figure showed that the results in both of the processes have a high accuracy showing the high capability of the model. The methods also were compared regarding their error, and as shown, ANFIS error, according to R-value, was the lowest among the two other methods, which were PSOFIS and GAFIS methods though they were in a suitable range of accuracy (see Fig. 14). The methods were studied regarding the error, time of prediction, and training. The results showed that the methods had a high capability in prediction, and they could predict a process very fast. All the data for the dataset could complete the training process in less than 103 s, and the prediction process could be completed in less than 2 s showing the high capability of the methods in the prediction process. Furthermore, as shown in Table 1, the error in testing and training processes were studied. The table also revealed that the three methods had high accuracy and capability in prediction.

Figure 13
figure 13

Learning processes of the highest correlation coefficient results using ANFIS and particle swarm optimization (PSO) algorithm and genetic algorithm (GA) which used as trainer in fuzzy inference system that called PSOFIS and GAFIS respectively.

Figure 14
figure 14

Comparison of RMSE error patterns for ANFIS, PSOFIS, GAFIS methods based on iteration.

Table 1 Training and testing errors, learning and prediction times for the best learned FIS of ANFIS, PSOFIS and GAFIS methods.

As shown in the results, when one input was used, the error of the system and its accuracy were high, and the regression was about 0.32, which is not a suitable accuracy for an AI model. One of the parameters used in the study was the number of inputs, and by increasing it, the AI algorithm reached high capability for the prediction of the results. When the number of inputs increased to 5, the regression reached to 0.99. For studying the elements engaged in the prediction of a process in AI, the model needed to be trained with different parameters to see which input could be trained and achieved high capability in prediction. After that, the specific number of inputs could be used for the prediction. Sometimes, the models are complex, and a high number of inputs are needed to provide more and meaningful relationships between inputs and outputs. Therefore, the regression value and accuracy of the system increased, and a process could be predicted.

Conclusion

In this study, the membrane technology was simulated via the finite element CFD method, and the data from CFD was studied in the AI algorithm. A new model was proposed by using AI that can model the separation process in the membrane system. This method could create a new domain of prediction in the AI framework by using the CFD data. The data from AI showed that AI reached its intelligence, and the system sent the intelligent signals when the maximum number of inputs was added to it. For example, when five inputs were added to the system, the system showed its best level of prediction, and it became fully predictive tools. When 1 or 2 inputs were used in the training process, the system did not have complete level of prediction, and they did not send any intelligent signals. The results showed that using AI and CFD at the same time is possible to speed up the optimization and prediction processes of membrane technology. Also, the results revealed that the costs of CFD could be reduced, and the prediction time could speed up. On the other hand, AI helped us to understand the relationship between the outputs and the inputs in the optimization process leading to have a better learning process compared to the conventional methodology. Moreover, one of the best results obtained from this study was that by increasing the number of inputs, the accuracy of prediction, and the capability of the prediction increased, and the model could predict the process in the membrane technology. Due to the low number of inputs in the training process, the model did not have the prediction capability. However, by increasing the number of inputs to 5, the regression and R value reached 0.99, which increased from 0.31 to this number. When the regression and R value reached 0.99, the capability of the model could be used for the prediction.