Trying times have returned to Philadelphia's beleaguered oil refiners, which experienced a short-lived and unexpected reprieve from financial challenges when vast quantities of crude oil were shipped here by rail from North Dakota, transforming the steaming riverfront industrial complexes into profitable powerhouses.

But the infusion of domestic shale oil turned out to be the equivalent of a sugar rush – a short-lived burst of exuberance.

With the fall in world oil prices, and the disappearance of discounted domestic crude arriving by rail, Philadelphia refineries are experiencing the same painful conditions they struggled through early in the decade, when two plants shut down permanently and several others flirted with closure before they were scooped up by new owners.

"They're really back to square one, where they were in 2010 before anyone had even thought of shale," said Sandy Fielden, the director of research, commodities, and energy for Morningstar Inc. He said the two most vulnerable refineries in the region are the Philadelphia Energy Solutions (PES) complex in South Philadelphia — the largest refinery on the East Coast — and the slightly smaller Monroe Energy facility in Trainer.

The latest challenge facing the Mid-Atlantic refining industry is a proposal by pipeline operator Buckeye Partners LP to partly reverse the flow of a major fuel pipeline that Philadelphia refiners have used for a generation to supply Western Pennsylvania.

Buckeye has proposed to end the westbound flow of the Laurel Pipe Line at Altoona, effectively cutting off East Coast producers from the Pittsburgh market, to the advantage of expanding lower-cost Great Lakes refineries.The proposal, which is being heard by the Pennsylvania Public Utility Commission, has provoked an outcry from PES and Monroe, which say their operations would be harmed by the loss of access to Pittsburgh.

"We do feel that by reversing this flow and getting the product from the Midwest, it would totally choke off our refiners and they would have to start cutting jobs and eventually the fear would be that they would shut down again," Anthony Gallagher, business manager of Steamfitters Local 420 in Aston, told a PUC hearing on Tuesday. About 1,500 people work at the PES and Monroe plants.

While the proposed Laurel Pipe Line reconfiguration represents a setback for Philadelphia refiners, industry analysts and the pipeline operator say it's not the cause of the Mid-Atlantic refining industry's ills.

"It really boils down to the global competitiveness of those refineries," said Bill Hollis, a senior vice president of Buckeye Partners. "We don't think we're a material issue in that."

By rights, the five Mid-Atlantic refineries that survived the 2011-12 industry contraction — two in Pennsylvania, two in New Jersey, and one in Delaware — should be in the catbird seat because there is much more demand in the region for their fuel than they can produce. Together, they supply only about 20 percent of the demand in Northeast states for gasoline and diesel, heating oil, and jet fuel.

But the Northeast market is so dependent on outside fuel to meet demand that the external forces drive the market, not local producers. "The local refiners are still the highest-cost suppliers in that market, even though they're in that market," said Rob Smith, a director of IHS Markit, an energy consultancy.

Much of the region's fuel is supplied through the Colonial Pipeline, which links the region to the enormous Gulf Coast refining complex in Texas and Louisiana, home to about half the nation's refining capacity. Gulf Coast producers, which are tied directly to oilfields, can produce fuel at such a discount to East Coast refiners that it more than covers the 5- to 10-cents-a-gallon cost of moving the fuel by pipeline to New York, Smith said.

The rest of the regional supply arrives by ships from overseas, mostly Canada and Europe. European refiners, many of which are supported by governments that want to protect their national security interests or local employment, sell surplus fuel at low profit margins into North America, more than covering the shipping costs.

"What's happened in Europe is that there are too many refineries, and they are now facing intense competition from newer refineries in the Middle East," Fielden said. Rather than shut down, they export their fuel to the Northeastern United States, squeezing local refiners.

The other side of the complex oil-market equation is the cost and the quality of the raw material. With no local supplies of crude oil, Northeast refiners rely on petroleum produced elsewhere. Until the advent of domestic shale oil, they depended upon imported oil and North Atlantic international oil prices.

With crude oil, not all refineries are created equal. The Delaware City, Del., and Paulsboro, N.J., refineries, the two major facilities in the Philadelphia area that are owned by PBF Energy of Parsippany, N.J., are configured to use heavier "sour" crude oil — so named because it contains a lot of sulfur. Sour crude is typically discounted, and more profitable to refine.

PES and Monroe Energy, which Delta Air Lines bought in 2012 from ConocoPhillips, are "less sophisticated" producers configured to process light, sweet crude, which is more costly to procure and less profitable to refine. Those two refineries face the biggest challenges in the current market, the experts say.

Upgrading a refinery to handle sour crude is no small undertaking — the cost of the equipment is enormous, and getting approvals would encounter significant regulatory and political obstacles. "For a refiner in the middle of a major metropolitan area, you run into a lot of hurdles," Smith said. Plus, the market for refined products in the United States is not growing.

The North Dakota shale boom, which produced an abundance of light sweet crude, was a godsend to Philadelphia refiners, as well as the Bayway Refinery in North Jersey owned by Phillips 66. With few pipelines in place to move crude out of North Dakota, and world oil prices surpassing $100 a barrel, the Bakken oil was sold at a steep discount that made it profitable for East Coast refiners to transport the crude by rail across the country. For about two years, Northeast refiners enjoyed an unaccustomed advantage.

But the 2015 world oil crash wiped out much of the discount, and the construction of more pipeline capacity out of the Bakken Shale, including the recently completed Dakota Access Pipeline, has linked the producing region to world markets. Oil train traffic to the East Coast has subsided and is expected to continue to decline, leaving Philadelphia refiners once again at the mercy of international crude markets.

Great Lakes refiners, many of which can process heavy crude and have an abundance of supply to choose from, can produce at less cost than East Coast refiners. Hence their interest in expanding into central Pennsylvania. Philadelphia producers fear that the current proposal to partly reverse the flow on the Laurel Pipe Line is a precursor to the eventual reversal of the pipeline all the way to Philadelphia, giving the Midwestern refiners access to Delaware River ports.

"We're just trying to be responsive to the market," said Buckeye's Hollis.

Fielden of Morningstar thinks "one ray of hope" for Philadelphia's challenged sweet-crude refiners lies a few thousand feet below the Marcellus Shale formation in eastern Ohio and West Virginia, where the Utica Shale formation contains an abundance of ultralight crude oil called condensate. There is currently little demand for that crude, but under the right economic conditions, that oil might make its way to Philadelphia, he said.

"Potentially that could be a raw material for East Coast refineries, and it would be less hassle to transport," he said. "It might be possible to deliver it by pipeline to Philadelphia."