The plants that keep black flies away include.
Lavender.
Basil.
Mint.
Rosemary.
Lemongrass.
Marigolds.
Sage.
Bay laurel.
Catnip.
(Ocimum basilicum).
Tansy.
Chrysanthemums.
Cymbopogon nardus.
Eucalyptus.
Nasturtiums.
Petunias.
These plants put out scents that black flies and other flies and many other insects hate and will stay away from these plants and areas where these plants are located.
Lemon balm and even sweet fern also helps to repel black flies and may other insects.
When outside you can also use an oscillating fan or even a box fan to help blow towards you when outside such as on a patio and it will also keep the black flies as well as other flies and mosquitoes and flying insects away from you.