1 Introduction

Nanofluid is a class of fluids in which the fluid is suspended with nanometer-sized particles called the nanoparticles. These nanoparticles can be metallic (pure, oxide, carbide etc.), ceramics, carbon based nanomaterials (carbon nanotubes, diamond etc.), 2 dimensional nanomaterials (graphene, MXene etc.) [1, 2]. Nanofluids exhibits enhanced thermophysical properties due to which they have a wide number of applications such as in automotive industry [3, 4], electronics cooling [5, 6], solar thermal and photovoltaic systems [7, 8] etc. A lot of research has been done in order to determine the parameters affecting the thermophysical and rheological properties (such as thermal conductivity, viscosity etc.) of nanofluids [9, 10]. It has been found that the parameters such as the nanoparticles size, nanofluid temperature, nanoparticles concentration have the most significant impact on the thermophysical and rheological properties. Moreover, thermal conductivity enhancement is desired as it leads to enhanced heat transfer rate, whereas viscosity enhancement is not desired as it significantly increases the pump work [11, 12]. Hence, it becomes important to determine the viscosity of nanofluids before using it for any specific application.

Determining these properties of nanofluids experimentally is fairly time consuming and costly process [13]. Therefore, it is best to develop correlations that describes the variation of these properties with the parameters that affects it. Many researchers came up with different models and correlations that can be used to predict the viscosity of nanofluids. However, developing accurate correlations is difficult because of highly non-linear dependency between the variables involved and viscosity. Artificial neural networks (ANNs) can be a more powerful and effective way of predicting the viscosity of nanofluids. ANNs are the computational models that are excellent tools for finding the non-linear and complex relationships between the independent variables and dependent variable(s). Many researchers have employed this technique for predicting the viscosity of various nanofluids. Some of those studies are discussed here.

Toghraie et al. [11] developed an ANN model for the prediction of the viscosity of silver/ethylene glycol nanofluid. The input variables given to the ANN model were temperature and concentration of the silver nanoparticles. The temperature was varied from 25 to 55 \(^{\circ }\)C and nanoparticles concentration was varied from 0.2 to 2 vol%. Afrand et al. [14] developed an ANN model for the prediction of the viscosity of MWCNTs/water nanofluid. The input variables given to the ANN model were temperature and concentration of MWCNTs nanoparticles. The temperature was varied from 25 to 65 \(^{\circ }\)C and nanoparticles concentration was varied from 0 to 1 vol%. Esfe et al. [15] developed an ANN model for the prediction of the viscosity of \({\hbox{TiO}}_{{2}}\)/water nanofluid. The input variables given to the ANN model were temperature and concentration of \({\hbox{TiO}}_{{2}}\) nanoparticles. The temperature was varied from 283.15 to 343.15 K and nanoparticles concentration was varied from 1 to 35 mass%. Longo et al. [16] developed an ANN model for the prediction of the viscosity of oxide based nanofluids. The nanoparticles considered were \({\hbox{Al}}_{{2}}{\hbox{O}}_{{3}}\) and \({\hbox{TiO}}_{{2}}\). The input variables given to the ANN model were temperature, concentration of nanoparticles, nanoparticles diameter, nanoparticles cluster diameter and base fluid type. For \({\hbox{Al}}_{{2}}{\hbox{O}}_{{3}}\)/water nanofluid, temperature was varied from 1 to 40 \(^\circ\)C and nanoparticles concentration was varied from 1 to 4 vol%. For \({\hbox{TiO}}_{{2}}\)/water nanofluid, temperature was varied from 1 to 40 \(^\circ\)C and nanoparticles concentration was varied from 1 to 6 vol%. For \({\hbox{TiO}}_{{2}}\)/ethylene glycol and \({\hbox{Al}}_{{2}}{\hbox{O}}_{{3}}\)/ethylene glycol nanofluids, temperature was varied from 0 to 50 \(^\circ\)C and nanoparticles concentration was varied from 0 to 3 vol%. Vakili et al. [17] conducted experiments to determine the viscosity of the graphene nanoplatelets (GNP)/deionised (DI) water where temperature was varied from 20 to 60 \(^{\circ }\)C and nanoparticles concentration was varied from 0.025 to 0.1 mass%. Then an ANN model, to predict the viscosity using the experimentally determined values, was also developed.

