Real-Time Optimization of Smart Wells