It doesn't matter who issue the ticket or whose flight number it is, if it's an LH plane then TK will treat it as an LH flight.
I don't know for certain if D class on United ticket will map to D class on LH (I think it should; you can check this by going to LH website.) If so, TK will credit 150%. Not 200% like some other airlines but also not 0% like P. D class on UA metal also earns 150%. The last flight on TK will also be 150%, unless you're TK elite then it's 175%.