A framework based on physical optics for simulating the effect of imperfect compound refractive lenses (CRLs) upon an X‐ray beam is described, taking into account measured phase errors obtained from at‐wavelength metrology. A CRL stack is modelled, with increasing complexity, as a single thin phase element, then as a more realistic compound element including absorption and thickness effects, and finally adding realistic optical imperfections to the CRL. Coherent and partially coherent simulations using Synchrotron Radiation Workshop (SRW) are used to evaluate the different models, the effects of the phase errors and to check the validity of the design equations and suitability of the figures of merit.