Temperature distribution in piston-cylinder assemblies: Numerical simulations and laboratory experiments