This research paper presents a thorough examination of shock wave train phenomena in various duct structures, utilizing a machine learning-optimized k-ω model. The focus of the study is to apply machine learning techniques to adapt the constant coefficients of the k-ω turbulence model, improving its accuracy and computational efficiency in capturing the dynamics of shock waves. An important aspect of this investigation is the impact of diverging sections within the duct, specifically how changes in the divergence angle, while maintaining a constant ratio of the exit area to the throat area, affect compressible flow parameters, shock wave positions, and other related characteristics of shock trains. The study systematically explores these effects and provides fresh insights into the behavior of shock wave trains under different divergence conditions. In a departure from the usual practices in supersonic research, this study compares the phenomena of shock wave trains in rectangular and circular duct geometries. The findings contribute valuable data and analyses to a field that has traditionally focused on rectangular configurations. The results indicate that the shape of the duct has a significant influence on the shock wave train, emphasizing the importance of considering geometric diversity in the study of supersonic flows and shock wave phenomena. This research sets the stage for further investigations into the interaction between duct geometry, shock wave propagation, and the dynamics of compressible flows.