Jump to content

Math behind the temp change per pipe segment?


Recommended Posts

Supposed I have a large pool/reservoir of PW at temperature T1 that has been sitting around for a while so it has a uniform temperature. Across the middle of the pool I have N segments of liquid pipe made of material M. If I then pass 10 kg packets of PW all with starting temperatures T2 through the pipe, how do I calculate the temperature of the packets when they exit the last segment of pipe? For simplicity let assume the pool is of infinite size or that I am constantly adding/removing heat to the large pool to exactly offset the heat removed/added from the pipe contents and that the pool has lots of tempshift plates to maintain a uniform temperature.

 

Link to comment
Share on other sites

That is not easy because you need to account for the Thermal Conductivity of the liquid tile, the pipe running through it and the liquid contents of the pipe.  

Very broadly speaking, this is the essence of the counterflow heat exchanger used in most Petroleum Boiler builds.

As the pipe gets longer, the output temperature approaches the temperature of the pool.  Using a Radiant pipe with high TC, output temperature will be approximately equal to pool temperature in 20-50 pipe segments depending on the initial difference in temperature.

IIRC, if the pool is p-water, and the pipe contains p-water, and you're using any metal Radiant pipe you shouldn't need much more than 20 to get passably close as you can't have much more than 100C of delta (aside from special cases of small packets).

With a petro boiler where your delta is >300C you need upwards of 40.

Link to comment
Share on other sites

3 hours ago, beeper said:

how do I calculate the temperature of the packets when they exit the last segment of pipe?

Empirically.

Spoiler

But seriously, ima try to break it down.

First tick the polluted water enters the pipe it trades heat with the pipe according to the formula:

{\displaystyle q=\Delta T\cdot \Delta t\cdot k_{average}\cdot 50}

  • {\displaystyle \Delta T} the Temperature difference in °C
  • {\displaystyle \Delta t} the passing time
  • {\displaystyle k_{average}} the average of the thermal conductivity of the pipe material and polluted water (0.58)

The next tick do that calculation again and also the calculation for heat transfer between the pipe and reservoir water, which is governed by this equation:

{\displaystyle q=\Delta T\cdot \Delta t\cdot k_{lowest}\cdot 1000}

  • {\displaystyle k_{lowest}} is the lower of the thermal conductivity among the pipe and reservoir water

The next tick, do the previous two calculations again plus the transfer in the reservoir cells thusly:

{\displaystyle q=\Delta T\cdot \Delta t\cdot k_{geom}\cdot 1000\cdot 625}

  • {\displaystyle k_{geom}} is the geometric mean of the two tiles: {\displaystyle {\sqrt {k_{1}\cdot k_{2}}}} (which in this case is just k)

Okay, we're 3/5ths of a second into the journey. The liquid has not moved on to the next pipe segment yet. You have two more iterations of all three calculations to do before you move to the next title and segment. Then you iterate.

Oh, yah there are upper and lower bounds that prevent heat transfer.

I've thought about writing a script or spreadsheet, but it's just easier to sandbox it.

See @Yothiel's work here and the wiki entry based off their post.

Link to comment
Share on other sites

31 minutes ago, occamrazor said:

<<lots of math>>
...but it's just easier to sandbox it.
 

That's more or less where I was going.  For things like this, it's much easier to figure out where you're trying to go and then experiment your way there.  The heat dropoff in the piped liquid is exponential decay, but, "about how much pipe do I need to cool it to <20c" is far easier to answer than "exactly how much does the temp drop with each pipe segment".

Link to comment
Share on other sites

20 hours ago, occamrazor said:

I've thought about writing a script or spreadsheet, but it's just easier to sandbox it.

When you write such a spreadsheet, and then discover things don't match up, it can lead to bug chasing and physics abusing. Fun times to be had.  However, then you have to keep track of all the little bugs that haven't been fixed, to make sure your spreadsheet predicts correctly. These tiny bugs add up.  If you ever decide to make such spreadsheet and want help tracking down errors, feel free to post and ask. 

Link to comment
Share on other sites

I made a tool for calculating heat exchange parameters here.  The documentation, in particular, contains formulas for solving exactly this sort of problem.  You will need to compute your own value for the thermal conductivity between the coolant and the body of fluid, but one of my formulas (flow against stationary mass) should get you what you want.  Note that these formulas are a conservative approximation, due to the fact that the game uses discrete time/space and these formulas assume continuous time/space.  The difference between the formulas and the game won't be large, and will tell you to slightly overbuild your system anyways (which is always safe).

Link to comment
Share on other sites

On 3/1/2021 at 11:31 AM, Zistack said:

I made a tool for calculating heat exchange parameters here.  The documentation, in particular, contains formulas for solving exactly this sort of problem.  You will need to compute your own value for the thermal conductivity between the coolant and the body of fluid, but one of my formulas (flow against stationary mass) should get you what you want.  Note that these formulas are a conservative approximation, due to the fact that the game uses discrete time/space and these formulas assume continuous time/space.  The difference between the formulas and the game won't be large, and will tell you to slightly overbuild your system anyways (which is always safe).

Wow, that looks really nice and seems like a good general tool. Now I just need to rip out the small bits that handle what I want.

Link to comment
Share on other sites

Zistack, your script does not seem to support a heat exchanger without an airlock as in my example.
If I am following the math correctly (https://github.com/Zistack/ONI-Heat-Exchanger-Calculator/blob/master/doc/HeatExchanger.pdf), I think my example is equivalent to your mass against flow setup with n (the number of tiles past the airlocks) equal to 1 and an airlock made out of a magical material with an infinite thermal conductivity. Does that make sense? If so, any chance of adding a material like that to the script?

Link to comment
Share on other sites

You actually would not have tiles in this case, because those tiles add thermal resistance to the system.  n=0 is technically a configuration that makes sense, but would generally be ill-advised for real builds, especially ones using fluids.

Adding an infinitely conductive material would not work, since I wouldn't know which heat exchange formula to use when dealing with the interaction, as they vary from configuration to configuration.  You would get the wrong answer if you tried to compute the conductivity exactly as you described (even if you fix the fact that you would want n=0 rather than n=1), simply because I would end up using the wrong formulas for the pipe-to-mass interaction.

I wasn't expecting you to use the script directly, since I know it doesn't quite cover your use case.  The mass against flow equation is what you want.  You just need to come up with a different value for k.  In your case, it's just 1/(coolant-to-pipe-resistance + pipe-to-mass-resistance).

I've thought about adding the ability to override the heat exchanger configuration and just provide a custom value of k, which would get you what you want fairly easily.  You would have to compute k yourself, but that's not difficult in your case.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...