Modelling Dynamic Thermal Responses of Pipelines in Thermal Energy Networks