In this paper, we simulate the irrotational planar flows in the region with a rectilinear obstacle using conformal mappings. Firstly, conformal mappings from an unbounded multiply connected region with a rectilinear slit onto three canonical slit domains are calculated using the premap function and the charge simulation method. Secondly, to accurately approximate the conformal mapping functions, we propose an iterative method based on the Adams prediction-correction method for solving the constraint equations generated by the charge simulation method. Finally, the numerical examples illustrate the effectiveness of the proposed method.