I wondered if you'd managed to dislocate your kneecap without realising it... but it's hard not to realise it so it's unlikely. It could be the swelling is making it so the knee cap doesn't move normally and your getting a grinding with that.