We just got a little more insight into stellar death by black hole.

In a series of simulations, a team of astrophysicists has chucked a bunch of stars at a range of black holes, and recorded what happens.

It's the first study of its kind, the scientists said, that combines Einstein's theory of general relativity with realistic models of the densities of main-sequence stars. The results will help us understand what is happening when we observe the flares of light from distant black holes shredding unfortunate stars.

And the simulations, supporting a paper that was published last year, are also gorgeous as heck.

When a star ventures a little too close to a black hole, things turn violent pretty quickly. The extreme gravitational field of the black hole starts deforming and then pulling the star apart, due to what we call tidal forces – the stretching of one body due to the gravitational pull of another.

When a star gets so close to a black hole that the tidal force results in material being stripped from the star, we call that a tidal disruption event.

In the worst-case scenario for the star, there's no escape. The disruption is total, and some of the star's material gets slurped down onto the black hole like a spaghetti noodle.

But not every encounter between a black hole and a star ends this way. Some stars have been observed surviving. The simulations, led by astrophysicist Taeho Ryu of the Max Planck Institute for Astrophysics in Germany, were designed to find out what factors contributed to a star's survival.

The team created six virtual black holes, with masses between 100,000 and 50 million times that of the Sun. Each of these black holes then had encounters with eight main-sequence stars, with masses between 0.15 and 10 times that of the Sun.

They found that the main factor that contributed to a star's survival was the initial density of the star. The denser the star, the more likely it is to survive an encounter with a black hole. In the video above, you can see these encounters play out around a supermassive black hole 1 million times the Sun's mass. The stars with the highest density are yellow, and the lowest are blue.

The team also found that partial disruptions occur at the same rate as total disruptions, and the proportion of the star's mass that is lost can be described surprisingly easily using a simple expression.

Future research to fill in the finer details will help model the effects of these encounters, including the heretofore relatively neglected partial disruption events, the researchers said.

This will reveal what can happen to a star after it survives an encounter with a black hole; whether it continues along the main sequence, or turns into a stellar remnant; and if it will continue in orbit around the black hole to meet total disruption at a later date.

The paper accompanying the simulations was published in The Astrophysical Journal in 2020.