I would say this question is less about odds, and more about bet sizing and reading. In order to answer I will point out a few things you are assuming in your question.
- We can see both our cards and our opponents cards
- our opponent is aware of pot odds and optimal play given those odds
If you knew that your opponent also has a flush draw, then betting over 20% of the pot is clearly the best move (especially if you will get a higher flush if another card of your suit lands on the next street). Your opponent will figure his odds not to be favorable and fold in most situations.
This, however, is usually not the case in a regular HE poker game. You must consider all of the information to make the right move. Your opponent could be holding a flush draw. If they are, will they call a big bet? Has their previous betting made their hand look weak? Are they a tight or loose player? Do they call every turn bet or usually fold? These are some of the questions you should be asking yourself to help you make a decision.
Betting < 20% is considered a value bet, which should pay off if you make your hand, and betting > 20% would be over-repping your hand hoping your opponent will fold.