Derakhshanfard and Mehralizadeh [18] performed experiments to study the effect of \({\hbox{Fe}}_{{2}}{\hbox{O}}_{{3}}\), ZnO, \({\hbox{TiO}}_{{2}}\), \({\hbox{WO}}_{{3}}\) and NiO nanoparticles on the viscosity of crude oil when temperature was varied from 40 to 100 \(^{\circ }\)C and nanoparticles concentration was varied from 0.2 to 2 mass%. An ANN model, with the temperature and nanoparticles concentration as input parameters, was also developed using the experimental data. Amani et al. [19] conducted experiments to study the variation of \({\hbox{MnFe}}_{{2}}{\hbox{O}}_{{4}}\)/water nanofluid viscosity under the varying conditions of temperature, nanoparticles concentration and magnetic field. An ANN model was also developed for the prediction of the viscosity of \({\hbox{MnFe}}_{{2}}{\hbox{O}}_{{4}}\)/water nanofluid. The temperature, nanoparticles concentration, and applied magnetic field were given as input variables. The temperature was varied from 20 to 60 \(^{\circ }\)C, nanoparticles concentration was varied from 0.25 to 3 vol% and applied magnetic field was varied from 100 to 400 G. Zhao and Li [20] conducted experiments to determine the viscosity of alumina–water nanofluid. The temperature was varied from 296 to 313 K and nanoparticles concentration was varied from 1.31 to 5.92 vol%. A radial basis neural network (RBF-ANN) model was also developed in order to predict the viscosity of alumina–water. The temperature and nanoparticles concentration were given as inputs to RBF-ANN model. Esfe et al. [13] developed an ANN model for prediction of the viscosity and thermal conductivity of the Fe/EG nanofluid. The input variables given to ANN model were temperature, nanoparticles concentration and diameter of nanoparticles, whereas output variables were viscosity and thermal conductivity of Fe/EG nanofluid. The details of these researchers’ work who have used ANN to predict the viscosity of nanofluids is given in the Table 1. The input parameters used to develop the ANN model are highlighted in the table.

Table 1 The work done on the prediction of viscosity of nanofluids by ANN

However, almost all the aforementioned models predict the viscosity values for only single nanoparticles. Moreover, no ANN model has been reported in the literature which can be used to predict the viscosity values for multiple EG based nanofluids. Therefore, in this paper, an ANN model for the prediction of the relative viscosity of ethylene glycol (EG) based nanofluids has been developed. Developing such a model will allow researchers to determine the viscosity of various EG based nanofluids. To develop the model, nanoparticles diameter, temperature and the volume fraction are taken as input variables. Nanoparticles included in the study are \(\hbox{SiO}_{{2}}\), Fe, Mg(OH)\(_{2}\), SiC, ZnO, \(\hbox{Al}_{{2}}\hbox{O}_{{3}}\), \(\hbox{CeO}_{{2}}\), \(\hbox{Co}_{{3}}\hbox{O}_{{4}}\), MgO, Ag, \(\hbox{In}_{{2}}\hbox{O}_{{3}}\) and \(\hbox{Y}_{{3}}\hbox{Al}_{{5}}\hbox{O}_{{12}}\). ANNs with different structures were employed and ANN showing the best performance characteristics was selected through the trial and error method. To check the performance of the model, comparison between the ANN predicted values and experimental values was also done.

Forthcoming section includes: data collection, data pre-processing and development of the ANN model, discussion on the predictions of the ANN model, and comparison of ANN predicted values with experimental values.

2 Development of artificial neural network

2.1 Data collection

