Why pressure goes down ?

  • doltox
    1st Mar 2012 Member 0 Permalink
    Hi, i wonder why pressure slowly goes down to zero in a space enclosed by wall. Is there any reason to calculate pressure in this way ? How to fix it ?
  • disturbed666
    1st Mar 2012 Member 0 Permalink
    That's made in the code to prevent bugs (or something like that)
  • Catelite
    1st Mar 2012 Former Staff 0 Permalink
    I don't think it was really to prevent bugs, but like, air in the game slowly returns to 0 pressure so that pressure doesn't last forever. I think it might just be an aesthetic thing, but basically if you want infinite pressure in a box, you'll need something to sustain it like PUMP.
  • doltox
    1st Mar 2012 Member 0 Permalink
    I don't want an infinite pressure with a source. I just want that things behave in a realistic way.

    I'm making a mod for TPT, to make it more realistic. I guess the makers of TPT don't have a lot of knowedges in physics.

    I have already coded 24 elements but it looks like complex to alter how pressure is calculated. I'm not an expert in C++. I hope someone will teach me how to fix this pressure issue or do it for me, thanks.
  • mniip
    1st Mar 2012 Developer 0 Permalink
    @doltox (View Post)
    Would you even be able to code core of air distribution????
    This might be just some rounding fail
    EDIT: KILL HIM WITH FIRE, HE SAID SKYLARK IS DUMB
    mod edit: ninja'd
    EDIT: KILL HIM WITH FIRE, HE SAID SKYLARK IS DUMB
  • doxin
    1st Mar 2012 Former Staff 0 Permalink
    @doltox (View Post)
    I can assure you that the people who collaborated to make TPT know their physics quite well. I can't tell you the reason why the pressure dissapears, but I'm sure that whoever programmed it had his reasons.
  • doltox
    1st Mar 2012 Member 0 Permalink

    doxin:

    @doltox (View Post)
    I can assure you that the people who collaborated to make TPT know their physics quite well. I can't tell you the reason why the pressure dissapears, but I'm sure that whoever programmed it had his reasons.
    The maker of TPT did a great job, most of fondamentals thermodynamics law are respected. But energy conservation is not.
    I don't say TPT is totaly dumb but I just want it to be more realistic (for example in tpt fire and plasma are different elements ... lol).

    I'm not a troll and as you see I don't feed them. I just want some help, thanks
  • jacksonmj
    1st Mar 2012 Developer 0 Permalink
    A thread where this issue has been previously discussed:
    https://powdertoy.co.uk/Discussions/Thread/View.html?Thread=8115

    What I said in that thread:
    It's a deliberate effect (but don't ask me why TPT air physics was made like this, because I don't know...). Every frame, pressure goes closer to zero by 0.01% of its current magnitude.
    The line responsible is "pv[y][x] *= AIR_PLOSS;"
    Although for some reason, with that removed, pressure still decreases very slowly. Possibly due to numerical inaccuracies somewhere.


    I am not completely ignorant of physics, and things such as the lack of energy conservation for ambient heat and the lack of momentum conservation for particles cause me some distress.

    The air simulation code was written by the original author of Powder Toy, who no longer works on the game on a regular basis. I don't yet know enough about computational fluid dynamics to make major modifications to the air simulation. I have a rough idea of what's going on, but not enough to, for example, add ideal gas behaviour when ambient heat is on (last time I tried that, many months ago, air tended to explode into NaNs and infinities whenever pressure was added).
  • doltox
    1st Mar 2012 Member 0 Permalink
    Thanks a lot for this reply.
    I'll take a look at this "air.c"

    things does not have to be perfect, if pressure goes down very slowly, it's not a problem.
    For the ideal gas behaviour, it seems hard for me to simulate in TPT. Ideal gas equation is a "state" equation, it means that the whole system must considered in order to calculate property of a particule. So in TPT
    In the way TPT is built you can only simulate exchange equations, or local equations. I don't know the exact word in english.

    Anyway, momentum conservation is a problem and i don't know if it can be fixed. I hope i'll manage this pressure issue.
  • Catelite
    1st Mar 2012 Former Staff 0 Permalink
    I've always seen the game as being a tower of Rule of Cool, a program that runs different kinds of cellular automata.

    Even though there's code for even refraction in glass with photons, individual particles have basically arbitrary mass since there are no units, so I've never seen it as being worth the effort to care so long as it at least superficially -seems- realistic. XD