https://wiki.kerbalspaceprogram.com/api.php?action=feedcontributions&user=Iluvalar&feedformat=atomKerbal Space Program Wiki - User contributions [en]2024-03-28T19:52:25ZUser contributionsMediaWiki 1.29.0https://wiki.kerbalspaceprogram.com/index.php?title=Atmosphere&diff=22810Atmosphere2013-07-27T18:08:20Z<p>Iluvalar: /* Drag */ 2 contradictory statements. Just a huge simplification. Explain why the real life formula don't contain the same units.</p>
<hr />
<div>{| class="wikitable" style="float:right;margin:0.5em;"<br />
! colspan="2" | Planets<br />
|-<br />
| style="border-right:0px;" | [[File:TinyEve.png|16px]]<br />
| style="border-left:0px;" | [[Eve]]<br />
|-<br />
| style="border-right:0px;" | [[File:TinyKerbin.png|16px]]<br />
| style="border-left:0px;" | [[Kerbin]]<br />
|-<br />
| style="border-right:0px;" | [[File:TinyDuna.png|16px]]<br />
| style="border-left:0px;" | [[Duna]]<br />
|-<br />
| style="border-right:0px;" | [[File:TinyJool.png|16px]]<br />
| style="border-left:0px;" | [[Jool]]<br />
|-<br />
! colspan="2" | Moons<br />
|-<br />
| style="border-right:0px;" | [[File:TinyLaythe.png|16px]]<br />
| style="border-left:0px;" | [[Laythe]]<br />
|}<br />
<br />
The '''atmosphere''' of a celestial body slows the movement of any object passing through it, a force known as atmospheric drag (or simply '''drag'''). An atmosphere also allows for aerodynamic lift. The celestial bodies with atmospheres are the planets [[Eve]], [[Kerbin]], [[Duna]] and [[Jool]], as well as [[Laythe]], a moon of Jool. Only [[Kerbin]] and [[Laythe]] have atmospheres that contain oxygen.<br />
<br />
Atmospheric pressure diminishes exponentially with increasing altitude. An atmosphere's ''scale height'' is the distance over which atmospheric pressure changes as a factor of ''e'', or 2.718. For example, Kerbin's atmosphere has a scale height of 5000 m, meaning the atmospheric pressure at altitude ''n'' is 2.718 times <br />
greater than the pressure at altitude ''n'' + 5000.<br />
<br />
Atmospheres vary in temperature, though this has no bearing on gameplay.<br />
<br />
Atmosphere allows [[aerobraking]] and easier landing. When atmosphere contains oxygen, it allows jet engines to work. However, atmosphere makes taking off from a planet more difficult and increases a stable orbit altitude.<br />
<br />
== Drag ==<br />
[[File:Ml16-XL_parachute.JPG|thumb|right|A Mk1-2 pod with a Mk16-XL parachute being slowed by drag in Kerbin's atmosphere.]]<br />
<br />
In the game, the force of atmospheric drag (''F<sub>D</sub>'') is modeled as follows:<ref>http://forum.kerbalspaceprogram.com/showthread.php/5235-Atmospheric-drag?p=88804&viewfull=1#post88804</ref><br />
<br />
: <math>F_D = 0.5\, \rho\, v^2\, d\, A</math><br />
<br />
where ''&rho;'' is the atmospheric density (kg/m<sup>3</sup>), ''v'' is the ship's velocity (m/s), ''m'' is the ship's mass (kg), ''d'' is the coefficient of drag (dimensionless), and ''A'' is the [[w:cross section (geometry)|cross-sectional area]] (m<sup>2</sup>).<br />
<br />
Note that the cross-sectional area is not actually calculated in the game. It is instead assumed that it is directly proportional to the mass (1m³/kg). Use the ship's mass (kg) in the formula.<br />
<br />
''&rho;'' can be derived from atmospheric pressure (''p'' of unit ''atm''), which is a function of the atmosphere's pressure at altitude 0 (''p<sub>0</sub>'') and scale height (''H''):<br />
<br />
: <math>p = p_0 \cdot e^{-altitude / H}</math><br />
<br />
: <math>\rho = p \cdot 1.2002 \cdot 0.008</math><br />
<!-- rho = p * FlightGlobals.getAtmDensity(1.0) * FlightGlobals.DragMultiplier --><br />
<br />
The 1.2002 value can be derived from the [[w:Air_density|ideal gas law]] (assuming that T is always 293.15K as it is inconclusive if Temperature is important) and the factor of 0.008 is just the way the Kerbal universe works. This yields<br />
<br />
: <math>\rho ~= p \cdot \frac{101 \text{kPa}}{1 \text{atm} \cdot 287.058 \text{J/(kg·K)} \cdot 293.15 \text{K}} \cdot 0.008</math><br />
<br />
<br />
where p here is in units atm. The coefficient of drag (''d'') is calculated as the mass-weighted average of the max_drag values of all [[parts]] on the ship. For most ships without deployed parachutes, ''d'' will be very near 0.2, since this is the max_drag value of the vast majority of parts.<br />
<br />
As an example, the coefficient of drag for a craft consisting simply of a [[Mk1-2 Command Pod]] (mass 4, drag 0.2) and a deployed [[Mk16-XL Parachute]] (mass 0.3, drag 500) is:<br />
<br />
: <math>\frac{4 \cdot 0.2 + 0.3 \cdot 500}{4 + 0.3} = 35.07</math><br />
<br />
== Terminal velocity ==<br />
The [[w:terminal velocity|terminal velocity]] of an object falling through an atmosphere is the velocity at which the force of gravity is equal to the force of drag. Terminal velocity changes as a function of altitude. Given enough time, an object falling into the atmosphere will slow to terminal velocity and then remain at terminal velocity for the rest of its fall.<br />
<br />
Terminal velocity is important because:<br />
# It describes the amount of velocity which a spacecraft must burn away when it is close to the ground.<br />
# It represents the speed at which a ship should be traveling upward during a fuel-optimal ascent.<br />
<br />
The force of gravity (''F<sub>G</sub>'') is:<br />
<br />
: <math>F_G = m\, a = m\, \frac{GM}{r^2}</math><br />
<br />
where ''m'' is still the ship's mass, ''G'' is the [[Template:G|gravitational constant]], ''M'' is the mass of the planet, and ''r'' is the distance from the ''center'' of the planet to the falling object.<br />
<br />
To find terminal velocity, we set ''F<sub>G</sub>'' equal to ''F<sub>D</sub>'':<br />
<br />
: <math>m\, \frac{GM}{r^2} = 0.5\, \rho\, v^2\, m\, d\, A</math><br />
<br />
: <math>\frac{GM}{r^2} = 0.5\, \rho\, v^2\, d\, A</math><br />
<br />
: <math>v = v_T = \sqrt{\frac{2\, GM}{r^2\, \rho\, d\, A}}</math><br />
<br />
Assuming ''d'' is 0.2 (which is a good approximation, provided parachutes are not in use) and given that ''A'' is 1, this simplifies to:<br />
<br />
: <math>v_T = \sqrt{\frac{10\, GM}{r^2\, \rho}}</math><br />
<br />
For the Mk16 pod and parachute example pictured above, the drag coefficient is 35.07, so its terminal velocity at sea level on Kerbin (which is 600 km from Kerbin's center) is:<br />
<br />
: <math>v_T = \sqrt{\frac{2\, GM}{r^2\, \rho \cdot 35.07}}</math><br />
<br />
: <math>\rho = 1 \cdot e^{-0/5000} \cdot 1.2002 \cdot 0.008</math><br />
<br />
: <math>v_T = \sqrt{\frac{2 \cdot 6.674 \cdot 10^{-11} \cdot 5.2915793 \cdot 10^{22}}{600000^2 \cdot 1.2002 \cdot 0.008 \cdot 35.07}} = 7.63 \operatorname{m/s}</math><br />
<br />
=== Examples ===<br />
{| class="wikitable"<br />
!rowspan=2 valign=bottom| Altitude (m) ||colspan=6| v<sub>T</sub> (m/s)<br />
|-<br />
! Eve !! Kerbin !! Duna !! Jool !! Laythe<br />
|-<br />
| 0 || {{sigfigs|{{VT | planet=Eve | alt= 0}}|5}} || {{sigfigs|{{VT | planet=Kerbin | alt= 0}}|5}} || {{sigfigs|{{VT | planet=Duna | alt= 0}}|5}} || {{sigfigs|{{VT | planet=Jool | alt= 0}}|5}} || {{sigfigs|{{VT | planet=Laythe | alt= 0}}|5}}<br />
|-<br />
| 100 || {{sigfigs|{{VT | planet=Eve | alt= 100}}|5}} || {{sigfigs|{{VT | planet=Kerbin | alt= 100}}|5}} || {{sigfigs|{{VT | planet=Duna | alt= 100}}|5}} || {{sigfigs|{{VT | planet=Jool | alt= 100}}|5}} || {{sigfigs|{{VT | planet=Laythe | alt= 100}}|5}}<br />
|-<br />
| 1000 || {{sigfigs|{{VT | planet=Eve | alt= 1000}}|5}} || {{sigfigs|{{VT | planet=Kerbin | alt= 1000}}|5}} || {{sigfigs|{{VT | planet=Duna | alt= 1000}}|5}} || {{sigfigs|{{VT | planet=Jool | alt= 1000}}|5}} || {{sigfigs|{{VT | planet=Laythe | alt= 1000}}|5}}<br />
|-<br />
| 10000 || {{sigfigs|{{VT | planet=Eve | alt=10000}}|5}} || {{sigfigs|{{VT | planet=Kerbin | alt=10000}}|5}} || {{sigfigs|{{VT | planet=Duna | alt=10000}}|5}} || {{sigfigs|{{VT | planet=Jool | alt=10000}}|5}} || {{sigfigs|{{VT | planet=Laythe | alt=10000}}|5}}<br />
|}<br />
<br />
== On-rails physics ==<br />
If a ship is "on rails" (meaning it's further than 2.25&nbsp;km from the actively-controlled ship) and its orbit passes through a planet's atmosphere, one of two things will happen based on atmospheric pressure at the ship's altitude:<br />
<br />
* below 0.01&nbsp;atm: no atmospheric drag will occur &mdash; the ship will be completely unaffected<br />
* 0.01&nbsp;atm or above: the ship will disappear<br />
<br />
The following table gives the altitude of this 0.01&nbsp;atm threshold for each celestial body with an atmosphere:<br />
{| class="wikitable"<br />
|-<br />
! Body || Altitude (m)<br />
|-<br />
| [[Eve]] ||align="right"| {{Formatnum|{{PressureAltitude|pressure=0.01|body=Eve}}}}<br />
|-<br />
| [[Kerbin]] ||align="right"| {{Formatnum|{{PressureAltitude|pressure=0.01|body=Kerbin}}}}<br />
|-<br />
| [[Duna]] ||align="right"| {{Formatnum|{{PressureAltitude|pressure=0.01|body=Duna}}}}<br />
|-<br />
| [[Jool]] ||align="right"| {{Formatnum|{{PressureAltitude|pressure=0.01|body=Jool}}}}<br />
|-<br />
| [[Laythe]] ||align="right"| {{Formatnum|{{PressureAltitude|pressure=0.01|body=Laythe}}}}<br />
|}<br />
<br />
== Atmospheric height ==<br />
The atmospheric height depend on the scale height of the celestial body and is where 0.000001<sup>th</sup> (0.0001&nbsp;%) of the surface pressure is remaining so the atmospheric pressure at the border isn't constant. Technically a craft in Jool's orbit can get lower into the atmosphere (or the atmosphere starts from a higher pressure).<br />
:<math>alt_{\text{atmospheric height}} = -ln\left(10^{-6}\right) \cdot \text{scale height}</math><br />
:<math>p_{\text{atmospheric height}} = p_0 \cdot 10^{-6}</math><br />
Kerbin's atmosphere ends at 0.000001&nbsp;atm and to calculate where the other celestial bodies should have the atmospheric height:<br />
:<math>alt_{\text{atmospheric height (real)}} = -ln\left(\frac{10^{-6}}{p_0}\right) \cdot \text{scale height}</math><br />
<br />
== Notes ==<br />
<references /></div>Iluvalar