Consideration of Total Energy Loss in Theory of Flow to Wells