Modeling of primary spacing selection in dendrite arrays during directional solidification