This sounds like chondromalacia patella, a chafing of the kneecap on the cartilage underneath. I had it come on when I changed bikes in March from my short cranked fix gear and went for a long ride on my long cranked racing bike. Three days later I had to drop out of the season opening race because of the pain. Got introduced to an orthopedic surgeon at the race. He laid it for me what I had, what I had to do to continue racing and the long term. I still have the condition but it doesn't rule my life - as long as I play by the "rules" he spelled out. If I'm negligent the pain comes back. That doc made it very plain that if I break too may rules, it's knee replacement time. Several orthopedics have told me since what that doc told me was correct.
Years ago I wrote a long account of that experience. I'd post it here but for now I"m handicapped by an internet computer I am keeping entirely separate from my other. PM me with your e-mail if you ant to read more. I'll send that to you and if you want, you can paste it here. (I've posted it a few times in the past but my search abilities are limited.)
CP now has a new name but I'm too old to change. If you google chondromalacia patella, you can find the new name.
Edit: I see the file posted, I haven't opened this version for a while so I don't know exactly what's there. (Did I sign my possessions away? Will I be sentenced to life? (Not really worried.
)