MacBook Pro gets extremely hot when plugged in
I have a 15" MacBook Pro (Early 2011) which is mostly working fine, apart from when I have to charge it. When it's been on battery power and it gets low enough to show the battery warning, when I plug the adapter in, the corner of the laptop where the adapter goes gets extremely hot (almost too hot to touch), the fans spin up to maximum, and the machine slows down. It stays like that until it gets to about 40-50% charge, then it settles down again.
At this point I'm not convinced it's still the original laptop I bought, what with the number of parts that have been replaced in it. One of those is the logic board; the battery is reporting normal health so it seems like this issue could be a logic board problem.
Any ideas what could be causing it?
Thanks in advance.
MacBook Pro (15-inch Early 2011), OS X Mavericks (10.9)