Damping of primordial gravitational waves from generalized sources