Improve magnetar flux injection model