You’ve probably noticed the brown tint to the skies over Denver, and the unhealthy air quality that’s been in place through the Front Range much of this week.

You can blame this filthy air and the brown skies on a temperature inversion, or an increase in temperature with height. If that sounds unusual, it is.

Usually, as you go up in elevation, the air cools (think about the top of a fourteener versus Denver). In an inversion, however, that changes. The air actually warms as you go up in elevation, often due to a change in wind direction with height.

We often think about air masses being divided on a horizontal scale. For example, a cold front separates a colder air mass further north from a warmer one to the south. But in this case, the separation is taking place vertically.

Northerly and easterly winds are pushing in cold air from the north and east at the surface. But westerly winds above us are bringing in warmer air (and tons of snow to the mountains).

RELATED: Could Denver be in for more cold and snow this March?

Here’s the final piece to the brown cloud equation: Colder air is heavier than warmer air. Air molecules are bunched together in a cold air mass, creating an increase in air density. So if a cold and a warm air mass are in place, the colder air will settle toward the surface, while the warm air is usually further up in the atmosphere. Because of that, the warm air essentially acts as a lid on any pollutants that try and escape into the atmosphere.

Denver’s geography in the lee of the Rocky Mountains often pits it in between two distinctly different air masses; often it’s warmer, wetter air from the Pacific Ocean to the west, and typically drier and cooler air from the continental air mass to the east.

The dividing line between these two different air masses has been centered roughly over Denver this week, and the result is different air masses battling it out over the skies above us. In the meantime, they create a filthy view down below.

The longer an inversion goes, usually, the worse air quality gets. Pollutants at the colder surface accrue over time, and they have no way to “escape,” because of the lid of warmer air above. This week has featured a fairly consistent temperature inversion, allowing pollutants to stay trapped and accumulate.

Fortunately, it appears that the inversion will break soon. We’ve already started to see an erosion of the Arctic air at the surface — temperatures warmed to 50 degrees on Thursday for the first time so far this month. A storm system will brush through Denver on Friday night into Saturday morning, bringing with it some light snow chances, but it should help continue clearing the brown cloud that’s been stuck over the Front Range this week.

Chris Bianchi is a meteorologist for WeatherNation TV.