Optimal Design and Performance of Spiral Wound Modules I: Numerical Method