Hydrodynamics of coronal loops subject to transient heating