Guarunteed non-stall Oil Factory

Clever and beautiful constructions, bigger than two chunks
- Defense: killing biters as an art
- Castles, Throne Rooms, Decorations (comfortable living in the Factorio World)
- Main Bus Concepts
- Modular Systems, Factory Streets, show how all works together
- Megabases
Please provide us with blueprints or saves, if that makes sense of course.
Forum rules
Clever and beautiful constructions, bigger than two chunks
Post Reply
Whillowhim
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Jan 19, 2015 5:00 pm
Contact:

Guarunteed non-stall Oil Factory

Post by Whillowhim »

Oil factories are one of the more fiddly parts of Factorio. Balancing the three different outputs can be tricky, especially when your usage pattern changes. Early game you only care about petroleum, but light and heavy oil are useful mid and late game products, so you can't just completely ignore them (at least, not without causing serious inefficiency). A while back, I found a topic on this board that discussed a fairly efficient way to handle oil products, and used it in my factories. However, this design was before combinators, and this time through I decided to update it. Below, I present to you an efficient, guaranteed stall-less oil production facility. (with a few messy bits because I made adjustments along the way.)
Oil Overview.png
Oil Overview.png (3 MiB) Viewed 17947 times
To the center left is the refinery area, with different outputs stored N, NE and E of the refineries. I tried to separate each different product into pre-storage and post-storage pipelines, and will tend to refer to them as such. I.e., the refineries output into the pre-petrol, pre-light, and pre-heavy pipelines, while different products all tap off the post-petrol, post-light, or post-heavy pipelines. Since I have pumps sucking on them, the pre-pipelines are often not full of product, but the post ones always should be. So... how do I make sure nothing stalls? Lets look at the interesting bits, starting with the heavy oil storage below.
Heavy Oil Cracking Detail.png
Heavy Oil Cracking Detail.png (1.22 MiB) Viewed 17947 times
The pre-heavy pipeline enters the storage area from the left, just next to the power pole and column of pumps. I might have a few too many pumps, but their purpose is to both be a one-way gate and to clean out the pre-heavy pipeline and ensure everything makes it to the storage tanks. The post-heavy pipelines can leave from any of the other 3 sides of the storage tanks. Currently, I have one leaving off the bottom side (shown) and one leaving off the top side. If it were just those two input and output sources, I'd start to have problems when the heavy oil usage dropped, because things would back up and stall my refineries. To take care of this case, I have a relief valve attached to the pre-heavy input, The pump facing down attached to the red wire circuit network only turns on if the storage tanks are nearing full (which I define as 2400 out of 2500 heavy oil) and dumps any excess heavy oil into the heavy oil cracking refineries at the bottom of the screenshot. These then crack any excess heavy oil and dump the new light oil into the pre-light pipeline. All I really need to accomplish this is the red wire from the heavy oil tank to the small pump, but the additional red wires take the heavy oil info to use later.

There is a similar relief valve system at the light oil storage tanks, dumping any excess light oil to be cracked into petroleum. However, due to how the production ratios come out, it has a lot more chemical plants doing the cracking. The situation with petroleum, however, must be slightly different, since you can't simply crack it into heavy oil to complete the loop. Instead, when the petroleum overflows, you have to dump it. The system I have to decide when this is going to happen is shown at the petrol dump site, shown below.
Petrol Dump.png
Petrol Dump.png (1.43 MiB) Viewed 17947 times
At the petrol dump site, I've rigged a small pump to several turbines to dump excess petroleum. However, since this is an inherently wasteful process, I don't want to turn on that small pump unless I absolutely have to in order to avoid stalling. Thus, the combinators next to the pump and the additional lines to connect to the heavy/light storage areas. I only need to dump petrol if the tanks are full and the refineries are stalled, but even then it could be that everything is stalled and I still have plenty of Heavy and Light oil. So I want to check and make sure that I'm actually running out of heavy or light oil before dumping. Thus, the logic I want to implement is: if (Heavy < 250 OR light < 250) AND Petrol > 2400 then turn on pump. I'm not sure if there is a better way to handle this or not, but here's my combinator logic setup:
All combinators input and output connected to the same red circuit.
All combinators output 1 when true.
All combinators are decider combinators.
Combinator 1: If Heavy oil < 250 then yellow output 1
Combinator 2: If Light oil < 250 then yellow output 1
Combinator 3: If Petroleum > 2400 then red output 1
Combinator 4: If yellow output > 0 then red output 1
Small Pump: If red output > 1 then turn on.

