The centers of massive galaxy clusters are super hot (red), while bright structures show diffuse gas from the intergalactic medium shock heating at the boundary between cosmic voids and filaments.

The formation of galaxies is a complex dance between matter and energy, occurring on a stage of cosmic proportions and spanning billions of years. How the diversity of structured and dynamic galaxies we observe today arose from the fiery chaos of the Big Bang remains one of the most difficult unsolved puzzles of cosmology .

In search of answers, an international team of scientists has created the most detailed large-scale model of the universe to date, a simulation they call TNG50. Their virtual universe, some 230 million light-years wide, contains tens of thousands of evolving galaxies with levels of detail previously seen only in single-galaxy models. The simulation tracked more than 20 billion particles representing dark matter , gases, stars and supermassive black holes, over a 13.8-billion-year period.

The unprecedented resolution and scale allowed the researchers to gather key insights into our own universe's past, revealing how various oddly shaped galaxies morphed themselves into being and how stellar explosions and black holes triggered this galactic evolution. Their results are published in two articles to be featured in the December 2019 issue of the journal Monthly Notices of the Royal Astronomical Society .

Related: From Big Bang to Present: Snapshots of Our Universe Through Time

TNG50 is the latest simulation created by the IllustrisTNG Project , which aims to build a complete picture of how our universe evolved since the Big Bang by producing a large-scale universe without sacrificing the fine details of individual galaxies.

"These simulations are huge datasets where we can learn a ton by dissecting and understanding the formation and evolution of galaxies within them," said Paul Torrey, associate professor of physics at the University of Florida and co-author of the study. "What's fundamentally new about TNG50, is that you're getting to a sufficiently high mass and spatial resolution within the galaxies that give you a clear picture of what the internal structure of the systems looks like as they form and evolve."

The model's attention to detail comes at some cost. The simulation required 16,000 processor cores of the Hazel Hen supercomputer in Stuttgart, Germany, running continuously for more than a year. The same calculation would take a single processor system 15,000 years to compute. Despite being one of the most computationally heavy astrophysical simulations in history, the researchers believe their investment has paid off.

"Numerical experiments of this kind are particularly successful when you get out more than you put in," Dylan Nelson, a postdoctoral fellow at the Max Planck Institute for Astrophysics in Munich, Germany, and co-author of the study, said in a statement . "In our simulation, we see phenomena that had not been programmed explicitly into the simulation code. These phenomena emerge in a natural fashion, from the complex interplay of the basic physical ingredients of our model universe."

The violent simulated birth of a galaxy cluster where dark matter structures (in white) merge together while supermassive blackholes and supernovae expel cosmic gas away (gas motion is shown in red). (Image credit: TNG Collaboration)

That emergent phenomenon might be essential to understanding why our universe appears as it is today 13.8 billion years after the Big Bang. TNG50 allowed researchers to see firsthand how galaxies may have emerged from the turbulent clouds of gas present shortly after the universe was born. They discovered that the disk-shaped galaxies common to our cosmic neighborhood naturally emerged within their simulation and produced internal structures, including spiral arms, bulges and bars extending from their central supermassive black holes . When they compared their computer-generated universe to real-life observations, they found their population of galaxies were qualitatively consistent with reality.

Related: The 15 Weirdest Galaxies in Our Universe

As their galaxies continued to flatten into well-ordered rotating disks, another phenomenon began to emerge. Supernova explosions and supermassive black holes at the heart of each galaxy created high-speed outflows of gas. These outflows morphed into fountains of gas rising thousands of light-years above a galaxy. The tug of gravity eventually brought much of this gas back unto the galaxy's disk, redistributing it to its outer edge and creating a feedback loop of gas outflow and inflow. Apart from recycling the ingredients for forming new stars, the outflows were also shown to change their galaxy's structure. The recycled gases accelerated the transformation of galaxies into thin rotating disks.

Despite these initial findings, the team is far from finished dissecting their model. They also plan to release all of the simulation's data publicly for astronomers across the world to study their virtual cosmos.

"There's a huge road ahead of us now that we have these simulations completed," Torrey said. "A whole team of researchers are working to better understand the detailed properties of the galaxies that form and what emergent trends show up in that data."

Originally published on Live Science.