- Joined
- Feb 3, 2013
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
that shouldnt be to complex, but i have no idea how to find the right formula...
thats more complex than needed, the change in pressure should be the main factor.
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.
Is there a fluid dynamics software that you'd recommend which is reasonably beginner friendly + doesn't cost multiple arms and legs?
There are a couple of options here. The equilibration rate should increase with increasing concentrations of gas (which will result in a higher starting pressure in Box B), so you could increase the chlorine concentration. Convection can also be added (windows, fans etc). I apologize if this isn't helpful.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.
How much more complicated is the math when you add in simple airflow? like if a 3x3x3 space is broken up into 27 cubes, how easy is calculating the convections of that room if there's a in and out vent port?Convection
I can give it a shot. Can you re-draw the figure with the location of the inlet and outlet, along with it's dimensions (if its a circle, the radius/diameter is fine) and the inlet air speed and composition? I will have to make some assumptions about the fluid viscosity, density etc.How much more complicated is the math when you add in simple airflow? like if a 3x3x3 space is broken up into 27 cubes, how easy is calculating the convections of that room if there's a in and out vent port?
Don't think of it like that.I can give it a shot. Can you re-draw the figure with the location of the inlet and outlet, along with it's dimensions (if its a circle, the radius/diameter is fine) and the inlet air speed and composition? I will have to make some assumptions about the fluid viscosity, density etc.
I am a little confused by the "3 cubes of atmosphere per meter"Don't think of it like that.
View attachment 1786767
It's a grid. 3x3. Each tile is 1x1x3, with 3 cubes of atmosphere per meter, so 27 per tile, 243 for the entire room. The input vent top-right adds air to the bottom 9 cubes of the 3x3x9 stack. The input on the bottom left removes them by pulling down. Do not account for radius, just do cubes.
How complicated is the math for dealing with kinetic force with gasses with this kind of set up?
Honestly if you aren't looking to make a scientifically accurate simulator just play around with formulas until you get something that feels right and is fun.How much more complicated is the math when you add in simple airflow? like if a 3x3x3 space is broken up into 27 cubes, how easy is calculating the convections of that room if there's a in and out vent port?
It's more than 2D.I am a little confused by the "3 cubes of atmosphere per meter"
The math here (at least the numerical calculations) are not difficult, especially if it can be reduced to a 2D problem. I can create a 3x3 sketch, and consider the cube in the top right to be the inflow and the bottom left cube to be the outflow. Would this be satisfactory?
yeah i have no idea how to do that...To get a good estimate of pressure, use the data I provided along with an equation of state (ideal gas law, Redlich-Kwong, Peng-Robinson etc.). Ideal gas law is by far the easiest here because there are multiple gases.
you should focus on the pressure differences.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.
yesHow complicated is the math for dealing with kinetic force with gasses?
that will kill the framerate pretty fast^^A room that is 3x3 has 9 of these tiles, with 27 atmosphere cubes each, so that 3x3 room has 81 atmosphere cubes that are diffusing into each other. If I add kinetic force to gas, then they also have to deal with direction and force.
So how I am interpreting this is one component is a rubix cube of 3x1x1 boxes like soIt's more than 2D.
Imagine a rubicks cube that is 1m^3. Each cube component of this (the 9 individual cubes that make up a rubicks cube) is a 'gas jar' that represents a part of the atmosphere for the purposes of the simulation. A tile 1m wide and 3m tall, so imagine 3 of those rubicks cubes on top of each other. That's the 27 atmosphere cubes that make up a single tile.
A room that is 3x3 has 9 of these tiles, with 27 atmosphere cubes each, so that 3x3 room has 81 atmosphere cubes that are diffusing into each other. If I add kinetic force to gas, then they also have to deal with direction and force.
Okay, so another 9 of these forms the complete cube?
cube | 1 | 2 |
pressure gas a | 100 | 100 |
pressure gas b | 10 | 0 |
total pressure | 110 | 100 |
cube | 1 | 2 |
pressure gas a | 100 | 100 |
pressure gas b | 9 | 1 |
total pressure | 109 | 101 |
The real shitbitch with fluid dynamics solvers is numerical stability. I wouldn't attempt to try to wing that... they have a tendency to explode really easily and at unpredictable times when kinetic forces get involved.you also should use some way to not calculate everything at the same time...
check difference of every even cube row with the row above it in one frame, than with with the row below in the next frame, same for the sides.
its not perfect but should help with performance.
cube 1 2 pressure gas a 100 100 pressure gas b 10 0 total pressure 110 100
the next step is to find a formula to use for the change in pressure. lets say change the difference by 1 every tick so new the we have(thats not the formula you should use!)
cube 1 2 pressure gas a 100 100 pressure gas b 9 1 total pressure 109 101
you can use that system for mixtures of gas AND for pressure.
thats why he should do it as simple as possible, it just has to feel good and fit what people think is real(very few people have a clear idea how it works in reality so matching the feel is more important),The real shitbitch with fluid dynamics solvers is numerical stability. I wouldn't attempt to try to wing that... they have a tendency to explode really easily and at unpredictable times.
Yeah, the problem I'm struggling with here is that I don't know exactly how interactive these gasses need to be. There's talk of kinetic forces, but that simulation resolution is so low that they probably can't do anything interesting. At that kind of granularity, really all you can do is slowly move gasses as a block in a particular direction with wind force.thats why he should do it as simple as possible, it just has to feel good and fit what people think is real(very few people have a clear idea how it works in reality so matching the feel is more important),
the change by 1 was just an example to make things easyer to understand, it should be a bit more complex than that.
Science is best described as the process by which lazy mathematicians winnow away complexity from a system until they are left with an easily digestible "good enough" model.thats why he should do it as simple as possible, it just has to feel good and fit what people think is real(very few people have a clear idea how it works in reality so matching the feel is more important),
the change by 1 was just an example to make things easyer to understand, it should be a bit more complex than that.
thats why pressure is so elegant, it solves most problems well enough.Yeah, the problem I'm struggling with here is that I don't know exactly how interactive these gasses need to be. There's talk of kinetic forces, but that simulation resolution is so low that they probably can't do anything interesting. At that kind of granularity, really all you can do is slowly move gasses as a block in a particular direction with wind force.
from high to low pressure. you can even use it as basis for some weather model if you go big enough.Using Dear Feeder's 6 Month Question, why bother modeling and calculating out every vortex and turbulence in this system instead of presuming basic diffusion in one direction?