i dont know if im allowed to do this but look for something called pipemax its perfect for all those sorts of calculations, i have found it very useful,
For my 2.7l 6 cyl bm race engine i use 1.5" Primary x 30" and 1 3/4" secondary x 15" to a 2.5" tailpipe and it makes exceptional power.
I think without going into some advanced calculations for some rule of thumb guides I would say make primaries the same internal size as the EX valve then for every collector aim for an outlet CSA 0.65 X the sum CSA of all the pipes feeding into it.