This study utilizes Computational Fluid Dynamics (CFD) to generate pressure and flow rate values for the analysis of flow characteristics and the diagnosis of leaks in inclined pipelines. The Semi-Implicit Method for Pressure-Linked Equations (SIMPLE) solver in OpenFOAM software was modified to incorporate the effect of pipe orientation angle. Subsequently, the SIMPLE solver was employed to simulate the flow of water through the pipe. It was observed that the position of the leak along the pipe had no effect on the leakage rate, with the exception of pipes of a greater inclination, which were associated with higher leakage rates. A mathematical leak model is proposed based on non-dimensional flow variables and pipe orientation angle. To generate sufficient pressure values and leakage rates, the CFD simulation was performed 70 times. These values were then incorporated into the mathematical model for the leak location to be predicted. The proposed method is applicable to the detection of leakages of varying sizes in pipelines with different orientations. Therefore, knowing the pipe orientation angle and measurements of inlet flow rate, outlet flow rate, and pressure drop, the model can be used to precisely locate leaks in a pipeline.