A properly sized mainspring will fill half of the available area in the barrel. It is easy to calculate the dimensions of the barrel.
Change the items in the yellow boxes and see the Results below.
This calculator, provided by Horology - The Index, is one in a series of repair calculations.