A ternary model for double-emulsion formation in a capillary microfluidic device.