I'll add another answer because your second set of phrases is slightly different when I read them:
For the first set:
Have you had your lunch?
My mind reads it as:
Have you already eaten/consumed your lunch?
While the second sentence
Did you have your lunch?
Means the same thing, but the tense is slightly different. I read it as:
Did you already eat your lunch?
For your second set of questions, neither feel very good:
Have you had this situation when you were doing this?
Here, had isn't a good word as it is not exact enough and when you were doing this is assumed from context. My mind reads it as:
Have you ever encountered this situation? where in your past experiences is implied.
The second one,
Did you have this situation when you were doing this?
is closer, but still sounds a little strange, mostly because you use this twice in the same sentence, but with slightly different meanings on both. I understand it, but would avoid using this structure.