Dust devils are very common meteorological phenomena on the Earth as well as on Mars. They are an abbreviated wind-sand conveyance system. The moving particles in dust devils may become electrically charged, to the point of arcing to spacesuit or vehicle, and creating electromagnetic interference. In this paper a numerical model, which takes into consideration the effect of thermal flux from the surface to the atmospheric boundary layer, is employed to simulate a dust devil and to obtain its fine structure and its development. Then, on the basis of Coulomb's law, the electric field and its distribution in a dust devil are numerically simulated in this paper. The numerical results are consistent with theoretical models for dust devils. That is, the formation mechanisms of a dust devil can be explained with the theory of thermal convection. The numerical results also show that at the beginning stage of the evolution of a dust devil the electric field strengthens with time, but after 80 s the electric field changes little and the electric field has trended to a dynamic stabilization. The electric field in a dust devil has a maximum value at a certain height; the electric field will be increscent below this height and decrescent above this height at the interior of a dust devil.