A General Dynamic Model for Single and Multi-phase Flow Operations during Drilling, Completion, Well Control and Intervention