A 3D physical optics model of a loaded cavity with phase disturbance is built. With a foldaway unstable resonator in a COIL, the effects of shock waves with different intensities at different physical locations on the phase and the output power of the optical field are simulated. It is shown that the location and intensity of shock waves can bring different degrees of optical beam degeneration. Stronger disturbance such as central shock waves ought to be avoided. The photographs of ablation from experiment are reproduced by the numerical simulations with the phase disturbance by shock waves in the optical cavity.