Finite element modelling of the flow of chemically reactive polymeric liquids