## 3 Concept and Methodology
### COMSOL Multiphysics Simulation  
As previously stated, COMSOL Multiphysics is used to validate the concept and obtain the necessary data. The 2D sensor model geometry consists of a rectangular design divided into two domains, air (domain one) and water (domain two). The design width and length are fixed to 20 cm and 30 cm, respectively. However, the air depth \(W_{air}\) and water depth \(W_{water}\) are variable (\(W_{air}+W_{water}=20\) cm). The refractive indices of domains one and two are defined by one and \(n_{w}\), respectively.  
The \"Geometrical optics\" physics interface with a time-dependent study is implemented for modeling the electromagnetic wave propagation, where the wavelength to be used is much smaller than the smallest geometric entity in the model. Diffraction and reflection at edges and corners in the geometry are neglected in the study, and wall boundary conditions are defined as \"disappear\" options for perfect absorption. An optical path length step is set to 0.01 cm to ensure accurate refraction at the ray-boundary interaction (air-water interface), and the time taken by the ray to reach the sensing part (source-to-target) is calculated by COMSOL. However, the ray is propagated with the speed of light and time taken is measured in the nanosecond-Angstrom scale. In practice, it is difficult to find a time sensor capable of accurately measuring a nanoscale time difference between rays once they reach the sensing part. Therefore, studying the source-to-target time collected by COMSOL is pointless, and the distance \(d\) will be the only investigated parameter in this study.  
For a fixed \(W_{air}\) and \(W_{water}\), and a sweep of angle \(\theta_{i}\) from 0 to 45\({}^{\circ}\) with 0.5\({}^{\circ}\) step, the distance \(d\) is calculated for both water types (\(S=0\) and \(S=35\%\)). A similar study is repeated with sweeping \(W_{water}\) from 5 to 10 cm by 1 cm step (the total width is kept constant at 20 cm). The above simulations are computed for three different wavelengths (450 nm (blue), 520 nm (green), and 660 nm (red)) and three different temperatures, 30, 40, and 50 \({}^{\circ}\)C, to obtain the values of the distance \(d\).  
Figure 2: Refractive index \(n_{w}\) vs. Temperature for (**a**) pure water with \(S=0\); (**b**) salt water with \(S=35\%\) using two different methods ([PERSON], C [56] and [PERSON], KM [46]).  
As mentioned above, \(n_{w}\) depends only on \(\lambda\), \(S\), and \(T\). Using Equation (2), the values of the refractive indices for pure water and salt water (\(n_{w}\) (\(S=0\)) and \(n_{w}\) (\(S=35\%\))), for different wavelengths and temperatures, are represented in Figure 3. It should be noted that \(n_{w}\) (\(S=0\)) and \(n_{w}\) (\(S=35\%\)) reduce in value as the wavelength increases. This is logical since the phase velocity of light is slower in the material than in air, and waves with different \(\lambda\) travel at different velocities in a medium; short waves travel slower than long waves.  
Data collected from COMSOL, for the distance \(d\), can be easily verified using [PERSON]'s law and trigonometry by Equation (3).  
\[d=W_{air}\ tan\theta_{i}+W_{water}\ tantan\ (\frac{n_{air}\ sin\theta_{i}}{n_{water}}) \tag{3}\]  
Values for the distance \(d\) obtained by COMSOL and Equation (3) are compared for four random examples with different parameters and are shown in Table 2.  
Example 1: \(W_{water}=5\) cm, \(S=35\), \(\theta_{i}=10^{\circ}\), \(\lambda=520\) nm, \(T=50\)\({}^{\circ}\)C,  
Example 2: \(W_{water}=7\) cm, \(S=35\), \(\theta_{i}=25.5^{\circ}\), \(\lambda=450\) nm, \(T=30\)\({}^{\circ}\)C,  
Example 3: \(W_{water}=9\) cm, \(S=0\), \(\theta_{i}=45^{\circ}\), \(\lambda=520\) nm, \(T=40\)\({}^{\circ}\)C,  
Example 4: \(W_{water}=10\) cm, \(S=0\), \(\theta_{i}=38^{\circ}\), \(\lambda=660\) nm, \(T=30\)\({}^{\circ}\)C.  
We can notice that the values of \(d\) are similar to an average error of \(2.2\times 10^{-5}\), which validates the results obtained using COMSOL.