To develop the ANN model, 377 experimental data points were extracted from the literature. The details of the data is given in the Table 2. The input variables to the ANN model were temperature (T), nanoparticle diameter (\(\hbox{d}_{{p}}\)) and concentration of the nanoparticles (\(\phi\)). In the data extracted, temperature varied from 283.15 to 333.15 K, nanoparticles diameter varied from 4 to 100 nm and nanoparticles concentration varied from 0.05 to 8.2 vol%.

Table 2 Details of data taken to develop the ANN model

2.2 Development of the ANN

In the present work, we have employed a multilayer perceptron (MLP) neural network model for the prediction of the viscosity of EG based nanofluids. Due to their ability to handle non-linearly dependent complex data, MLP-ANN are the most commonly used type of ANN models [35]. The algorithm used to train the MLP network was back-propagation which when used in feed forward network, is also known as the feed forward back propagation algorithm [36]. The data contains 12 different nanoparticles, hence to make model able to differentiate between different nanoparticles, numbers have been alloted to different nanoparticles, which are given in Table 3. However, assigning the nanoparticles numbers creates another problem. Model now can assume that there is an ordering between different nanoparticles which is not true and may give poor performance and inaccurate results. To prevent this from happening, data expressed in Table 3 was further processed in a form such that the model not only can differentiate between different nanoparticles but also does not get biased against any nanoparticle on the basis of numbers assigned. Table 4 shows the form in which the number assigned to different nanoparticles are convereted into and eventually fed into the neural network for training process.

Table 3 Numbers assigned to different nanoparticles
Table 4 Final form of nanoparticles numbering fed into the ANN

To develop the ANN model, whole data was divided into 2 parts with first being the training data which is 80% of the total dataset and second being the test data which is 20% of the dataset. The test data was used to evaluate the model performance. The performance of the model on the test data determines whether the model is underfit, overfit or fits the data well [36]. The data was also normalized in the range from 0 to 1 to enhance the performance of the model. This was done according to following equation:

$$\begin{aligned} x_{{\rm norm}}= \frac{x-x_{\mathrm{min}}}{x_{\mathrm{max}}-x_{\mathrm{min}}} \end{aligned}$$
(1)

where \({\hbox{x}}_{\mathrm{norm}}\), \({\hbox{x}}_{\mathrm{min}}\) and \({\hbox{x}}_{\mathrm{max}}\) are the normalized value, minimum value and maximum value of the variables.

Figure 1 shows the topology of the ANN model. It has 4 layers, with first layer (green color) being the input layer, second and third layer (blue color) being the hidden layers and fourth layer (red color) being the output layer.

Fig. 1
figure 1

Topology of the developed optimum ANN model

After transforming the data in Table 3 to the form shown in Table 4, we had a total of 15 input variables and one output variable i.e. the ratio of the viscosity of the nanofluid to that of the basefluid. Therefore, the input layer has 15 neurons and the output layer has only 1 neuron. The rectified linear activation (ReL) function and linear function were chosen as activation function for hidden layers and output layer, respectively. The model was trained using stochastic gradient descent optimizer and adam optimizer. The model showed better performance when trained using adam optimizer. The developed ANN model was also sensitive to several other parameters. These parameters are shown in Table 5. The optimum value of these parameters was found through the trial and error method. It is also to be noted that to avoid the overfitting of the model due to high number of iterations involved, dropout layers were also used. Performance parameters like mean square error (MSE), mean average percentage error (MAPE), correlation coefficient (R) and deviation (D) were used to evaluate the model performance. The values of these performance parameters shows that there is no overfitting in the model. These performance parameters are defined as follows:

