This work presents a complex multiphysics model of an electron microscope in ANSYS Fluent software. A custom electromagnetic model was used to describe the relativistic transport of electrons. The model consisted of a description of an electromagnetic field, relativistic transport of charged particles and interactions between charged particles and solid materials. Presented results suggest, that the custom model can be coupled with the CFD module, which results in a possibility of coupled simultaneous simulations of hydrodynamics, electromagnetics, and a transport of charged particles.