An enormous explosion in Beirut’s seaport area this week ruined nearby buildings and caused damage and shattered windows across the city, killing scores of people and wounding thousands more. As videos of the disaster spread on social media, people around the world immediately began speculating about the cause.

Lebanese government sources eventually said it was 2,750 metric tons of ammonium nitrate, a chemical routinely used as agricultural fertilizer and, when mixed with fuel oil, as a mining explosive. The stockpile had been sitting in a warehouse since 2014, when the ship that carried it into port was abandoned. This incident is not the first time ammonium nitrate has caused devastation. In 2013, for instance, a stockpile a tenth the size of the one in Beirut blew up a West Chemical and Fertilizer Company facility in Texas.

Experts such as engineers Suzanne Smyth and Russell Ogle investigate the causes and origins of such fires and explosions in an attempt to prevent future disasters. Smyth and Ogle are a managing engineer and practice director, respectively, at Exponent, an American multidisciplinary engineering and scientific consulting company. Scientific American spoke with them about how explosion detectives get to the roots of an incident, and what conditions can trigger an ammonium nitrate detonation.

[An edited transcript of the interview follows.]

How do you investigate the cause of a particular explosion or fire?
SMYTH: What we’re essentially following is the scientific method. We go through and gather a bunch of data, which could come from videos, documents, interviews, looking at evidence on the ground. And then, once you have those data, you start hypothesizing. One thing we’ve been trying to be very careful about is not hypothesizing too early in the process. We don’t have a ton of information [for Beirut], but we’ve seen the videos of the explosion. Seeing the shock wave—it’s very rare to see that. What we’re talking about is that really thin, spherical white shape moving away from the explosion. What you’re actually seeing is water vapor condensing out of the air, because of really low pressure right behind the high-pressure shock wave. And then you can see it disappears right away, because it’s evaporating once the pressure equalizes. You can see the actual shock wave, so you know that it detonated—and only certain things can get you to a detonation.

What do you mean by detonation?
OGLE: A shock wave travels faster than the speed of sound, and that’s the hallmark of a detonation. There are two kinds of decomposition reactions that you can find in ammonium nitrate when it’s starting to build up enough pressure to cause damage. The first is called a deflagration. It’s a wave—literally a chemical reaction wave—that is traveling through the material slower than the speed of sound. As it continues to travel, it accelerates. And if it gets to the point where it hits the speed of sound, that’s what we call a detonation. A detonation yields far more damaging mechanisms against things such as structures and buildings.

What else can you learn from the video footage from Beirut?
SMYTH: A lot of the times when we’re analyzing video, we’re looking for the sequence and timing of events. When we’re investigating an explosion, there’s usually both explosion damage and fire damage. It’s always one of our goals to figure out: Was it fire, then explosion or explosion, then fire? The video we see that shows a fire before the explosion is really useful.
OGLE: There’s a very distinctive reddish-brown cloud that’s rising up, following the explosion. It’s not the same thing as performing a chemical analysis, but [the cloud] is very distinctive and would be consistent with the decomposition products of ammonium nitrate—the primary one being nitrogen oxide. I think, at least visually, there’s a potential confirmation there that ammonium nitrate [is] participating in the overall reaction.

What can cause ammonium nitrate to explode?
OGLE: It’s stable under normal conditions, but you can do things to it that will cause it to misbehave. The main trigger is an external heat source. Depending on how you want to count it, there have been probably somewhere between 20 and 30 major catastrophic explosions with ammonium nitrate since it came on the scene as a commercial product in the 1920s. And fire is a frequent trigger. It’s the heat of the fire that warms up the ammonium nitrate that can become a problem. If it is heated by a large heat source like a fire, the ammonium nitrate will begin to decompose—and that decomposition can be mild and harmless, or it can be catastrophic.

The difference between the two is whether or not the ammonium nitrate is pushed together in a stockpile. Think of it like a bonfire with a bunch of logs. When you build up that bonfire, those logs are trapping the heat, which accelerates the burning and makes the big fire. Whereas if you spread them out, the heat escapes to the atmosphere harmlessly. The same thing is true with the ammonium nitrate if it’s loaded up in, for example, what they call supersacks (these flexible containers that can [often] hold about one [metric] ton each). If you pile them up with no airflow in between, then any heat that gets generated during a decomposition is trapped and can’t get out. That heat raises the temperature and accelerates the decomposition, and there’s nothing to stop it.

With the stockpile of ammonium nitrate in Beirut, what precautions should have been taken?
OGLE: In the U.S., we turn to [a nonprofit] organization called the National Fire Protection Association to give us guidance on how to safely handle things like hazardous materials. If you exceed a threshold quantity of material—one half of a [metric] ton [of ammonium nitrate]—then you need to take a much more sophisticated approach to how you store and handle the material to keep it safe. If you have 2,750 [metric] tons, first and foremost, the thing you need to do is move that material far away from the population. It represents a significant hazard.

When investigating an explosion, what other clues do you look for?
SMYTH: The presence of a crater is another indication of the size of the explosion and what could potentially be involved. And the radii of damage: How far do you have minor structural damage? Broken windows? Major structural damage? Looking at how far away things are damaged can help you estimate how much power or energy or force was released. Those types of information can be used to back out what specifically happened. If you’re looking at a smaller explosion within a building, you can look for directional indications: where this wall was blown out toward the north and this wall was blown out toward the east. You can also look at fragments, missiles or shrapnel that were thrown during the explosion to both estimate how much force you’d need to move that fragment, as well as where they are coming from. Oftentimes we’re looking for fragments of certain pieces of equipment to put them back together like a puzzle: you might be able to look at those pieces and understand why they fragmented the way they did. Time lines are really important to our work. Understanding how long something was exposed to a fire, when someone was last in the room [and] noted that everything was normal, when people first see smoke—that type of [establishment of] a time line can be really helpful to help us [set bounds on] what’s going on, as well as potentially eliminate different hypotheses.

OGLE: You’re searching for little nuggets of gold through a bunch of other kinds of fluff. But that requires interviews and searching through documents. One of the things, for example, that there’s been some talk about in the news media is whether or not there were any fireworks stored either nearby or, potentially, in the same warehouse [as the ammonium nitrate in Beirut]. Given the devastation that you’re looking at, it would be probably difficult to find physical evidence of that. You’re going to have to rely on people, and maybe documents, that will help you establish whether or not some materials were being stored in adjacent warehouses or in the same one.