Okay, I've had this one. I had a little boy, about the same age, in my daycare that was a big teeth grinder. It was very random. He would do it for a few days then nothing. Here is what I would suggest. Ignore it. Eventually he stopped doing it.
These aren't permanent teeth. They will fall out at some point and unless it becomes some sort of stress thing or her dentist says anything about it, there isn't much you can do to stop it. Your daughter is testing a new sensory ability. Like biting...it's new, it's different, she's exploring it. And best of all, it's normal (for now). Annoying, yes, but normal none the less.
I would definitely stop trying physical punishment as a way to prevent it. She isn't at an age where she understands what she is doing or the consequence you're implementing. You're either going to just freak her out or make it worse which won't help anyone.
Just remember to breath and step away if you find yourself getting overly agitated about it. This won't be the last thing she does that drives you crazy lol.
Best of luck.