Abstract:Fluid-filled pipes are susceptible to deformation and corrosion due to the influence of the media inside and outside the pipe as well as environmental conditions. To ensure system safety and reliable operation, it is necessary to conduct regular inspections using specialized instruments. The practical measurement environment is complex, affected by factors such as pipe deformation, instrument gravity, improper use of centralizers, and variations in the properties of the internal fluid, all of which can hinder the measurement instruments from functioning ideally and reduce the precision of inspections. This paper focuses on ultrasonic logging within fluid-filled casings as a case study to address these challenges. Leveraging the characteristics of ultrasonic logging tools, we have developed an iterative optimization algorithm. This innovative algorithm allows for the ultrasonic measurements to accurately locate the eccentric trajectory of the inspection tool within an irregular fluid-filled pipe, calculate the ultrasonic wave velocity in the pipe′s internal fluid, and infer the internal boundaries of an irregular pipe. Both synthetic data and field data indicate that the proposed method can effectively evaluate the instrument′s measurement state, precisely determine the ultrasonic wave velocity in the internal fluid, and ascertain the geometric parameters (such as shape and position) of irregular pipes. This approach significantly improves the usability of ultrasonic logging tools in fluid-filled casings, providing reliable data for further assessments, such as external cement evaluation in the context of well casings.