Stationeers

Stationeers

View Stats:
JeanDeaux Jan 19, 2022 @ 4:21pm
Need formula for Temp change of mixing gasses
I'm toying with using a gas mixer as a temperature control device and the research I'm doing on formula's is just going over my head and I'm hoping some of you smarter stationeers might be able to translate this desire into a formula.

For two similar gas sources, we will know pressure, temperature, and moles for each. If I have a desired temperature result, what would be the formula to calculate the ratio mixture of a hot gas and cold gas to reach that desired temperature?

Assume pressures of each gas source to be different.
< >
Showing 1-3 of 3 comments
aaron Jan 20, 2022 @ 4:01am 
there is some working code on the workshop called gas mixer fixer.
it works. you can edit the code to change the ratio
Last edited by aaron; Jan 20, 2022 @ 4:02am
Murk Jan 20, 2022 @ 7:14am 
Personally I equalise the pressures first with regs on each line before the mixer (simpler, as you'll see AND safer since it reduces the chance of accidentally heating a cold high pressure gas to a point where it over-pressures and bursts pipes or tanks). Once that's done, for equal pressures the calculation is pretty simple...

Target temperature T0
Input gases at temperatures T1 and T2
M1 is mixer input 1 setting (ie the value you send to the mixer to set it)

M1 = abs(T2-T0)/(abs(T1-T0)+abs(T2-T0))

Examples:
Gas 1 at 375K, gas 2 at 250K, target temp 275K:
Mixer setting is 25/(100+25)= 20%
Gas 1 at 500K, gas 2 at 250K, target temp 275K:
Mixer setting is 25/(225+25)= 10%
Gas 1 at 300K, gas 2 at 150K, target temp 275K:
Mixer setting is 125/(25+125)= 83%
Gas 1 at 250K, gas 2 at 375K, target temp 275K:
Mixer setting is 100/(100+25)= 80%

From the first and last examples, you'll see it doesn't matter which way round hot and cold are - the system will compensate

It goes slightly wrong when it needs under 1% or over 99%, because one gas is very hot and the other is close to target temperature, because the mixer just takes an integer and you can't therefore feed in numbers like 0.1%, even programatically
Gas 1 at 1275K, gas 2 at 270K, target temp 275K:
Mixer setting is 5/(1000+5)= 0.5%, but you'll actually get a setting of 1%, resulting in gas at 280K

Of course it all goes wrong when both are above or both are below the target and thus there's no valid mix...
Gas 1 at 300K, gas 2 at 375K, target temp 275K:
Mixer setting is 100/(100+25)= 80% (resulting gas will be at 315K)
Gas 1 at 875K, gas 2 at 675K, target temp 275K:
Mixer setting is 400/(600+400)= 40% (resulting gas will be at 755K!!)

But barring that "minor" issue, the calculation is simple enough to implement however you prefer - with IC code (simplest and my preferred solution) or logic chips (from memory, I think you need 6 to do the calculation plus a memory for the target, 2 readers and 1 writer)
JeanDeaux Jan 20, 2022 @ 1:47pm 
Thanks guys, I'll give these a go. Great tip on using a reg to equalize the gasses first, I'll do just that.
< >
Showing 1-3 of 3 comments
Per page: 1530 50

Date Posted: Jan 19, 2022 @ 4:21pm
Posts: 3