$$\begin{aligned}&MSE = \frac{1}{n}\sum _{i=1}^{n} \left(Y_{\mathrm{exp,n}}-Y_{\mathrm{pred,n}}\right)^{2} \end{aligned}$$
(2)
$$\begin{aligned}&MAPE = \left[ \frac{1}{n}\sum _{i=1}^{n} \left| \frac{Y_{\mathrm{exp,n}}-Y_{\mathrm{pred,n}}}{Y_{\mathrm{exp,n}}}\right| \right] \times 100 \end{aligned}$$
(3)
$$\begin{aligned}&R = \left[ \frac{\sum \nolimits _{i=1}^{n}\left(Y_{\mathrm{pred,n}} -Y_{\mathrm{pred,avg}}\right)\left(Y_{\mathrm{exp,n}}-Y_{\mathrm{exp,avg}}\right)}{\sqrt{\sum \nolimits _{i=1}^{n}\left(Y_{\mathrm{pred,n}} -Y_{\mathrm{pred,avg}}\right)^{2}\sum \nolimits _{i=1}^{n}\left(Y_{\mathrm{exp,n}} -Y_{\mathrm{exp,avg}}\right)^{2}}}\right] \end{aligned}$$
(4)
$$\begin{aligned}&D = \left( \frac{Y_{\mathrm{exp}}-Y_{\mathrm{pred}}}{Y_{\mathrm{exp}}} \right) \times 100 \end{aligned}$$
(5)

where \({\hbox{Y}}_{\mathrm{exp}}\), \({\hbox{Y}}_{\mathrm{pred}}\), \({\hbox{Y}}_{\mathrm{exp,avg}}\), \({\hbox{Y}}_{\mathrm{pred,avg}}\) and n are the experimentally determined values, ANN predicted values, average of experimentally determined values, average of the ANN predicted values, and number of datapoints, respectively.

Table 5 Values of various parameters of the optimum ANN

The optimum values of the performance parameters MSE, MAPE and R for the test data, training data and the whole (i.e train data + test data) data is given in Table 6.

Table 6 Values of performance parameters for the optimum ANN

Figure 2 shows the variation of MSE of the test data with number of neurons in both the hidden layers. It shows that the mean square error is least when there are 45 neurons in both the hidden layers. This signifies that the optimum number of neurons in the hidden layers is 45.

Fig. 2
figure 2

Plot showing variation of MSE with the number of neurons

3 Results and discussion

Figure 3 shows the variation of the mean square error (MSE) with the number of iterations. A careful analysis of this curve can be helpful in preventing the model from getting overfit. A well fit model can be obtained by stopping the training process at a point where the value of loss function for test data starts increasing. An increase in the value of loss function for test data signifies that the model has started transisting from a well fit model to an overfit model. As can be seen from the figure, loss function i.e. MSE for both the training data and test data is decreasing rapidly upto several hundreds of iterations, then decreased steadily upto several thousands iterations and then decreased very slowly over next iterations. This shows that the developed ANN model is a well fit model.

Fig. 3
figure 3

Plot showing performance curve of the ANN model

Figures 4 and 5 shows the values predicted by the ANN model for every experimentally obtained value. Both the figures shows a line inclined at 45\(^\circ\) to both the axes. The purpose of this line is to show the accuracy of ANN predictions. For an ideal ANN model (i.e with exceptionally low MSE, R = 1 etc.), all the predicted values will lie on the line. In other words, it can be said that more the predicted values deviates from the line, lower will be the performance of the ANN model. As can be seen from the Fig. 4, very high number of predictions are lying on the line. However, few predictions are also deviating from the line. This shows that the performance of the ANN model on the train data is good. Figure 5 shows the model performance on test data. As can be seen, very few predictions are deviating from the line. Hence, it can be said that the performance of the model is good on the train data as well as on the test data.

Fig. 4
figure 4

Plot showing experimental values and ANN predicted values for train data

Fig. 5
figure 5

Plot showing experimental values and ANN predicted values for test data

Figure 6 shows the contrast between experimentally determined values and ANN predicted values for test data. It can be seen that the difference between experimentally determined values and ANN predicted values is fairly small, and model is able to predict the values of relative viscosity of the unseen data i.e. test data with good accuracy. It also shows that model has fitted well on the data and that there is no overfitting in the model despite the high number of iterations.

Fig. 6
figure 6

Plot showing contrast between experimental values and ANN predictions for the test data