If you wanted to improve this (aside from cleaning up some of the clutter), you could try to reclaim some of the dumped petrol for less efficient uses. For example, you may send it first to be turned into solid fuel and only dumping it when that stalls as well. At the moment, I'm only sending light oil to my solid fuel production facilities, since that is the most efficient oil product for it.

Note that all the production facilities are easily expanded horizontally, to make for larger (or smaller) facilities. The storage tanks, however, are tricky to modify, so they should probably be the final size when you first build them. I build them 4x4 in order to avoid any stress while I work on advanced oil processing, since they can handle a heck of a lot of excess heavy/light oil while you can't yet crack them to get rid of excess.

edit: fixed typo on small pump logic.
Last edited by Whillowhim on Sat Mar 19, 2016 11:55 pm, edited 1 time in total.

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1485
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Guarunteed non-stall Oil Factory

Post by MeduSalem »

My recommendation would be... don't dump the Petroleum... ever. It is a huge waste of efficiency.

If you really want to get rid of it, then burn it as Solid Fuel in Steam Engines.

You can rig the setup so that the Steam Engines will use Light Oil Soiid fuel as long as it can, and when the Refineries would stall due to excess Petrol then you start burning the Petroleum Gas Solid Fuel until you have enough Light oil again. With other words you let the system switch back and forth between Light Oil Solid Fuel and Petroleum Soild Fuel and thereby avoid the stalls while still having the efficiency of Light Oil for the most part.

Yeah, burning Petrol Solid Fuel is not as efficient as Light Oil, but it would still be FAR MORE efficient than dumping the excess Petroleum.


Here is one of my oil refineries from a map I played last year:
Oil industry.JPG
Oil industry.JPG (176.08 KiB) Viewed 17896 times
The reason why I don't need as much Light Oil->Petrol cracking is because my Steam powerplants use it all up. (Yeah the lights are the progress bar of how much stuff is inside the tanks.)

MalContentFL
Fast Inserter
Fast Inserter
Posts: 122
Joined: Mon Apr 28, 2014 2:53 pm
Contact:

Re: Guarunteed non-stall Oil Factory

Post by MalContentFL »

Can we get a blueprint string?

Whillowhim
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Jan 19, 2015 5:00 pm
Contact:

Re: Guarunteed non-stall Oil Factory

Post by Whillowhim »

I don't want to post a blueprint of the current one since it has a lot of clutter inside it, but I'm planning on recreating it on a new map, hopefully a bit cleaner. I'll try to get a blueprint string when I do so.

-Nathan

Whillowhim
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Jan 19, 2015 5:00 pm
Contact:

Re: Guarunteed non-stall Oil Factory

Post by Whillowhim »

I finished recreating the Refinery, and the blueprint string and screenshots are below. This version is slightly different since I added a secondary tank for the petrol dump, for use in petroleum solid fuel production before the petroleum gets dumped. As MeduSalem says, it is more efficient this way, but this should almost never be used. I still maintain a dump after this point, when the tank gets filled, since otherwise the plant will stall if the solid fuel plants do. Ideally this would never happen, but I've had wierder things screw up my plants. I like the security of knowing I can go off and build on a part of my factory for hours and not worry that this is going to stall and screw things up. Especially since the worst issue I ever had with a plant was when plastic and acid production lines stopped, and the light oil continued to burn in my power plants. The first I noticed was when my entire factory went dark. I'd much rather dump some petroleum than deal with that mess again.
Oil Overview v2.png
Oil Overview v2.png (3.42 MiB) Viewed 17540 times
Petrol Dump v2.png
Petrol Dump v2.png (970.28 KiB) Viewed 17540 times
Blueprint

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1485
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Guarunteed non-stall Oil Factory

Post by MeduSalem »

Whillowhim wrote:I still maintain a dump after this point, when the tank gets filled, since otherwise the plant will stall if the solid fuel plants do.
And why is the stalling of the refinery a problem at this point?

If the last tank fills because the Solid Fuel made from Petroleum Gas isn't fully used up then it's because your power plant isn't running at full capacity, so more throughput from your refineries isn't needed at that point.

If you keep on using the dump once the last tank fills up then you actually let your Refineries overproduce unncessary oil products, effectively wasting precious crude oil.



