We model the capillary flow of a polymer melt, incorporating a stick-slip boundary condition at the wall. The boundary condition is enforced by a phase-field model for the local state of the polymer, which describes the kinetics of a first-order transition. We numerically solve the linearized NavierStokes equations, coupled to this prescribed boundary condition and to a Maxwell model for viscoelasticity. In various regimes, the model exhibits steady flow, periodic oscillations, and more complicated spatiotemporal structures, which can be observed experimentally. [S0031-9007(96) The capillary flow of molten polymers has received much attention in the plastics and chemical engineering communities [1,2] because at higher flow rates the extrusion of the polymer melt is commonly accompanied by instabilities which manifest themselves as surface distortions, called "melt fracture," in the final plastic product. A standard experiment has the melt pushed from a large reservoir into the capillary ("die") and extruded out the other end. Typically, as the flow rate is increased, the extrudate first develops a fine-scaled sawtooth texturing on its surface called sharkskin; next, for experiments performed at a constant flow rate into the reservoir (as opposed to constant pressure), there are relatively long timescale regular undulations during what is called "spurt" flow; finally, a very disordered lumpy structure called "gross melt fracture" is observed at the highest flow rates. It is controversial whether these effects are due to processes inside the die or are instead effects occurring at the entrance or exit of the die.The specific motivation for the model we will introduce is recent work which implies that polymeric fluids might not always obey "stick" boundary conditions on mesoscopic length scales. In particular, de Gennes and co-workers [3] have suggested that polymer melts can slip at walls and, moreover, that a sharp transition between slip and stick should be observed as the shear rate at the walls is increased. Indeed there is experimental evidence for the existence of slip in polymer melts. While much of this evidence has been rather indirect [1,2,4], a recent experiment by Migler et al. [5] measured the velocity of a polymeric fluid within 100 nm of the wall and found a sharp transition between small and large slip velocities as the shear rate was increased. A further impetus for our work is recent ultrasonic measurements [6], which show that anomalous time-dependent behavior in the polymer flow occurs within the die, far from both the entrance and exit, suggesting that instabilities occur inside the die itself.Here we generalize these ideas by introducing a hydrodynamic model to describe the flow of a viscoelastic fluid in which the conformation of polymers near the surface of the die undergoes a first-order transition as a function of the shear stress at the wall. This conformational change leads to a change in the frictional force between the wall and the polymer in the bulk, producing stick-slip behavior a...