A numerical simulation of debris flow and its application