A thermoviscoelastic model for residual stress in injection molded thermoplastics