Digital twins have become popular for their ability to monitor and optimize a process or a machine during its lifetime using simulations and sensor data. In this paper, we focus on the challenge of the implementation of accurate and real time simulations for digital twins in the context of electrical machines.In general, this involves not only computational models for the electromagnetic aspects, but also mechanical and thermal effects need to be taken into account. We address mathematical tools that can be employed to carry out the required simulations based on physical laws as well as surrogate or data-driven models. One of those tools is a model hierarchy of very fine to very course models as well model reduction which is required for obtaining real-time simulations.We discuss in detail the coupling of electromagnetic, mechanical, and thermal models of an electrical machine to obtain a simulation model which is able to describe the interaction of those different physical components. In this context, a very promising setting is provided by energy-based formulations within the port-Hamiltonian framework, which has received much attention in the past years, especially in the context of multiphysics modeling. We present such port-Hamiltonian formulations for the considered electromagnetic, mechanical, and thermal models as well as for the coupled overall system.