This work describes mechanisms for simulating opportunistic and delay-tolerant networks in the OMNeT++ discrete event simulator. The mechanisms allow for simulating open systems of wireless mobile nodes where mobility- or contact traces are used to drive the simulations. This way mobility generation is separated from the core OMNeT++ protocol simulations which facilitates importing synthetic or real data from external mobility generators, real mobility tracking data or real contact traces. The paper describes the implementation of our mechanisms for OMNeT++ and gives an example of how we have used these to simulate opportunistic wireless content distribution in an urban environment. Categories and Subject Descriptors I.6.8 [Simulation and Modeling]: Types of Simulation-Discrete event General Terms Simulation, performance Keywords Simulation, Mobility, Opportunistic Networking, DTN, Omnet++