Jump to content

Pressure at a given altitude


Recommended Posts

Yes, it depends on altitude only, though the pressure-altitude curve will be different for each body with an atmosphere.

It used to be (pre-1.0) that there was a simple exponential formula for each planet, where the pressure at some height y was given by P = P0e-y/h, where h was a constant for the planet (e.g. 5000 meters, for Kerbin) and P0 was the pressure at sea level.  However, now it's a more complex curve that's determined by in-game configuration and there's no simple formula.

If you want to know what the pressure is at a particular altitude, you can measure it by putting a barometer on a spacecraft, right-clicking it, and clicking "Toggle Display".  It will tell you the pressure as a percent of Kerbin sea-level pressure.

Link to comment
Share on other sites

I don't have a formula, but I did do some testing a while back for safe parachute deployment altitudes. That way I can just set my parachutes to open at a certain pressure to have them open at that altitude.

These readings are from 4km, 7km, 8km, and 9km.

Link to comment
Share on other sites

2 hours ago, Snark said:

If you want to know what the pressure is at a particular altitude, you can measure it by putting a barometer on a spacecraft

I’m planning to make a tool for some calculations, so I’d perfer an exact solution rather than dealing with test data.

2 hours ago, Snark said:

However, now it's a more complex curve that's determined by in-game configuration and there's no simple formula.

Is it implemented with FloatCurves or something similar? Can I find something like
{
  key = 0 1
  key = 5 0.45
  key = 10 0.18
  key = 20 0.025
  key = 40 0.001
  key = 70 0
}
somewhere in configs (or inside dll’s)?

Edited by Teilnehmer
Link to comment
Share on other sites

6 hours ago, Teilnehmer said:

Is it implemented with FloatCurves or something similar? Can I find something like

{
  key = 0 1
  key = 5 0.45
  key = 10 0.18
  key = 20 0.025
  key = 40 0.001
  key = 70 0
}
somewhere in configs (or inside dll’s)?

Yes, it's something like that.  I believe it's not located anywhere easy-- it's not in .cfg files, dunno if you could crack open the DLLs and see somewhere.

For mods, it's a different story-- planet packs almost always use Kopernicus, and any new planet using Kopernicus will have a .cfg that specifies this explicitly.

I recall reading somewhere within the last couple of weeks (may have been in the Kopernicus thread, though I don't recall exactly) somebody wanting this exact thing for the stock planets, and someone in the thread replied that there was some mod somewhere that included these values for the stock planetes, which the author had extracted somehow from KSP.  So I know it's possible to get it from somewhere, but not how.  I'd suggest rummaging around in the Kopernicus forum, and if you don't find it there, maybe post something there explaining that you want these curves for the stock planets.  Somebody there will know how to get them.

Note that it's not just a simple pressure curve-- temperature and molar mass get into the act, too.  So depending on what you want your tool to do, you may need to complicate your code a bit.

Edited by Snark
Link to comment
Share on other sites

7 hours ago, NathanKell said:

You can replicate it more or less by going here, and typing in 1.25x the altitude you have in KSP (i.e 8km in KSP -> 10km here).

Thanks. So, it’s easier to make my own floatCurve out of these values than to find the one actually used in the game?

What factors should I apply for the other planets?

Edited by Teilnehmer
Link to comment
Share on other sites

On ‎1‎/‎11‎/‎2016 at 1:20 PM, NathanKell said:

You can replicate it more or less by going here, and typing in 1.25x the altitude you have in KSP (i.e 8km in KSP -> 10km here).

http://www.digitaldutch.com/atmoscalc/

The equations used by that model can be found here (see Table 4):

http://www.braeunig.us/space/atmmodel.htm#USSA1976

However, you must convert Kerbin geometric altitude (z) to Earth geopotential altitude (h) using the following equation:

h = 7963.75·z / (6371 + 1.25·z)

For example, if you want to know the pressure at 10 km on Kerbin, plug z = 10 into the above equation and you get h = 12.4755 km'.  Now following the above link and plug h = 12.4755 into the equations in Table 4 to compute temperature, pressure and density.

This method won't match Kerbin pressure exactly, but it will be very close.  Kerbin air pressure is based on the US Standard Atmosphere, but the float curve method can't replicate the values exactly.

 

Edited by OhioBob
Link to comment
Share on other sites

2 hours ago, NathanKell said:

You're right, I always forget that step...

The calculator that @NathanKell linked to accepts geometric altitude (the conversion to geopotential altitude is undoubtedly included in the programming).  However, the equations upon which the calculator is based uses geopotential altitude.  Therefore, if one uses the equations directly (i.e. the page that I linked to), then the conversion to geopotential altitude must be made.

In other words,

If this page is used... http://www.digitaldutch.com/atmoscalc/

then convert Kerbin altitude to Earth altitude by multiplying by 1.25.

However,

If the equations in this page are used... http://www.braeunig.us/space/atmmodel.htm#USSA1976

then convert Kerbin altitude to Earth geopotential altitude by using the equation h = 7963.75·z / (6371 + 1.25·z).

 

Edited by OhioBob
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...