## 2 Materials and Methods  
### Radiation Based System  
Monte Carlo N Particle code (MCNP) [27] was implemented in the present investigation in order to model the radiation-based system. As pointed out in the abstract section, the aim of this investigation is to propose an intelligent, gamma radiation-based system with the ability of measuring volume fraction of gas, oil, and water components in annular regime of a three-phase flow independent of the scale layer. Since, in this problem, there are several unknown parameters, it is not possible to measure the volume fraction using a conventional gamma radiation system that includes one radiation source and one detector. To obtain more information from the fluid inside the pipe, a system including a dual energy source consisted of \({}^{241}\)Am and \({}^{133}\)Ba radioisotopes that emit photons with energies of 59 and 356 keV, respectively, and two NaI detectors for recording the transmitted photons, were used. A steel pipe with internal radius and thickness of 10 cm and 0.5 cm, respectively, was considered in this study. In order to model the scale layer, a cylindrical shell of barium sulfate (BaSO4) with density of 4.5 g-cm\({}^{-3}\) and different thicknesses in the range of 0-3 cm, with a step of 0.5 cm, was considered on the internal wall of the steel pipe. Annular regime of a three-phase flow was modeled inside the pipe. Air, gas, oil, and water with densities of 0.00125, 0.826, and 1 g-cm\({}^{-3}\) were utilized as gas, oil, and water phases, respectively. For each scale thickness, various volume fractions were simulated for each component (seven different scale thickness\(\times\)36 different volume fractions = totally 252 simulations were done). As aforementioned, in this investigation, two 2.54 cm \(\times\) 2.54 cm NaI detectors were applied to record the transmitted photons. Tally F8 was utilized in order to record photon spectra in both detectors. The first detector was positioned diametrically in front of the radioactive source (see Figure 2). For the second detector, at first, a sensitivity investigation was done in order to find the optimum position. In this regard, the center of the second detector was positioned in different orientation in the range of 5\({}^{\circ}\)-11\({}^{\circ}\), with a step of 1\({}^{\circ}\), and transmitted photons were recorded. Orientation of 5\({}^{\circ}\) was the minimum possible position for the second detector, because, at less than this orientation, the first and second detectors would interfere with each other. The reason for choosing orientation of 11\({}^{\circ}\) as the maximum position was that, at more than this orientation, there would be no more transmitted photons through the pipe that carries on useful information about the three-phase flow to reach the detector. At each position, sensitivity of the second detector relative to gas phase and oil phase volume fraction changes was investigated for both registered counts of gamma radiations emitted from \({}^{241}\)Am and \({}^{133}\)Ba radioisotopes. For instance, calculation of sensitivity of registered counts under \({}^{241}\)Am photo peak in the second detector relative to gas phase changes is indicated in Equation (1). It is worth mentioning that the sensitivity was calculated using the registered counts for gas phase fractions of 10% and 80%, which make the highest and lowest attenuation for photons. \[Relative\ sensitivity\ (\%)=\left(\frac{C_{gyf80}-C_{gyf10}}{C_{gyf80}}\right) \times 100 \tag{1}\]  
where, \(C_{gyf80}\) and \(C_{gyf10}\) refer to registered counts under \({}^{241}\)Am photo peak when the gas volume fraction is 80% and 10%, respectively. The results of sensitivity investigations are shown in Figure 3. For all four cases, by increasing orientation angle of the second detector, sensitivity starts to increase until it reaches a maximum value at the angle of 7\({}^{\circ}\) and then it gradually decreases. Based on the acquired results, it could be deduced that 7\({}^{\circ}\) is the optimal orientation angle for the second detector.