Stall resistant oil processing

Post pictures and videos of your factories.
If possible, please post also the blueprints/maps of your creations!
For art/design etc. you can go to Fan Art.

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

Stall resistant oil processing

Post by Whillowhim »

So, I'm sure we've all had a problem with oil at one time or another. The fact that it outputs 3 separate resources tied to the same input resource means that it is highly susceptible for having one of the resources stall, starving you out of the other resources. It has often felt like a balancing act, making sure I have enough production that uses all the different resources. It gets easier to keep your petroleum line running after researching advanced oil processing, but it is still possible to starve out your heavy oil line if your petroleum usage ever slows, since the converters will be sucking out all the heavy oil from your reservoirs and your light and petroleum lines get filled with converted heavy oil. Then when petroleum fills up and stalls, you're left with no heavy oil left. Your basic tank helps delay this and give you some breathing room, but isn't really a solution because tanks will still be sucked dry eventually.

My solution to this is shown below, in the heavy/light storage section of my oil refinery. Note the arrows on the right hand side, these mark the input to the system from the oil refineries. The critical part of this is the pumps going into the tanks. These are placed before any converters, but are not in a direct line with them. The pumps suck out most of the gas from the pipeline before it gets to the cracking facility to be broken down to lighter oils. Thus, the tanks have first dibs. Also, since the pumps act as one-way valves, they prevent any back-flow from reaching the converters and sucking the tanks dry. Any chemical plants that actually use heavy/light oil are connected on the far side of the tanks, and thus have privileged access to the heavy/light oil as it is generated. It is only the overflow from those important but light usage factories that reaches the converters to be cracked into light oil and petroleum.
Factorio Oil 2 annotated.jpg
Factorio Oil 2 annotated.jpg (514.93 KiB) Viewed 19685 times
The downside of this system is that you need to hang all your heavy usage off of the petroleum end of the oil refinery. You don't need create a factory with balanced usage in the proper ratio, you just need to use more than 9 petroleum for each heavy oil. This is often the case anyways since plastics and batteries are the most commonly used refinery end products. The only major drawback is that solid fuel should be made from less-efficient petroleum instead of from all 3 resources. Since I tend to use only light to moderate amounts of fuel (and can always just add more refineries/oil wells), this isn't an issue for me.

