If someone (person D) taught said (person S) a recipe to make something and they have since used the recipe and came out with a product. Does the person D who taught them the recipe have any rights, royalties ?
Recipes can not be patented, and the form of Intellectual Property protection covered by this area is 'trade secrets'. Read about Trade Secrets through the United States Patent and Trademark Office (USPTO) website. Many foods are protected by Trade Secrets, for example, Coca-Cola.
If a trade secret holder fails to maintain secrecy or if the information is independently discovered, becomes released or otherwise becomes generally known, protection as a trade secret is lost.
Unfortunately, Person D has no claim to rights or royalties in this particular situation where they told their friend Person S the recipe.
Recipes can be sold or licensed to others but you are correct if the recipe is no longer a trade secret they lose those benefits. Coke is an excellent example ... licensed all over the world. I once knew a kid whose dad was an exec. for Pepsi. This kid broke into his dads safe and stole the recipe for Pepsi and ran away with a friend of mine. If they had taken that recipe and posted it in the classified adds (no internet back then) before they were caught then Pepsi would have lost all its licensing royalties.
"Does the person D who taught them the recipe have any rights, royalties ?" Direct answer would be not unless they had a licensing agreement.