A novel mathematical model for accurately computing the currents flowing along the high-voltage ac substations' grounding system and floating metallic conductors buried in the multilayer earth model has been developed in this paper. Not only the conductive effect of currents leaking into the soil, but also capacitive and inductive effects have been considered in this model. To accelerate the calculation, quasi-static complex image method and closed form of Green's function were introduced into this model. The model is then implemented in a computer program, which can be used to calculate currents distribution of any configuration of the grounding system, and with or without floating metallic conductors under low-frequency harmonic performance.