Details are given of a boundary-fitted mesh generation method for use in modelling free surface flow and water quality. A numerical method has been developed for generating conformal meshes for curvilinear polygonal and multiply-connected regions. The method is based on the Cauchy-Riemann conditions for the analytic function and is able to map a curvilinear polygonal region directly onto a regular polygonal region, with horizontal and vertical sides. A set of equations have been derived for determining the lengths of these sides and the least-squares method has been used in solving the equations. Several numerical examples are presented to illustrate the method.