A dynamic and thermodynamic model of diamond film growth