This is probably related to viewtopic.php?f=7&t=117768 and viewtopic.php?f=7&t=117719
- Step 1: Create a disconnected pipe that is filled with fluid. I connect it to a pump, fill it with water and then remove a connection pipe. This now contains 100 fluid.
- Step 2: Add a new pipe to the disconnected pipe. The fluid is evenly distributed between the two segments (each now contains 50).
- Remove the new pipe. Now the first segment is back to "100". So the fluid system "squishes" the fluid back into the remaining pipe and removes the empty pipe.
That makes sense for "remove a segment from a pipe". In general the fluid system makes an attempt to preserve any fluid and not destroying it. It destroys fluid only if a segment would be "overfilled": connect three pipes to a pump, fill them all up, remove a connecting pipe. Now three isolated segments contain 300 fluid. Remove the middle segment. Now the two remaining segments each contain 100 fluid. Rebuild the middle segment. The three pipe combo now contains 200 fluid. 100 have been destroyed. Repeating the same process retains the 200 fluid.
But what if an element of a pipe is teleported away? In the 1.1 fluid system, moving an entity around and disconnecting it from a fluid system retained the contents of that element. In the new fluid system, all the fluid is retained it the part that is not moving and the piece that moves is empty (that is viewtopic.php?f=7&t=117719). So you can not move a storage tank away from a fluid system in 2.0 because it becomes immediately empty. The system tries to retain all the fluid in the non teleporting part of the segment.
The algorithm mentioned in https://factorio.com/blog/post/fff-416 describes that "Pipes, underground pipes, and storage tanks are merged into fluid "segments". So when an element is deleted from the segment, the total amount is retained, unless it exceeds the new capacity (that is the behavior shown above). The base game does not consider a part of a fluid segment "teleported" away (IAW split but both ends are retained as entities). In that case, the teleported entity is empty and the amount of fluid is retained as much as possible in the non-teleported part.
The fluid system should differentiate between whether an entity disconnected from the fluid segment is destroyed (in that case the fluid should be "squeezed" back into the remaining fluid segment as much as possible) or teleported (in that case, the fluid in the teleported entity should be retained as a new fluid segment and the amount removed from the fluid segment that it was disconnected from).
This also applies when an entity is moved ("teleported") to connect to a segment. In that case, the fluid segment is extended to contain the moved entity and the contents should be merged. The base game already refuses to move an entity into a place where different fluids would merge (I could trivially do that in the 1.1 game but so far I have not found a way in 2.0 to connect two different fluids).
I consider the current behavior a shortcoming (reluctant to call it a bug because the base game does not use teleporting of entities, but as the mod API supports it (entity.teleport succeeds for pipes and storage tank), the fluid system should behave as it did in 1.1 - @raiguard
[2.0.11] Fluid system inconsistencies when splitting segments
Re: [2.0.11] Fluid system inconsistencies when splitting segments
Thanks for the report, I think this is a duplicate of 117719. Please let us know if you still experience the issue.