Discrete Optimal Designs for Distributed Energy Systems with Nonconvex Multiphase Optimal Power Flow