  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 between the potential flow elements. This work
presents a grid-based solver for potential flows in two dimensions and its use
in a vortex model for simulations of separated aerodynamic flows. The solver
follows the vortex-in-cell approach and discretizes the
streamfunction-vorticity Poisson equation on a staggered Cartesian grid. The
lattice Green's function is used to efficiently solve the discrete Poisson
equation with unbounded boundary conditions. In this work, we use several key
tools that ensure the method works on arbitrary geometries, with and without
sharp edges. The immersed boundary projection method is used to account for
bodies in the flow and the resulting body forcing Lagrange multiplier is
identified as a discrete version of the bound vortex sheet strength. Sharp
edges are treated by decomposing the body-forcing Lagrange multiplier into a
singular and smooth part. To enforce the Kutta condition, the smooth part can
then be constrained to remove the singularity introduced by the sharp edge. The
resulting constraints and Kelvin's circulation theorem each add Lagrange
multipliers to the overall saddle point system. The accuracy of the solver is
demonstrated in several problems, including a flat plate shedding singular
vortex elements. The method shows excellent agreement with a Biot-Savart method
when comparing the vortex element positions and the force.
