Mechanics of thermophoretic and thermally induced edge forces in carbon nanotube nanodevices