Figure 7 shows the ability of the ANN to predict the variation of the relative viscosity of MgO and \({\hbox{Y}}_{3}{\hbox{Al}}_{5}{\hbox{O}}_{12}\) based nanofluids with volume fraction. As can be seen, ANN predictions for all nanoparticles concentration are in excellent agreement with experimentally determined values. Thus, it can be said that the ANN model is able to predict the change in relative viscosity as nanoparticles concentration changes.

Fig. 7
figure 7

Plot showing experimental values and ANN predictions for MgO and \({\hbox{Y}}_{3}{\hbox{Al}}_{5}{\hbox{O}}_{12}\) at different values of volume fractions

Figure 8 shows the ability of the ANN to predict the variation of the relative viscosity of \({\hbox{CeO}}_{2}\) based nanofluids with temperature at nanoparticles concentration of 0.2 vol% and 1.2 vol%. As can be seen , ANN predictions at all temperature values are in excellent agreement with experimentally determined values. Thus, it can be said that the ANN model is able to predict the variation in the relative viscosity as temperature varies.

Fig. 8
figure 8

Plot showing experimental values and ANN prediction for \({\hbox{CeO}}_{2}\) with varying temperature at different values of nanoparticles concentrations

Figure 9 shows the plot of deviation (given by Eq. 5) between the experimentally obtained values and the values predicted by the ANN model. As can be seen from the figure, maximum deviation between experimentally obtained values and ANN predicted values is − 8%. Although majority of deviation points are in the range of ± 2%. Furthermore, 97% of the values predicted by the ANN are within the 5% deviation range.

Fig. 9
figure 9

Plot showing deviation between the experimental values and the ANN predicted values

The performance of the ANN model is further demonstrated with Fig. 10. Figure shows that 77% of the deviations (absolute) are in the range of 0–2%. Moreover, 20% and 3% of the deviations are in the range of 2–5% and 5–8%, respectively. This shows that majority of the ANN predictions are in excellent agreement with experimental values.

Fig. 10
figure 10

Bar graph showing fraction of deviation in different absolute deviation range

Based on the values of several statistical parameters and graphs presented, it can be said that the model developed in this study is able to predict the values of relative viscosity of EG based nanofluids with good accuracy. It was also shown that despite the high number of iterations and neurons in both the hidden layers, there is no overfitting in the developed ANN model. This may be attributed to the use of dropout layers. This may also be attributed to more complexity of the data which is because of high number of nanoparticles considered in the study. It is also worth noting that the developed model can only be used to determine the relative viscosity of EG nanofluids based on the nanoparticles that were considered in the study.

4 Conclusion

This work deals with the development of an artificial neural network to predict the relative viscosity of multiple ethylene glycol-based nanofluids. In order to develop the ANN model, 377 experimental data were taken from 14 research articles available in the literature. These 377 experimental data includes 12 different nanoparticles. The nanoparticles diameter, temperature of the nanofluid and volumetric concentration of the nanoparticles were given as inputs to the ANN model. The optimum ANN topology was found through the trial and error method. To avoid the overfitting due to high number of iterations involved, dropout layers were also used. Furthermore, in order to keep check on overfitting, values of loss function for test data and train data was carefully observed. The optimum model thus developed, had 2 hidden layers and 45 neurons in each of the hidden layers. The values of MSE, MAPE and R for the test data and train data were found to be 0.00044, 1.648% and 0.996, and 0.00039, 1.3 and 0.9962, respectively. Moreover, 77% of the deviations were found to be in the range of ± 2%. The performance parameters shows that the ANN is able to predict the values of the relative viscosity with good precision.

The developed model can only be used to predict the values of relative viscosity of the nanofluids considered for model development. Furthermore, it can only be used for range described in the Table 2. Future work can focus on the development of more accurate soft computing models for ethylene glycol based nanofluid while also incorporating more types of nanoparticles. The same approach can also be used for various important heat transfer fluids. Furthermore, more number of input parameters that affects the viscosity of nanofluids can be considered for model development.