Here it is as part of my overall oil refinery. Still somewhat a work in progress, since I still need to find ways to use up all the oils I have stockpiled (I'm in the process of attaching a solid fuel depot to the petroleum pipeline). Off screen to the north is my lubrication section, which is also being fleshed out to move my previous express conveyor belt factory.
Factorio Oil 1.jpg
Factorio Oil 1.jpg (710.69 KiB) Viewed 19685 times

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

Re: Stall resistant oil processing

Post by MeduSalem »

Whillowhim wrote:The only major drawback is that solid fuel should be made from less-efficient petroleum instead of from all 3 resources. Since I tend to use only light to moderate amounts of fuel (and can always just add more refineries/oil wells), this isn't an issue for me.
That is actually the worst drawback from all because that completely overthrows the concept in the first place. :roll:

As you correctly said, there's pretty much no usage for Heavy Oil apart from converting it to Lubcricant and it's perfectly okay to split the little bit you actually need off with pumps that change the flow-priority so you always have some Heavy Oil/Lubricant in store in case you want to produce some more Engines/Express Belts.

Someone who doesn't depend on burning Solid Fuel is able to convert pretty much everything into Petroleum and doesn't have to rely on changing flow-priority by using pumps at all, since everything ends in the same output pipe and even if something stalls momentarely it will get unstuck once the cracking kicks in and unclogs the Refinery outputs.

But I'm somone who likes to build the energy production completely around burning Solid Fuel because I just hate the massive waste of space that are Solar Farms. So I actually need lots of Light Oil to make it at least work at a decent effeciency. And that's when the problems of "stalls" actually start occurring.

And your system still doesn't prevent stalling from happening in case of heavily depending on Light Oil for power production. Because when the Petroleum-wasters are stuck the Petroleum tanks/pipes will run full and eventually clog the Refinery outputs and thereby prevent Light Oil from being produced... and there's no way of converting Petroleum back to Light Oil in the case of overflow.

Then you again end up having Solid Fuel plants for both Light Oil and Petroleum and fiddling around manually with ratios and what not trying to find some balance in all the mess just to prevent either Light Oil or Petroleum starvation.

Until the new additions to the logic system and a way to measure how much of each liquid is stored in tanks there's no reliable way of preventing stalls or you just skip out on a part of the oil industry (Light Oil Processing) altogether. That or you have to split the Oil Industry up into two completely from each other seperated parts:

- Oil Industry for producing items
- Oil Industry for producing energy

That's the only way to give the desired control, but that also means twice or triple the pipe-mess because you can't do it centralized in one spot.

User avatar
The Phoenixian
Fast Inserter
Fast Inserter
Posts: 209
Joined: Mon May 26, 2014 4:31 pm
Contact:

Re: Stall resistant oil processing

Post by The Phoenixian »

Here's my favored pressure regulator: As the debug info shows, by placing multiple pumps along a line of pipe you can force fluid from the back end and into your storage area faster than it can flow back. The storage tanks denote the pressure at various points on the output line.
Factorio Pressure Regulator Example2.jpg
Factorio Pressure Regulator Example2.jpg (119.57 KiB) Viewed 19576 times
Depending on where you place the output line, You can set this to trigger only when your storage is almost completely full, or only once you have a decent reserve. If the output is a fuel cracking factory or a solid fuel converter, It will then drain your reserves to the desired level and no further. The only quirk of note is that the lowest ebb in the fluid levels is not always in the same place in the line, though that can easily be checked with an offshore pump.

And yeah this image is from a few versions ago but I built one in a more recent factory just yesterday (literally) and it works with the same quirks and all.
The greatest gulf that we must leap is the gulf between each other's assumptions and conceptions. To argue fairly, we must reach consensus on the meanings and values of basic principles. -Thereisnosaurus

User avatar
DerivePi
Filter Inserter
Filter Inserter
Posts: 505
Joined: Thu May 29, 2014 4:51 pm
Contact:

Re: Stall resistant oil processing

Post by DerivePi »

MeduSalem wrote:Until the new additions to the logic system and a way to measure how much of each liquid is stored in tanks there's no reliable way of preventing stalls or you just skip out on a part of the oil industry (Light Oil Processing) altogether. That or you have to split the Oil Industry up into two completely from each other seperated parts:

- Oil Industry for producing items
- Oil Industry for producing energy

That's the only way to give the desired control, but that also means twice or triple the pipe-mess because you can't do it centralized in one spot.
A fun problem with, what I believe, a current solution.

Use a smart chest for collecting solid fuel (ideally from the "light oil to solid fuel" chem plant). When the chest is empty (or below some threshold), operate a smart inserter that unloads solid fuel from the "petro to solid fuel" chemical plant.

As you noted, if petro gets backed up and fills its storage, it jambs the production of heavy and light oil, which will starve the light oil storage and allow the "solid fuel" smart chest, over time, to empty. This is corrected by both producing solid fuel with petro and reducing the stored petro which allows more production of heavy and light oils again.

Using this simple check with Whillowhim's forced storage system should do the trick!

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

Re: Stall resistant oil processing

Post by MeduSalem »

DerivePi wrote:A fun problem with, what I believe, a current solution.

Use a smart chest for collecting solid fuel (ideally from the "light oil to solid fuel" chem plant). When the chest is empty (or below some threshold), operate a smart inserter that unloads solid fuel from the "petro to solid fuel" chemical plant.

As you noted, if petro gets backed up and fills its storage, it jambs the production of heavy and light oil, which will starve the light oil storage and allow the "solid fuel" smart chest, over time, to empty. This is corrected by both producing solid fuel with petro and reducing the stored petro which allows more production of heavy and light oils again.

Using this simple check with Whillowhim's forced storage system should do the trick!
Well thinking of that in detail it would actually work, even without Smart Chests as buffer, I believe... ^^

Just using Whillowhim's forced storage alone could work... it just depends on the very strict order in which providers/consumers are being placed.

1) Heavy Oil output from refinery
2) Forced Storage for Heavy Oil (to make Lubricant)
3) Cracking Heavy Oil -> Light Oil
4) Light Oil output from refinery joins the one from cracking
5) Forced Storage for Light Oil (to make Solid Fuel)
6) Cracking Light Oil -> Petroleum
7) Petroleum output from refinery joins the one from cracking
8) Forced Storage for Petroleum (to make Sulfur/Plastik Bars)
9) Overproduction from Petroleum is turned into Solid Fuel

