Is it a 3x3 tent or a 4x4 tent?
In a 3x3 tent, 12-18" in flower and 18-24" in veg is what a 315w CMH should be at. In a 4x4 though, you need more spread so run it at 18-24". A 315w CMH really wont cut it in a 4x4 though, you'll get pretty small buds.
Getting a lux meter will help. You can figure out the intensity at whatever distance and convert the lux into PPFD. You want 500ppfd max in veg and 600-1000PPFD in flower. 30,000 lux for a 3100k CMH is 507PPFD. 45,000 lux is 765, good for flower.