Mathematization of moulds for sand casting process simulation