Calculations of the outflow velocity of envelopes of cool giants