This paper employs an analytical approach to achieve a precise solution and physical application for the unsteady one-dimensional adiabatic flow of weak shock waves with generalized geometries in a non-viscous perfect fluid under the influence of a weak gravitational field. In the disturbed region, the density is considered to have a functional relationship with distance, meaning that a relative change in distance from the source of disturbance causes a corresponding change in density. Finally, the problem's solution comes in the shape of distance and time power. The current technique handles this scenario in a natural way, and the approximations produce results that are reasonably accurate.