Development and application of a compositional wellbore simulator for modeling flow assurance issues and optimization of field production