Then have the belt coming from the Light Oil Solid Fuel production get the priority at the Splitter and the belt coming from the Petroleum Solid Fuel production as secondary that only gets drawn from when the primary runs short, the way other "overproduction storage"-reinserters work.

This might actually work without any measurements, but I'd have to re-arrange a lot. :s

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

Re: Stall resistant oil processing

Post by Whillowhim »

Hmm, you're right. That would probably work better if you use a lot of fuel (though if you actually plan to use flamethrower fuel, it might deserve its own pump/tank priority). It would be a fairly simple modification to put the start of a fuel conveyor belt by the light oil tanks, and then run it by the petrol tanks on the way out of the base. Alternately, you can use the logistic system equivalent, where petroleum fuel only gets loaded into chests when fuel is <400, but light oil fuel is always loaded.

Though even with the base design, I still prefer it over most I've fiddled with. I'd much rather have an inefficient system that I can fix by adding more refineries and pumpjacks than a system that is always stalling and giving me nothing.

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

Re: Stall resistant oil processing

Post by MeduSalem »

Yeah, one can add a forced tank storage for alternative Light Oil processing before converting the rest into Solid Fuel of course.

I just didn't add Flamethrower Ammo to the mix because I basically never use that stuff. It's not worth it in my humble opinion due to lackluster damage output and for getting rid of forests I use Construction Robots.

But I'd definitely add an additional forced storage for Light Oil before turning the rest into Solid Fuel if there's ever going to be another use for it. ^^

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

Re: Stall resistant oil processing

Post by Whillowhim »

Yah, I always make a production path for flamethrower fuel.... then let it sit in the chests.

Trepidati0n
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Mon Jan 12, 2015 5:34 pm
Contact:

Re: Stall resistant oil processing

Post by Trepidati0n »

Late game...poison is "cheap" and clears a forest really fast! A single stack is usually way more than enough to clear out a path for a railroad expansion. With armor, you can stand in the poison. Almost basically run and gun and you have a clear path.

Only drawback is "Coal". If you are limited, not so awesome.

katt
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Mar 10, 2015 6:02 am
Contact:

Re: Stall resistant oil processing

Post by katt »

DerivePi wrote:
MeduSalem wrote:Until the new additions to the logic system and a way to measure how much of each liquid is stored in tanks there's no reliable way of preventing stalls or you just skip out on a part of the oil industry (Light Oil Processing) altogether. That or you have to split the Oil Industry up into two completely from each other seperated parts:

- Oil Industry for producing items
- Oil Industry for producing energy

That's the only way to give the desired control, but that also means twice or triple the pipe-mess because you can't do it centralized in one spot.
A fun problem with, what I believe, a current solution.

Use a smart chest for collecting solid fuel (ideally from the "light oil to solid fuel" chem plant). When the chest is empty (or below some threshold), operate a smart inserter that unloads solid fuel from the "petro to solid fuel" chemical plant.

As you noted, if petro gets backed up and fills its storage, it jambs the production of heavy and light oil, which will starve the light oil storage and allow the "solid fuel" smart chest, over time, to empty. This is corrected by both producing solid fuel with petro and reducing the stored petro which allows more production of heavy and light oils again.

Using this simple check with Whillowhim's forced storage system should do the trick!
no need for smart chest, I use this kind of configuration to self-regulate the light/petro consumption, I convert all kind of oil into petro, I only need to have the right amount of light oil to petro cracking.
The main point is if the light oil is stalling, the solid fuel backlog on the belt starts to empty, the petroleum solid fuel converters start to take over, thus using up petroleum, refinery running.
I think it's quite difficult to not have excess petroleum especially if you rely heavily on steam engine using 'only' solid fuel converted from light oil, you eventually end up with excess petroleum, and the most direct method to use up excess petroleum is to convert it into solid fuel. the convertion ratio is not as efficient as light oil but it's inevitable.

you can use pumps to force light oil to go to light oil - solid fuel converter first before going into light oil - petro cracking.

EDIT: please don't mind the pipes, I figured those solid fuel chemplants have 2 inputs, so I can prepare 2 different kinds of input, so I can just change the recipe without changing any plumbing. :D
Attachments
factorio_solidfuel.png
factorio_solidfuel.png (4.11 MiB) Viewed 18584 times

