Jump to content

Atmosphere Model


Thomot512

Recommended Posts

In order to have some fun I wanted to write a small script that would help me optimize both the launch vehicule and the gravity turn.
To acheive that I need to have accurate data concerning the atmosphere.

In the wiki we can find the equation describing the change in pressure in function of the altitude. But I was not able to find anything similar for the temperature. It is also mentionned that both variable change with time of day and latitude. But the equation describing those change are nowhere to be found.

Can someone help me?

Link to comment
Share on other sites

I do not have this info, but I have moved your question to the Science sub because even though the scenario is fictional the math involved will be close to the real thing, and this is where the people who know that kind of stuff hang around. Good luck. :)

Link to comment
Share on other sites

Temperature is going to be a piecewise function with different curves as you reach the various layers, like this.

NWS JetStream - Layers of the Atmosphere

There are some general rules of thumb for where these layer boundaries are by latitude you can use, but they change with the weather and the seasons. Typically when writing functions like this, you can input things like current density, latitude, and temperature as parameters, so that you get a more accurate fit to the current situation. The atmosphere is always changing, and we can't fully predict it. That's just how we can make models that give us a good approximation. If you really want to, you can even just import a temperature table for your function to reference.

Edited by cubinator
Link to comment
Share on other sites

This is THE reference for atmosphere modeling in KSP:

These are the curve values for the stock planets:

https://github.com/Kopernicus/kittopia-dumps/tree/master/Configs

You will also want to looks at the Trajectories mod for modeling the interaction between craft and the atmosphere:

Source code here:

https://github.com/neuoy/KSPTrajectories

Edited by FleshJeb
Link to comment
Share on other sites

@Thomot512, Kerbin's atmospheric model is based on the U.S. Standard Atmosphere.  The only adjustments the KSP developers made were to convert geopotential height to geometric height, and then multiply all the heights by 0.8 to lower the top of the atmosphere.  Here you can find the atmosphere curves used by Kerbin:

kittopia-dumps/Kerbin.cfg at master · Kopernicus/kittopia-dumps (github.com)

And here you can find an explanation of what all the curves do:

For an alternative model, you can use this mod:

Realistic Atmospheres bases Kerbin's atmosphere on this model of Earth's atmosphere developed by the U.S. Air Force:

Standard & Reference Atmospheres.pdf (braeunig.us)

It is very similar to the U.S. Standard Atmosphere (as you would expect since they both model Earth) but is more complete in that it has multiple models for different latitudes (the U.S. Standard Atmosphere is centered on 45o N as I recall).  The atmosphere curves used by Realistic Atmospheres can all be found within the mod's config files.  Realistic Atmospheres also remodels all other atmospheres in KSP to be more lifelike.
 

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...