How do you change the recipe of Chemical Plants if you can't change the input fluids?
Consider the following use case:
I've a bunch of Chemical plants that create solid fuel from petroleum, light/heavy oil.
I want to dynamically change the recipe to the highest reserve of liquid in order to auto-balance.
However I cannot dynamically change the input fluid. So making use of "Set Recipe" seems essentially impossible with the exception of the solid fuel & lubricant recipe as they take the same input.
Except if you use a roundabout way with barrels.
Chemical Plant: Circuit "Set Recipe" not usable?
Re: Chemical Plant: Circuit "Set Recipe" not usable?
Nevermind I found the solution to my problem.
Pumps with filters set by circuits! It's basically a switch. When the pipe is empty It'll allow the other fluid to flow in.
However my new problem is that I can't set the specific recipe for solid fuel for the chemical plant.
Pumps with filters set by circuits! It's basically a switch. When the pipe is empty It'll allow the other fluid to flow in.
However my new problem is that I can't set the specific recipe for solid fuel for the chemical plant.
Re: Chemical Plant: Circuit "Set Recipe" not usable?
For solid fuel, chemical plants have always 2 identical inputs. If you want to switch between light oil and petroleum (as I do), you can connect one fluid input with light oil supply and the other with petroleum supply.
This is an example where as default the recipe is solid fuel from light oil, and if there is more than 20000 petroleum in the storage tank, the recipe is switched to solid fuel from petroleum. The petroleum recipe signal is just added to the green wire and the light oil recipe can stay, because the petroleum recipe has priority if both are on the wire (seems some internal ordering).
If you just have one input for a different recipe and that gets switched to a different fluid, you can probably change the fluid in the input pipe. My approach would be to use pumps as a valve and feed the input pipe with the proper fluid currently required by the recipe. And use pipes with filter to flush unwanted fluid from that pipe segment back into their storage. Didn't try that, seems like overengineering, but I don't see why it couldn't work.
This is an example where as default the recipe is solid fuel from light oil, and if there is more than 20000 petroleum in the storage tank, the recipe is switched to solid fuel from petroleum. The petroleum recipe signal is just added to the green wire and the light oil recipe can stay, because the petroleum recipe has priority if both are on the wire (seems some internal ordering).
If you just have one input for a different recipe and that gets switched to a different fluid, you can probably change the fluid in the input pipe. My approach would be to use pumps as a valve and feed the input pipe with the proper fluid currently required by the recipe. And use pipes with filter to flush unwanted fluid from that pipe segment back into their storage. Didn't try that, seems like overengineering, but I don't see why it couldn't work.
- Attachments
-
- out.mp4
- (6.94 MiB) Downloaded 21 times
Re: Chemical Plant: Circuit "Set Recipe" not usable?
Oh, I didn't know about
Thanks for the feedback.
.Thanks for the feedback.
Re: Chemical Plant: Circuit "Set Recipe" not usable?
And thanks to you for the thread. I didn't realize setting recipes has a real practical use and isn't just mythical base building for the sake (and fun) of building complex circuits. Previously, I had duplicated chemical plants with both recipes and switched supply with pumps. Now it's a very clean design with recipe switching. I guess there are more use cases than this example.
-
- Burner Inserter
- Posts: 12
- Joined: Wed Oct 12, 2022 9:51 pm
- Contact:
Re: Chemical Plant: Circuit "Set Recipe" not usable?
You can set the recipe and the filter for the pump, and that works for the pipes that come after the pump but that doesn't clear out the previous liquid that was in the pump itself. Any way to address that?
Re: Chemical Plant: Circuit "Set Recipe" not usable?
So I didn't actually go for either designs in my factory because I had to get it up quickly so I went for petroleum only and having the auto-balancing be done with oil-cracking.
That said Tertius dual fluid design is nice compromise between complexity and Effectiveness.
In order of complexity:
1: One liquid per chemical plant
2: Tertius's Dual liquid per chemical plant design
3: My Triple liquid per chemical plant idea.
To (sorta) answer PrimeEagle's question.
In theory you could pump it back into your supply with filters pumps & power switch making all the non active fluid's pumps active.
But, there is more to it, you'll also need to take into account when fluids hit equilibrium and start switching recipes too quickly when you have the switch condition:
P: Petroleum
L: Light oil
H: Heavy Oil
P: {P<L AND P<H} -> Use Petroleum recipe
L: {L<P AND L<H} -> Use Light oil recipe
H: {H<P AND H<L} -> Use Heavy oil recipe
You'll need a buffer, to remedy this you can use a upper and a lower bound... or something TBD. I need to get back to my mess of a factory.
In practice, I'll give it a shot when I finish space age. Or sooner.
That said Tertius dual fluid design is nice compromise between complexity and Effectiveness.
In order of complexity:
1: One liquid per chemical plant
2: Tertius's Dual liquid per chemical plant design
3: My Triple liquid per chemical plant idea.
To (sorta) answer PrimeEagle's question.
In theory you could pump it back into your supply with filters pumps & power switch making all the non active fluid's pumps active.
But, there is more to it, you'll also need to take into account when fluids hit equilibrium and start switching recipes too quickly when you have the switch condition:
P: Petroleum
L: Light oil
H: Heavy Oil
P: {P<L AND P<H} -> Use Petroleum recipe
L: {L<P AND L<H} -> Use Light oil recipe
H: {H<P AND H<L} -> Use Heavy oil recipe
You'll need a buffer, to remedy this you can use a upper and a lower bound... or something TBD. I need to get back to my mess of a factory.
In practice, I'll give it a shot when I finish space age. Or sooner.
Re: Chemical Plant: Circuit "Set Recipe" not usable?
Switching recipes this way isn't a good approach, in my opinion. One should prefer the light oil recipe, because it is the most efficient. It requires 10 light oil. The other ones need double. They are just there for emergency use or to get rid of the fluid faster. However, to get rid of some fluid, you better use cracking.
For example, heavy oil cracking consumes 40 heavy oil and produces 30 light oil, which can be converted to 3 solid fuel. Directly converting 40 heavy oil to solid fuel just yields 2 solid fuel. It's even worse if you crack light oil to petroleum, then make solid fuel.
This will happen if you just check for oil level to decide which recipe you use.
If you have a production line just for solid fuel+rocket fuel, there is an easy optimal algorithm for advanced oil processing:
- crack heavy oil to light oil
- build the proper amount of light oil-to-solid fuel plants and petroleum-to-solid fuel plants
- the amount of machines is fixed, because the ratio of petroleum and light oil is fixed.
- no dynamic recipe switch required, because all the plants are operating simultaneously
Similar for coal liquefaction. I didn't actually compute numbers, but as far as I see it, this is the most efficient way for solid fuel production. You need much less petroleum processing plants and can move them to the light oil recipe. Heavy oil is still cracked to light oil. Such a factory also doesn't need dynamic recipes.
You need dynamic recipes only for unknown output ratios, for example if you feed a mall that's producing items you need for building. In this case, you need heavy oil for lubricant, light oil for solid fuel, petroleum gas for plastic and sulfur. Just the surplus of light and heavy oil needs to be cracked. It must be cracked to keep all 3 fluids balanced, but in a balanced (circuit controlled) way. The challenge is that if there is a surplus of petroleum, the refineries will clog.
So this is where we can employ dynamic recipes. We use petroleum-to-solid fuel only for getting rid of petroleum surplus, because there is no other way to get rid of it (given that for some reason our mall doesn't need plastic/sulfur and nothing except trains will consume something from our plant).
So do this:
- enable heavy oil cracking only if the heavy oil storage is full (MUST do to unclog refinery from heavy oil)
- enable light oil cracking only if the light oil storage is full (MUST do to unclog refinery from light oil)
- enable petroleum-to-solid fuel recipe if the petroleum storage is full (MUST do to unclog refinery from petroleum)
- enable petroleum-to-solid fuel recipe if the light oil storage is empty (MUST do to consume petroleum to restart refinery processing to get more light oil)
- enable light oil-to-solid fuel recipe otherwise
In my own oil processing plant, I added another component. It can happen the mall consumes more heavy oil (through lubricant) the plant is able to produce without clogging petroleum. I encountered this by building huge amounts of blue belts and nothing else at the same time. So I added one coal liquefaction refinery to produce the missing heavy oil, and all refineries get additional controls:
- enable coal liquefaction refinery if heavy oil storage is empty (MUST do to have enough heavy oil/lubricant)
- enable advanced oil processing refineries if petroleum is below threshold; threshold is below recipe switching threshold to avoid getting stuck in the inefficient petroleum-to-solid fuel recipe; interacts with the threshold of the recipe switching above (MUST do to get efficient solid fuel recipe)
For example, heavy oil cracking consumes 40 heavy oil and produces 30 light oil, which can be converted to 3 solid fuel. Directly converting 40 heavy oil to solid fuel just yields 2 solid fuel. It's even worse if you crack light oil to petroleum, then make solid fuel.
This will happen if you just check for oil level to decide which recipe you use.
If you have a production line just for solid fuel+rocket fuel, there is an easy optimal algorithm for advanced oil processing:
- crack heavy oil to light oil
- build the proper amount of light oil-to-solid fuel plants and petroleum-to-solid fuel plants
- the amount of machines is fixed, because the ratio of petroleum and light oil is fixed.
- no dynamic recipe switch required, because all the plants are operating simultaneously
Similar for coal liquefaction. I didn't actually compute numbers, but as far as I see it, this is the most efficient way for solid fuel production. You need much less petroleum processing plants and can move them to the light oil recipe. Heavy oil is still cracked to light oil. Such a factory also doesn't need dynamic recipes.
You need dynamic recipes only for unknown output ratios, for example if you feed a mall that's producing items you need for building. In this case, you need heavy oil for lubricant, light oil for solid fuel, petroleum gas for plastic and sulfur. Just the surplus of light and heavy oil needs to be cracked. It must be cracked to keep all 3 fluids balanced, but in a balanced (circuit controlled) way. The challenge is that if there is a surplus of petroleum, the refineries will clog.
So this is where we can employ dynamic recipes. We use petroleum-to-solid fuel only for getting rid of petroleum surplus, because there is no other way to get rid of it (given that for some reason our mall doesn't need plastic/sulfur and nothing except trains will consume something from our plant).
So do this:
- enable heavy oil cracking only if the heavy oil storage is full (MUST do to unclog refinery from heavy oil)
- enable light oil cracking only if the light oil storage is full (MUST do to unclog refinery from light oil)
- enable petroleum-to-solid fuel recipe if the petroleum storage is full (MUST do to unclog refinery from petroleum)
- enable petroleum-to-solid fuel recipe if the light oil storage is empty (MUST do to consume petroleum to restart refinery processing to get more light oil)
- enable light oil-to-solid fuel recipe otherwise
In my own oil processing plant, I added another component. It can happen the mall consumes more heavy oil (through lubricant) the plant is able to produce without clogging petroleum. I encountered this by building huge amounts of blue belts and nothing else at the same time. So I added one coal liquefaction refinery to produce the missing heavy oil, and all refineries get additional controls:
- enable coal liquefaction refinery if heavy oil storage is empty (MUST do to have enough heavy oil/lubricant)
- enable advanced oil processing refineries if petroleum is below threshold; threshold is below recipe switching threshold to avoid getting stuck in the inefficient petroleum-to-solid fuel recipe; interacts with the threshold of the recipe switching above (MUST do to get efficient solid fuel recipe)
Re: Chemical Plant: Circuit "Set Recipe" not usable?
I also made a naive implementation that uses all 3 oil types and performs pipe flushing: viewtopic.php?p=633905#p633905