Production optimization and well modeling