The importance of the fit-up of reactor coolant pipe and its risk were analyzed. Focused on the fit-up situation of the primary piping, this paper proposes an algorithm for the close fit-up dimension chain, and the initial value, constraint value and optimization value were set according to actual engineering. The predicting of the fit-up situation was realized. Meanwhile, this algorithm was tested and verified by theory and engineering. The result is consistent with the actual value.