Rotary friction welding (RFW) is a highly efficient and sustainable process for joining both metals and plastics. The welding process parameters of RFW must be carefully selected to ensure a good quality weld with minimum energy consumption. Few studies in the literature simulate RFW of plastics and none aim to optimize the welding process parameters. This study aims to optimize the process parameters of the continuous drive rotary friction welding of high-density polyethylene (HDPE) pipes. To simulate the RFW process, a 2D axisymmetric fully coupled thermo-mechanical model was developed using DEFORM software package. The model used an elastic-plastic material behavior model that varies with temperature, strain, and strain rate, and a temperature-dependent coefficient of friction. The material behavior was modeled using a Zerilli Armstrong equation and the 2D model was validated against experimental data from the literature. The model successfully predicted the material behavior and captured the thermal and mechanical behavior of HDPE during the welding process. The model was then used to optimize the process parameters of the RFW of HDPE pipes using the Taguchi method. A linear regression model was used to estimate the response in terms of the input process parameters for a specific pipe geometry of 63 mm diameter and 5.8 mm thickness. The optimized process parameters that minimized the power consumption for the selected pipe were found to be 800 RPM rotational speed, 20mm/min feed rate and a friction time of 9 seconds. By relying upon these optimized parameters, industry professionals can produce high quality HDPE welds which would result in a reduction in welding operations cost, and a shift towards more sustainable manufacturing operations.