Model-based design is an important tool for cyber-physical systems (CPS) that efficiently connects all development phases of control software and ensures desirable system performance. However, the increased complexity of CPS caused by interactions between components creates challenges for the implementation of model-based design. In this paper, we present a modeling framework for the model-based design toolchain which uses port-Hamiltonian systems (PHS) to model CPS components and interactions. In this framework, passivity-based control methods are used to design controllers and compose them through Dirac structures. We evaluate the modeling framework using an automotive control system and present simulation results to demonstrate the effectiveness of the framework.