Dynamics of coronal structures: magnetic field-related heating and loop energy balance