[Klonan] [2.0.60] Hot water in boiler increase water consumption rather than decreasing it

This subforum contains all the issues which we already resolved.
pepciorek
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Oct 11, 2024 4:11 pm
Contact:

[Klonan] [2.0.60] Hot water in boiler increase water consumption rather than decreasing it

Post by pepciorek »

So from my understanding, the water consumption in a boiler is dependent on the water temperature. If the boiler fuel consumption is a limiting factor for water conversion, should hot water (with more energy) take less time to heat up, therefore making steam faster, or take less water and use the same energy to heat with constand speed?
07-24-2025, 13-27-02.png
07-24-2025, 13-27-02.png (54.84 KiB) Viewed 908 times
(100 degrees water turned in to steam - consumption = 13.8/s)
07-24-2025, 13-27-12.png
07-24-2025, 13-27-12.png (54.8 KiB) Viewed 908 times
(15 degrees water turned in to steam - consumption = 6/s)
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5410
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [2.0.60] Hot water in boiler increase water consumption rather than decreasing it

Post by Klonan »

Yes, I made some error in the physics or thermodynamic logic,
I have this on my TODO for 2.1
eugenekay
Filter Inserter
Filter Inserter
Posts: 602
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: [Klonan] [2.0.60] Hot water in boiler increase water consumption rather than decreasing it

Post by eugenekay »

I don't think there is any Bug here? The Thermodynamic math has always checked-out when I have used Modded fluids like this previously.... Vanilla Boiler has 1.8MW Power; I believe the Fluid rate is Calculated from the power_consumption, since I don't see it mentioned anywhere here.... It has a static target_temperature of 165 C, so in order to boil Steam at 165C:

100C Water: 1.8MW / 65 C Rise / 2kJ = 13.84/s
15C Water: 1.8MW / 150 C Rise / 2kJ = 6/s

Which matches the experimental numbers above. This does not match Reality, where Water has a Specific Energy of ~4.2J/C.... but Factorio is not a Physics simulation. :lol: Good Luck!
chrisgbk
Long Handed Inserter
Long Handed Inserter
Posts: 95
Joined: Mon Jan 02, 2017 4:31 am
Contact:

Re: [Klonan] [2.0.60] Hot water in boiler increase water consumption rather than decreasing it

Post by chrisgbk »

eugenekay wrote: Thu Jul 24, 2025 12:21 pm I don't think there is any Bug here? The Thermodynamic math has always checked-out when I have used Modded fluids like this previously.... Vanilla Boiler has 1.8MW Power; I believe the Fluid rate is Calculated from the power_consumption, since I don't see it mentioned anywhere here.... It has a static target_temperature of 165 C, so in order to boil Steam at 165C:

100C Water: 1.8MW / 65 C Rise / 2kJ = 13.84/s
15C Water: 1.8MW / 150 C Rise / 2kJ = 6/s

Which matches the experimental numbers above. This does not match Reality, where Water has a Specific Energy of ~4.2J/C.... but Factorio is not a Physics simulation. :lol: Good Luck!
If you look at the input in isolation, that makes sense, but doesn't make sense in the context of the output being clamped at the same volume in both cases. Either the output should be slowing the water consumption and fuel burn rate (to 2.6 water/s), or the output should increase correspondingly (to 138.4/s).

The water at 100 C already contains 85 C * 2kJ = 170kJ stored energy per unit, which at a water consumption rate of 13.84/s is about 2.35MW of energy stored in the water that just disappears. Instead of getting 4.15MW out, you get 1.8MW out.
eugenekay
Filter Inserter
Filter Inserter
Posts: 602
Joined: Tue May 15, 2018 2:14 am
Contact:

Re: [Klonan] [2.0.60] Hot water in boiler increase water consumption rather than decreasing it

Post by eugenekay »

chrisgbk wrote: Thu Jul 24, 2025 4:05 pmIf you look at the input in isolation, that makes sense, but doesn't make sense in the context of the output being clamped at the same volume in both cases. Either the output should be slowing the water consumption and fuel burn rate (to 2.6 water/s), or the output should increase correspondingly (to 138.4/s).

The water at 100 C already contains 85 C * 2kJ = 170kJ stored energy per unit, which at a water consumption rate of 13.84/s is about 2.35MW of energy stored in the water that just disappears. Instead of getting 4.15MW out, you get 1.8MW out.
I think that behavior is dependent upon how the Water is modded to reach 100C - changing the Water Prototype such that default_temperature = 100 yields this not-quite-right setup:
07-24-2025, 12-52-23.png
07-24-2025, 12-52-23.png (806.95 KiB) Viewed 744 times
I agree that it "ought to" produce an equivalent amount of Output Steam, either by reducing the Water consumption rate - or by consuming Energy slower. But I still don't think this is a Vanilla Bug. If anything, it is the Mod's fault for not increasing the Boiler's fluid boxes to suit. :-)
chrisgbk
Long Handed Inserter
Long Handed Inserter
Posts: 95
Joined: Mon Jan 02, 2017 4:31 am
Contact:

Re: [Klonan] [2.0.60] Hot water in boiler increase water consumption rather than decreasing it

