A method for generation of orthogonal and nearly orthogonal boundary-fitted coordinate systems