  We study the long-term evolution of relativistic jets in collapsars and
examine the effects of viewing angle on the subsequent gamma ray bursts. We
carry out a series of high-resolution simulations of a jet propagating through
a stellar envelope in 2D cylindrical coordinates using the FLASH relativistic
hydrodynamics module. For the first time, simulations are carried out using an
adaptive mesh that allows for a large dynamic range inside the star while still
being efficient enough to follow the evolution of the jet long after it breaks
out from the star. Our simulations allow us to single out three phases in the
jet evolution: a precursor phase in which relativistic material turbulently
shed from the head of the jet first emerges from the star, a shocked jet phase
where a fully shocked jet of material is emerging, and an unshocked jet phase
where the jet consists of a free-streaming, unshocked core surrounded by a thin
boundary layer of shocked jet material. The appearance of these phases will be
different to observers at different angles. The precursor has a wide opening
angle and would be visible far off axis. The shocked phase has a relatively
narrow opening angle that is constant in time. During the unshocked jet phase
the opening angle increases logarithmically with time. As a consequence, some
observers see prolonged dead times of emission even for constant properties of
the jet injected in the stellar core. We also present an analytic model that is
able to reproduce the overall properties of the jet and its evolution. We
finally discuss the observational implications of our results, emphasizing the
possible ways to test progenitor models through the effects of jet propagation
in the star. In an appendix, we present 1D and 2D tests of the FLASH
relativistic hydrodynamics module.