The setup I showed in my previous post is perfectly "stall resistant" (altough it could use some more Light Oil->Petroleum cracking). The production of oil products scales with the amount of Energy my factory consumes.

Light Oil Solid Fuel gets put on the belt first... So the power plant will try using Light Oil. Naturally the Petroleum Solid Fuel will stock up in the chem plants because the inserters can't output to the belt when it is spammed by Light Oil Solid Fuel. This causes the Petroleum Tanks to fill up until they are full. At that point the refineries stop to produce Heavy/Light/Petroleum... But don't worry yet, because the Light Oil Solid Fuel will then get used up... and slowly enable for Petroleum Solid Fuel to be put on the belt. That's when the Petroleum Tanks start to empty again and allow the refineries to continue Producing Heavy/Light/Petroleum.

So with other words the placement of the Light Oil Solid Fuel plants to output on the belt BEFORE the Petroleum Solid Fuel plants basically works as a natural "unclogging mechanism" that doesn't even need any circuit logic.

This "unclogging mechanism" can be seen at my picture from the previous post... because as you may see some of the Petrol Solid Fuel plants nearest to the Light Oil Solid Fuel plant are "working", meaning they are effectively unclogging the refineries right now. Ideally the point where Solid Fuel starts to get "stockpiled" on the belt will always be somewhere in between the Petrol Solid Fuel Plant and Light Oil Solid Fuel Plant... and this point will move forward and backward depending on the energy usage of the entire factory.

Whillowhim
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Jan 19, 2015 5:00 pm
Contact:

Re: Guarunteed non-stall Oil Factory

Post by Whillowhim »

And what happens when you build a factory with solar power and electric furnaces? Your solid fuel (and thus your light oil) will go unused, but you might run out of heavy oil if petrol fills up. I'm not saying that your particular factory is wrong, I'm just saying that I've run into situations where my oil has stalled from all sorts of situations, and having a guarantee that nothing stalls is useful. In normal operation, no petrol is dumped, it is only when things go weird that dumping happens, and I'd prefer to be slightly less efficient than have parts of my factory shut down. I know that with this refinery, the only thing I need to check to make sure it is still functioning is the oil input line and pumpjacks.

And if you do use excess petroleum to power a solid fuel line, you absolutely want the petrol factories to be the first ones putting fuel on the line. If you're in a situation where you're dumping excess, you don't want them to sit there waiting for the light oil to run out and production to stall, you want them used first, so that production doesn't stall in the first place. Putting the petrol fueled plants last on the conveyor was a useful trick before the more advanced signal systems were put in, but now it is much cleaner to just never turn on the pump that delivers their petroleum unless you have an excess. You aren't relying on part of your infrastructure failing before your relief valve turns on.

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1485
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Guarunteed non-stall Oil Factory

Post by MeduSalem »

Whillowhim wrote:And what happens when you build a factory with solar power and electric furnaces?
I never use Solar panels because I find the concept way too boring. It's just blueprinting the same 2 items all over the place... where is the fun in that?
Whillowhim wrote:Your solid fuel (and thus your light oil) will go unused, but you might run out of heavy oil if petrol fills up.
Why would you run out of Heavy Oil? There is literally no use for it... except for Flamer Thrower Ammuntion and Lubricant... both of which you will probably have in abundance so you never run out of it. :roll:

On the contrary I wish there were more uses for it so that there is a possibility I could run out of it. :D
Whillowhim wrote:And if you do use excess petroleum to power a solid fuel line, you absolutely want the petrol factories to be the first ones putting fuel on the line. If you're in a situation where you're dumping excess, you don't want them to sit there waiting for the light oil to run out and production to stall, you want them used first, so that production doesn't stall in the first place. Putting the petrol fueled plants last on the conveyor was a useful trick before the more advanced signal systems were put in, but now it is much cleaner to just never turn on the pump that delivers their petroleum unless you have an excess. You aren't relying on part of your infrastructure failing before your relief valve turns on.
With my trick the Light Oil tanks are actually always at the minium level I specified. They are nearly always empty because my Power Plant uses it all up. So I don't have to wait until the Light Oil runs out.

Also I prefer that my production lines stall for a moment rather than that my Power Plant gets too less Solid Fuel. My Production lines only get what's left over after substracting what I need for power production.

Post Reply

Return to “Medium/Big/Gigantic Sized Structures”