User avatar
GlassDeviant
Fast Inserter
Fast Inserter
Posts: 170
Joined: Wed Feb 11, 2015 1:51 am
Contact:

Re: Stall resistant oil processing

Post by GlassDeviant »

MeduSalem wrote:...I'd definitely add an additional forced storage for Light Oil before turning the rest into Solid Fuel if there's ever going to be another use for it. ^^
Such as Diesel Locomotives that actually run on Diesel instead of Coal? hehe :)
- GD

Sorry if my posts are becoming difficult to read, my typing ability is rapidly deteriorating due to a nerve disorder. I try to clean them up before posting but don't always get every last typo.

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

Re: Stall resistant oil processing

Post by MeduSalem »

GlassDeviant wrote:Such as Diesel Locomotives that actually run on Diesel instead of Coal? hehe :)
For example... xD

User avatar
Zourin
Fast Inserter
Fast Inserter
Posts: 246
Joined: Tue Feb 11, 2014 2:15 am
Contact:

Re: Stall resistant oil processing

Post by Zourin »

MeduSalem wrote: Until the new additions to the logic system and a way to measure how much of each liquid is stored in tanks there's no reliable way of preventing stalls or you just skip out on a part of the oil industry (Light Oil Processing) altogether. That or you have to split the Oil Industry up into two completely from each other seperated parts:

- Oil Industry for producing items
- Oil Industry for producing energy

That's the only way to give the desired control, but that also means twice or triple the pipe-mess because you can't do it centralized in one spot.

I'm going to have to agree with this. Pump regulation is good for regulating specifically within the item-production refinery to ensure there's enough heavy and light oil for burst demand, with (ideally) a robust petrol bank and some solid fuel production to vent excess. For more intense Fuel production, there's a much simpler refinery layout that shouldn't be balled up with item production and should be more appropriately regulated at the logistic level (ie. separate crude intake/tank reserve)

The good news is that power production is pretty small compared to item production by comparison (especially heavily engineered layouts), with just a heavy-to light, a couple light-to-fuel, and a petrol-to-fuel producing vast amounts of Solid fuel. Definitely a go-to for large steam plants (especially if you can produce the fuel right next to the boilers)

I see no reason why the two purposes should ever cross logistically, since a Solid Fuel stall is OK, but an item production stall isn't.

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

Re: Stall resistant oil processing

Post by MeduSalem »

Zourin wrote:I see no reason why the two purposes should ever cross logistically, since a Solid Fuel stall is OK, but an item production stall isn't.
I actually changed my mind about that during the last few weeks. Currently I'm using one centralized spot to produce solid fuel for my entire steam-only based power plant as well as my item production and it works perfectly fine.

The fact is... that Solid Fuel stall is NOT okay at all, while item production is pretty much an optional thing if enough power as well as oil products are left over. This is when you actually go for steam-only based power plants, because if you ever run out of solid fuel you are pretty much damned so you can't let this happen... EVER.



But I have no problems using one centralized oil based production facility because I've implemented and developed Whillowwhim's stall-resistant design further to a more modular design especially trimmed to give stall-resistant power production the highest priority, all while the "leftovers" are available to item production, with an option to upgrade the oil facility with more refineries/cracking if needed to support the item production. At least a certain amount of both the light oil and petroleum production are entirely reserved for power production and is never made available for item production because I use small pumps to split off whatever the power plants need before it could ever get to the item production.



The trick is the strict order in which providers/consumers are being placed:
  1. Heavy Oil output from Refineries
  2. Forced Storage for Heavy Oil (to make Lubricant or Flamethrower Ammo)
  3. Cracking Heavy Oil -> Light Oil
  4. Light Oil output from Refineries joins the one from Cracking
  5. 1st Forced Storage for Light Oil (to make Solid Fuel)
  6. 2nd Forced Storage for Light Oil (to make Flamethrower Ammo, but can be skipped if you don't use that, at least I don't)
  7. Cracking Light Oil -> Petroleum
  8. Petroleum output from Refineries joins the one from Cracking
  9. 1st Forced Storage for Petroleum (to make Solid Fuel)
  10. 2nd Forced Storage for Petroleum (to make Sulfur/Plastic Bars)
But to make that work as intended you also have to place the Light Oil to Solid Fuel plants in line of the belts BEFORE the Petroleum to Solid Fuel Plants. That way you ensure that Solid Fuel from Light Oil is used first and Solid Fuel from Petroleum is only used if the belt is still not filled up due to high demand. Doing otherwise or ignoring that important thing would render power production completely ineffecient by a whole lot because then your power plant will run mostly on Petroleum rather than on more efficient Light Oil.

