Null's Math Problem for 6 Months

Null if this is for your game then I stand by the answer I had in the previous thread: just use really basic rate equations or something for this, don't worry about it being thermodynamically perfect. At best it'll just be a lot of complicated equation solving for something barely anyone is going to appreciate, and at worst you'll end up with the "Reality is Unrealistic!" case: where your users will think the equations are fucked because the system doesn't react the way they expect a video game heat system to react.

If you still want the 'proper' solution anyway, a lot of the Kiwis in that original thread did some solid work. (e.g. here, here, here (using simple rate equations, go figure), here...)
 
IF this is for a game, and you need a somewhat more general equation, then you could use FD software to simulate many different situations and then linearly interpolate between the results as needed. Again though, I don't know what it's for, the parameter range ect...

If it's as straightforward as what you describe, then you could just simulate and take several "snapshots" as time goes on, then blend between them. That should be good enough for just about any purpose as far as presentation is concerned.

What if this is some kind of weird psychological test Null is doing on us.
 
  • Agree
Reactions: Yotsubaaa
this is just ugly math...
12mol gas with 20 °C and 13 mol with 40°
thats 0.2924 bar and 0.3384 bar

now there is a problem, i have no idea how you determine the speed of the pressure reaching equilibrium.
 
Chemical engineer here. This is an interesting mass transfer problem that's actually quite complex. You would have to use the diffusion equation because there is time dependence.

Because this is a 3D problem, an analytical solution would be somewhat difficult to get unless some dimensionality assumptions were made, so below is the numerical solution:

The diffusion coefficient of gases is very low, on the order of 1 x 10^-5, but changes with temperature. I couldn't be bothered to find the exact numbers, as it wouldn't have a big impact on the solution, especially in the timeframe asked for in the problem. There is no change in nitrogen or oxygen amount at all times. For chlorine however, there is movement from box B to box A.

0.2 sec:

1607900084147.png


1 sec.

1607900108413.png


5 sec.

1607900133104.png


Solution:

1607901624474.png


Edit: The reversed arc length refers the distance along the centerline of box B from where the boxes are joined.
 

Attachments

  • 1607901598402.png
    1607901598402.png
    38 KB · Views: 69
Math hard, make grug brain sore like when grug fall on rock.

That is unironically how these threads make me feel. Mathbros, how do you do it?
Well, don't feel bad about anything involving fluid dynamics at least. That's a highly specialized and difficult field that people spend years in school for and make bank for doing successfully. I've learned that's the case with a lot of things, and often solving it 'properly' is not worth the effort. You can get equally good results by just asking an oracle and cheesing the rest. It's not cheating if it's not against the rules.

Edit: The reversed arc length refers the distance along the centerline of box B from where the boxes are joined.
Thank you for clarifying that.
 
Last edited:
Equilibrium is reached after ~35 hours.
Really? It's that slow?

Why does it feel like if you're standing in a big room and open a jar containing a ton of some gas (like Chlorine), you'd probably see it spread around pretty fast? Is that just the energy in the air or what?
 
  • Dumb
Reactions: Ripple
Really? It's that slow?

Why does it feel like if you're standing in a big room and open a jar containing a ton of some gas (like Chlorine), you'd probably see it spread around pretty fast? Is that just the energy in the air or what?
I'm not an expert, but in any realistic situation, you'd probably have a door or curtain opening and that would probably create a lot of air disturbance, causing it to spread much quicker. There also isn't that much of a pressure differential in this case.
 
  • Agree
Reactions: Ballistic
Really? It's that slow?

Why does it feel like if you're standing in a big room and open a jar containing a ton of some gas (like Chlorine), you'd probably see it spread around pretty fast? Is that just the energy in the air or what?
Two things:

1. The simulation assumes that only diffusion is present. When gas moves, it can move in two different ways: convection, which is the gas being carried by another fluid (think mixing cream into coffee) and diffusion, which is the movement of gas based on the random movement of gas atoms by Brownian motion. In a real room, you would likely have air moving within it.

2. The plot is based on the average concentration in the entire box. In other words, it would take ~35 hours for the chlorine concentration at every point in Box B to equal the chlorine concentration of every point in Box A.

