We present a fully automatic approach to recover boundary conditions and locations of thevessel wall, given a crude initial guess and some velocity cross-sections, which can becorrupted by noise. This paper contributes to the body of work regarding patient-specificnumerical simulations of blood flow, where the computational domain and boundaryconditions have an implicit uncertainty and error, that derives from acquiring andprocessing clinical data in the form of medical images. The tools described in this paperfit well in the current approach of performing patient-specific simulations, where areasonable segmentation of the medical images is used to form the computational domain,and boundary conditions are obtained as velocity cross-sections from phase-contrastmagnetic resonance imaging. The only additional requirement in the proposed methods is toobtain additional velocity cross-section measurements throughout the domain. The toolsdeveloped around optimal control theory, would then minimize a user defined cost functionto fit the observations, while solving the incompressible Navier-Stokes equations.Examples include two-dimensional idealized geometries and an anatomically realisticsaccular geometry description.