Computerized modeling of Mars’ moon Phobos has a connection with keeping the Earth safe from asteroids, the Lawrence Livermore National Laboratory (LLNL) announced on Wednesday.

Phobos has a huge crater, more than five miles across, and a new computer model out of the LLNL in California simulates the dramatic impact that could have caused that distinctive crater. The research is part of a planetary defence program at LLNL— in other words, studying how to protect Earth from a devastating impact.

"We've demonstrated that you can create this crater without destroying the moon if you use the proper porosity and resolution in a 3D simulation," Megan Bruck Syal, a scientist at LLNL and a part of their planetary defence team, said in a statement about the new Phobos research.

According to LLNL, the object that slammed into Phobos and created what’s called the Stickney crater (which calls to mind the structure of the massive weapon on the Death Star from “Star Wars”) could have been about 820 feet across and been traveling at a speed of about 13,420 mph, in one scenario. Their work will be published in the journal Geophysical Research Letters.

The exercise at LLNL was done using a code called Spheral, and is part of a broader planetary defence initiative at the lab. That program has two elements to it, according to Nolan O’Brien, a public information officer for lab, which is part of the U.S. Department of Energy.

While NASA is keeping an eye on the heavens for objects that could threaten the Earth, LLNL is interested in deflecting such a hazard. That could involve ramming a spacecraft into the asteroid to change its course, or even detonating a nuclear device near it, O’Brien told FoxNews.com. The nuclear explosion near the asteroid would heat up one part of it, and that would act like a rocket engine, ideally propelling it on a safe course and taking Earth out of the crosshairs.

The second aspect of their work is what happens if the unthinkable occurs, and Earth is hit by a hazardous object, O’Brien said— in that case, they’d want to mitigate the damage.

Earlier this year, NASA opened a new office to track asteroids and comets that could come close to Earth. The Planetary Defense Coordination Office, or PDCO, is part of the agency’s Planetary Science Division. NASA also has an ambitious plan to launch a mission that would grab a boulder from an asteroid and place it in lunar orbit.

"Something as big and fast as what caused the Stickney crater [on Phobos] would have a devastating effect on Earth," Syal said in the statement. "If NASA sees a potentially hazardous asteroid coming our way, it will be essential to make sure we're able to deflect it. We'll only have one shot at it, and the consequences couldn't be higher.”

Follow Rob Verger on Twitter: @robverger