Edit: Also, in this case, you can see that as you get closer to equilibrium, the equilibration rate is slower. 15-20 hours is probably enough for all practical purposes.
 
that's not _a_ problem. that's _the_ problem. I have everything else sorted.
that shouldnt be to complex, but i have no idea how to find the right formula...


Chemical engineer here. This is an interesting mass transfer problem that's actually quite complex. You would have to use the diffusion equation because there is time dependence.
thats more complex than needed, the change in pressure should be the main factor.


Equilibrium is reached after ~35 hours.
what? im pretty sure thats wrong. or you mean chlorine concentration, not pressure...

we dont need that, the pressure difference is the main factor.
Navier-stokes is the right equation to look for, but i have no idea how to get the right formula for our problem.
 
Two things:

1. The simulation assumes that only diffusion is present. When gas moves, it can move in two different ways: convection, which is the gas being carried by another fluid (think mixing cream into coffee) and diffusion, which is the movement of gas based on the random movement of gas atoms by Brownian motion. In a real room, you would likely have air moving within it.

2. The plot is based on the average concentration in the entire box. In other words, it would take ~35 hours for the chlorine concentration at every point in Box B to equal the chlorine concentration of every point in Box A.

Edit: Also, in this case, you can see that as you get closer to equilibrium, the equilibration rate is slower. 15-20 hours is probably enough for all practical purposes.
Is there a fluid dynamics software that you'd recommend which is reasonably beginner friendly + doesn't cost multiple arms and legs?
 
Really? It's that slow?

Why does it feel like if you're standing in a big room and open a jar containing a ton of some gas (like Chlorine), you'd probably see it spread around pretty fast? Is that just the energy in the air or what?
That gas is most likely under pressure. Also, if you cracked an oxygen tank open in a chamber with slightly lower pressure you wouldn’t see the same effect.
 
Edit: Also, in this case, you can see that as you get closer to equilibrium, the equilibration rate is slower. 15-20 hours is probably enough for all practical purposes.
In my simulation I want things to move enough that people are able to work with gasses in real time. Before I had it so that the adjacent cubes would interact with each other as quickly as possible (i.e. a cube and its 6 adjacent neighbors would equalize 30 times per second, or as fast as the framerate could allow), which works, but then you have an issue where something is added to the air and then suddenly the room is just completely contaminated before you can even react.

I'm really trying to keep things simple, so I'm reluctant to say "okay I need to keep track of kinetic energy in each cube as well" - especially because there are going to be tens of thousands of these if things get bigger.

In SS13, I think gas just spreads at a fixed rate, which creates odd situations where a hull breach leaves only the neighboring tiles in an 8 block radius low pressure and things like 1 tile wide doorways effectively halt depressurization for 10 minutes before it spreads out of that room.
 
In my simulation I want things to move enough that people are able to work with gasses in real time. Before I had it so that the adjacent cubes would interact with each other as quickly as possible (i.e. a cube and its 6 adjacent neighbors would equalize 30 times per second, or as fast as the framerate could allow), which works, but then you have an issue where something is added to the air and then suddenly the room is just completely contaminated before you can even react.

I'm really trying to keep things simple, so I'm reluctant to say "okay I need to keep track of kinetic energy in each cube as well" - especially because there are going to be tens of thousands of these if things get bigger.

In SS13, I think gas just spreads at a fixed rate, which creates odd situations where a hull breach leaves only the neighboring tiles in an 8 block radius low pressure and things like 1 tile wide doorways effectively halt depressurization for 10 minutes before it spreads out of that room.
Could you use a fluid solver library and adjust the viscosity of the air/gas? It could be more resistant to disturbance while maintaining it's ability to spread at a slow-ish rate through doorways. For dealing with the amount of cells in the scene, could you partition the scene into larger blocks that turn on/off their simulation as needed? Maybe level of detail or a simplified algorithm could also apply if complex geometry was not involved in that room.

So for instance, if a room is entirely filled with gas, there's no need to simulate it anymore right? Similarly, if the gas has not reached the room yet, you also don't need to simulate it. So that just leaves the rooms that are currently being filled to be simulated, which should be significantly less, if I had to guess.
 
Back