This paper presents a numerical model of mould manufacture for the lost foam casting process. The process of mould filling with sand and sand compaction by vibration are modelled using spherical (in 3D) or cylindrical (in 2D) discrete elements. The motion of discrete elements is described by means of equations of rigid body dynamics. Rigid particles interact among one another with contact forces, both in normal and tangential directions. Numerical simulation predicts defects of the mould due to insufficient sand compaction around the pattern. Combining the discrete element model of sand with the finite element model of the pattern allows us to detect possible distortion of the pattern during mould filling and compaction. Results of numerical simulation are validated by comparison with experimental data.