Potential flow has many applications, including the modelling of unsteady flows in aerodynamics. For these models to work efficiently, it is best to avoid Biot–Savart interactions. This work presents a grid-based treatment of potential flows in two dimensions and its use in a vortex model for simulating unsteady aerodynamic flows. For flows consisting of vortex elements, the treatment follows the vortex-in-cell approach and solves the streamfunction–vorticity Poisson equation on a Cartesian grid after transferring the circulation from the vortices onto the grid. For sources and sinks, an analogous approach can be followed using the scalar potential. The combined velocity field due to vortices, sinks and sources can then be obtained using the Helmholtz decomposition. In this work, we use several key tools that ensure the approach works on arbitrary geometries, with and without sharp edges. First, the immersed boundary projection method is used to account for bodies in the flow and the resulting body-forcing Lagrange multiplier is identified as the bound vortex sheet strength. Second, sharp edges are treated by decomposing the vortex sheet strength into a singular and non-singular part. To enforce the Kutta condition, the non-singular part can then be constrained to remove the singularity introduced by the sharp edge. These constraints and the Poisson equation are formulated as a saddle-point system and solved using the Schur complement method. The lattice Green's function is used to efficiently solve the discrete Poisson equation with unbounded boundary conditions. The method and its accuracy are demonstrated for several problems.