Thermal rectification in thin films driven by gradient grain microstructure