Post by chrisgbk »

eugenekay wrote: Thu Jul 24, 2025 4:55 pm
chrisgbk wrote: Thu Jul 24, 2025 4:05 pmIf you look at the input in isolation, that makes sense, but doesn't make sense in the context of the output being clamped at the same volume in both cases. Either the output should be slowing the water consumption and fuel burn rate (to 2.6 water/s), or the output should increase correspondingly (to 138.4/s).

The water at 100 C already contains 85 C * 2kJ = 170kJ stored energy per unit, which at a water consumption rate of 13.84/s is about 2.35MW of energy stored in the water that just disappears. Instead of getting 4.15MW out, you get 1.8MW out.
I think that behavior is dependent upon how the Water is modded to reach 100C - changing the Water Prototype such that default_temperature = 100 yields this not-quite-right setup:
07-24-2025, 12-52-23.png
Would depend on if the default temperature of the steam was also changed. If in your picture the default water temperature was 100 C, and the steam default was left at 15 C, then both input and output in your picture are 1.8MW which would be correct under those conditions, as the water by definition now stores 0J of energy if the default is 100 C and it is currently 100 C (because the default is the minimum).
eugenekay wrote: Thu Jul 24, 2025 4:55 pm I agree that it "ought to" produce an equivalent amount of Output Steam, either by reducing the Water consumption rate - or by consuming Energy slower. But I still don't think this is a Vanilla Bug. If anything, it is the Mod's fault for not increasing the Boiler's fluid boxes to suit. :-)
The vanilla output fluid box is 200, so that should handle up to 12000/s assuming the entire fluid box can be emptied every tick, and there should be no need to modify that.
gatetman
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Mar 31, 2025 9:24 am
Contact:

Re: [Klonan] [2.0.60] Hot water in boiler increase water consumption rather than decreasing it

Post by gatetman »

Hi Klonan,

I ran into this in the vanilla base game also (2.0.7+) playing around with infinity-pipes.
Klonan wrote: Thu Jul 24, 2025 11:38 am I made some error in the physics or thermodynamic logic,
Sounds like you are aware that this is a bug, so I can skip the lengthy discussion trying to convince you that the current behavior doesn't really make sense.

Mostly this is just a suggested direction for a fix.


Observed behavior:
  • Boiler consumes water at boiler.energy_consumption / ((boiler.target_temperature - water.current_temperature) * water.heat_capacity)
  • Boiler produces steam at boiler.energy_consumption / ((boiler.target_temperature - steam.default_temperature) * steam.heat_capacity)
That is, the hotter the input water, the more of it is consumed; but the amount of steam produced is not affected by the input water temperature.

(Carried to its logical conclusion, in the extreme case with this formulation you can end up with more water consumed than steam produced.)


Expected behavior:
  • Steam should be produced at a fixed ratio to the amount of water consumed (10:1, based on the heat capacity ratio of water:steam), regardless of the input water temperature.
This could be achieved by tweaking the steam production rate to be:
  • Boiler produces steam at boiler.energy_consumption / ((boiler.target_temperature - water.current_temperature) * steam.heat_capacity)
The formula for water consumption remains the same as above, which results in:
  • Boiler consumes water at the steam:water heat capacity ratio (1:10) times the steam production rate.

This leaves the behavior the same for the normal case with default temp water (where water.current_temperature = water.default_temperature = steam.default_temperature = 15 C); and regardless of water temp it preserves conservation of energy.

pepciorek wrote: Thu Jul 24, 2025 11:28 am should hot water (with more energy) take less time to heat up
chrisgbk wrote: Thu Jul 24, 2025 4:05 pm The water at 100 C already contains 85 C * 2kJ = 170kJ stored energy per unit
As pepciorek and chrisgbk correctly observe, the problem with the 2.0.7+ behavior & concept of conservation of energy is that it does not consider the energy that went into heating the water from its default temp up to the input temp for the boiler. The solution concept to consider is that hot water has already received some heat energy to raise it above the default water temp, so less energy is needed to raise it to boiler.target_temperature (including at some point a free state transition from water->steam). Thus for hot water, the same power from burner fuel (boiler.energy_consumption) will cover converting more water to more steam than default temp water. It's true that the steam output will then store more energy than the burner fuel consumed by the boiler; but energy is conserved because the steam output energy is equal to the boiler's burner fuel plus whatever theoretical energy went into heating the input water that gets consumed.
Last edited by gatetman on Fri Jul 25, 2025 11:53 pm, edited 16 times in total.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5410
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [Klonan] [2.0.60] Hot water in boiler increase water consumption rather than decreasing it

Post by Klonan »

I have fixed it for the next release, with the following logic:

If the input fluid is hot, the boiler will be able to convert water to steam faster.
E.G, at 15 degrees:
15C water -> 165 Steam = 60/s

at 90 degrees:
90C water -> 160 Steam = 120/s

The ratio between water and steam is solely based on the relative heat capacities, because many other recipes and processes depend on the ratio not changing (like steam condensation)

I also tested with the Superheating mod (https://mods.factorio.com/mod/Superheating) and it seemed to work as expected.
Post Reply

Return to “Resolved Problems and Bugs”