Thermal stresses in pipes