1Research Institute for Astron. & Astrophys. of Maragha (RIAAM), 55134-441 Maraghe, Iran
2Astrophysics Depart., Physics Faculty, University of Tabriz, Tabriz, Iran
3Nice university, OCA-CNRS-Lagrange Depart., Av. Copernic, 06130 Grasse, France
Virial theorem is important for understanding stellar structures. It produces an interesting connection between magnetic and gravitational energies. Using the general form of the virial theorem including the magnetic field (toroidal magnetic field), we may explain the solar dynamo model in relation to variations of the magnetic and gravitational energies. We emphasize the role of the gravitational energy in sub-surface layers which has been certainly minored up to now. We also consider two types of solar outer shape (spherical and spheroidal) to study the behavior of magnetic and gravitational energies. The magnetic energy affects by the solar shape, while the gravitational energy is not changed by the considered shapes of the Sun.