That way it balances itself out once power demand reaches a certain threshold. If the power demand is near maximum it will use both Light Oil as well as Petroleum, if power demand is low or if there are more refinieres than needed to hold maximum power consumption then it will use mostly Light Oil and most of the Petroleum is available to Item Production. Sometimes it happens that if there's no Petroleum consumer that the Light Oil production stalls for a brief moment and that it will use up all Light Oil from the storage tanks until it has depleted them and when all the Light Oil to Solid Fuel plants are dried up it will eventually make room on the belts for the Petroleum to Solid Fuel plants at which point there is a Petroleum consumer again up to the point where there is enough Light Oil to balance everything out again.

Of course the item production will be limited if your power consumption is reaching maximum potential but it can be countered by placing additional refineries and cracking that only deal with item production. Those can easily be just plopped next to the existing in the modular setup with ease. Maybe just a little bit math on how much cracking you need to get all the additional excess Heavy/Light Oil to be cracked to Petroleum so that it doesn't stall those additional refineries.



I created an excel sheet that does pretty much exact math on the entire oil industry based on a given expected maximum target power output of steam engines as well as the amount of Heavy/Light Oil and Petroleum available to Item production in a per second as well as per minute manner.

The entire thing is balanced around using 2/3 Solid Fuel coming from Light Oil and 1/3 Solid Fuel coming from Petroleum... eventually using up all the output a refinery+cracking could possibly deliver. The Light Oil Solid Fuel:Petroleum Solid Fuel = 2/3:1/3 ratio derives from the fact that it takes only 1 Light Oil for 1 Solid Fuel, while it takes 2 Petroleum for 1 Solid Fuel, but if Heavy Oil is cracked to Light Oil and NO Light Oil to Petroleum then there's equal amounts of Light Oil and Petroleum.
Fuel Amount.png
Fuel Amount.png (10.61 KiB) Viewed 12745 times
Solid Fuel.png
Solid Fuel.png (27.53 KiB) Viewed 12745 times

At least all the math makes it possible to run following setup without any problems at max power output and still have some Petroleum left for item production:
  • Power Output: 244,8 MW
  • Steam Engines: 480
  • Boilers: 628
  • Pumps:Boilers:Steam Engines = 1:14:10 or 2:28:20 depending on space available
  • Refineries: 16
  • Heavy to Light Oil Cracking: 4
  • Light Oil to Petroleum Cracking: 6
  • Light Oil to Solid Fuel: 40
  • Petroleum to Solid Fuel: 20
  • Demand: 19.6 Solid Fuel/Second (1175 Solid Fuel/Minute), 32 Crude Oil/Second
  • Supply: 19.9 Solid Fuel/Second (1192 Solid Fuel/Minute), Heavy Oil: ±0.0/Second, Light Oil: ±0.0/Second, Petroleum: +6.7/Second
I upped the amount of Refineries/Chem Plants because I wanted to ensure a certain amount of Petroleum for item production. For power production only you actually could do it with 13 Refineries and 0 Light Oil to Petroleum Cracking too... but I found the above setting to be more appealing for some reason as it can easily be divided for less demand or multiplied for higher demands and it would still create appealing layouts.



Here is a variant of my setup on a new map I started a few days back with the oil industry setup appropriate for just 120 Steam Engines @ 61.2 MW:
020.png
020.png (2.03 MiB) Viewed 12749 times
The layout could be a bit optimized but since it is only a temporary solution until I move my base to the location I want to have it I guess it will suffice. What I haven't done yet in this map is a seggregation of power grids so that the power production related facilities + boiler inserters are running on the same grid as the steam engines and everything else item production related on an other grid sepperated by accumulators, so I can't run into blackouts when under maximum power demand.

Also don't worry about the Petroleum/Heavy Oil Pipelines going down, crossing the refnieries... they are going to the item production facilities which are located south west from the power plant. Couldn't do it any better because north west are quite a lot and big biter bases I can't clear up yet. North east are the steam engines and south east is a huge lake.



Also I hope for 0.12 already... as the new circuit logic stuff will make it probably much easier to handle some of the problems.

Post Reply

Return to “Show your Creations”