Building climate energy management in smart thermal grids via aquifer thermal energy storage systems