Smoke rises again from the pilot flare of a Texas-based Blue Dolphin Energy refinery after a two-decade standstill — and that's just the beginning. Following the shale oil boom, is another boom: refining. Blue Dolphin Energy, Valero Energy, Kinder Morgan and many others are building new crude-processing equipment, reopening old refineries and building new ones.

The ban on crude oil exports since the 1973 crisis, has allowed refineries to rein in enormous profit margins with the West Texas benchmark being as much as $30 a barrel cheaper than its international counterpart Brent.

Inland refineries close to the new production have benefited, and shares of companies like Dallas-based HollyFrontier — which has refineries in Kansas, Wyoming, New Mexico, Oklahoma and Utah — more than doubled during 2012. But coastal refineries have also been able to secure cheap crude, sometimes by reversing the flow of pipelines as with the Seaway pipeline between Texas and Cushing.

The figures speak for themselves, among the top performers on the S&P 500 Energy Index have been three U.S. refineries: Valero, Marathon Petroleum and Tesoro. Also, according to projections from the Dallas-based Turner, Mason & Co. and Baker & O’Brien, companies are going to add 500,000 to 830,000 barrels a day of processing capacity to handle more of the light shale crude over the next five years.

But how long is this boom going to last?

As with every boom, this one is not going to last forever. Here are some of the risks that could make refining less lucrative:

1. The U.S. decides to export crude oil: Why not? The decision to export crude seems logical for many energy analysts. In the end, the U.S. has never been as energy secure as it is now, and the ban could be reintroduced in case of emergence. However, this would mean that the U.S. domestic crude oil price would rise and adjust to the international price level. The profit margin that U.S. refineries currently enjoy would be gone.

2. The shale oil boom might not last: Who knows how long the shale oil boom continues? But to keep the domestic crude prices low, the market needs to be flooded with shale oil.

3. New infrastructure coming online: The Dallas-based refinery, HollyFrontier, experienced a profit loss of more than 50 percent in 2013 compared to the previous year. According to The Dallas Morning News, the main reason for the loss "was a decrease in the refining margin as a new pipelines and infrastructure came online."

More infrastructures that would transport crude away from the center of the U.S. to large refineries on the coast could hit smaller refineries in the center hard. A good example is the Keystone XL pipeline. An independent research by Cornell ILR Global Labor Institute, for instance, predicts that the pipeline could raise the price for heavy crudes in the Midwestern states.

Still, for now the boom is on.