We may have just taken a huge step towards solving a mystery that has deviled scientists for more than a century.

Since the solar magnetic field was first discovered in 1908, we've struggled to understand where in the Sun it is generated, a region known as the dynamo.

Now, new research led by mathematician Geoffrey Vasil of the University of Edinburgh has found that the solar dynamo does not reside deep in the Sun, as previously thought, but quite close to its surface, at a depth of just 32,000 kilometers (20,000 miles).

Why does this matter? Because the Sun's poorly understood activity cycles are somehow linked to its magnetic field – and knowing where the dynamo resides is key to figuring out what drives the solar cycles.

"Understanding the origin of the Sun's magnetic field has been an open question since Galileo and is important for predicting future solar activity, like flares that could hit the Earth," says applied mathematician Daniel Lecoanet of Northwestern University in Illinois.

"This work proposes a new hypothesis for how the Sun's magnetic field is generated that better matches solar observations, and, we hope, could be used to make better predictions of solar activity."

The solar magnetic field is extremely messy and dynamic, and scientists have long sought a detailed understanding of what generates it.

We know that Earth's magnetic field is generated by a dynamo in its outer core: convecting, rotating, electrically conducting fluid that converts kinetic energy into electric and magnetic fields extending far out into space.

The internal workings of the Sun are a lot more complicated and difficult to observe than those of a planet on which we live, but they have a big impact.

The Sun's magnetic activity is linked to its sunspot, flare, and coronal mass ejection activity. This drives the space weather that can have a noticeable, and potentially dangerous, impact on Earth.

The Sun on 20 May 2024, overlaid with a visualization of its magnetic field, as it nears the peak of its activity cycle. (NASA/AIA/LMSAL)

This activity ebbs and flows in cycles of roughly 11 years. At solar maximum, when the Sun is at its most active, with rampant sunspots and flares, its magnetic poles reverse their polarity. There are other ways the Sun's behavior changes, too.

One of those is torsional oscillations. Because the Sun isn't solid, but fluid, it doesn't globally rotate at the same rate. Torsional oscillations are subsurface changes in the Sun's rotation at certain latitudes, and they are tightly correlated with the sunspot cycle.

"Because the wave has the same period as the magnetic cycle, it has been thought that these phenomena were linked," Lecoanet explains.

"However, the traditional 'deep theory' of the solar magnetic field does not explain where these torsional oscillations come from. An intriguing clue is that the torsional oscillations are only near the surface of the Sun.

"Our hypothesis," Lecoanet continues, "is that the magnetic cycle and the torsional oscillations are different manifestations of the same physical process."

A butterfly diagram showing sunspots plotted as a function of time and solar latitude. (NASA)

A deep dynamo, according to theory, should be buried more than 200,000 kilometers (124,000 miles) below the solar surface, at the bottom of the convection zone. But this model also generates features we haven't observed on the Sun, like strong magnetic fields at high latitudes, and fails to explain others, like the way sunspots follow the Sun's magnetic activity.

Vasil and his colleagues conducted state-of-the-art numerical simulations based on real data of surface manifestations of acoustic waves inside the Sun, and found that the real behavior of the Sun most closely matches a dynamo that roils not far from the solar surface, in what is known as the near-surface shear layer.

This shallow dynamo not only produced a Sun that behaves the way ours does, but has closely linked torsional oscillations and sunspot activity too. It's a break from conventional thinking, but other recent studies suggest that we need to start looking at new solutions to solar mysteries, since convention is failing to cut it.

"I think this result may be controversial," says applied mathematician Keaton Burns of Massachusetts Institute of Technology (MIT), who co-authored the study.

"Most of the community has been focused on finding dynamo action deep in the Sun. Now we're showing there's a different mechanism that seems to be a better match to observations."

The team's research has been published in Nature.