Theoretical study of chemical vapor deposition of transition metal compounds