Optimal sizing of borehole heat exchangers