Internal transport barrier simulation with pellet injection in tokamak and helical reactor plasmas