Based on the software development function of Ansys, a parametric programming language is written to study the unloading mechanism of rock samples. Comparing the change characteristics of strain energy density in the loading test, the strain energy density in the unloading test is released along both sides as the minimum principal stress gradually decreases. The failure mode is tensile‐shear coupling failure, which may be due to the tensile stress generated by unloading resulting in. And as the lateral stress gradually decreases, the minimum bearing area gradually increases.