Page 1 of 1

Atmosphere Scripting

Posted: 05 Dec 2019 14:31
by senuaafo
So how exactly does atmosphere work in SE?

I wanted to see what effect CO2 levels in atmosphere would have, to I tried an experiment.

I made 2 copies of Earth and placed them out at the orbit of Mars. I then fiddled with the atm of
one of them, boosting up the CO2 content at the expense of the N2 levels.

1st time I raised the CO2 level, temps stayed exactly the same, so I deleted the greenhouse line.
 I then saw as I raised the CO2 level, the planet got markedly COLDER every time I did so, all
 other levels except N2 being the same. The more I spike the CO2 levels, the colder the planet gets.

I thought CO2 was supposed to warm things up, or does SE not predict that sort of stuff?

....Or does that mean that N2 is a much stronger greenhouse gas than CO2?

thx,

Atmosphere Scripting

Posted: 06 Dec 2019 05:26
by A-L-E-X
senuaafo wrote:
So how exactly does atmosphere work in SE?

I wanted to see what effect CO2 levels in atmosphere would have, to I tried an experiment.

I made 2 copies of Earth and placed them out at the orbit of Mars. I then fiddled with the atm of
one of them, boosting up the CO2 content at the expense of the N2 levels.

1st time I raised the CO2 level, temps stayed exactly the same, so I deleted the greenhouse line.
 I then saw as I raised the CO2 level, the planet got markedly COLDER every time I did so, all
 other levels except N2 being the same. The more I spike the CO2 levels, the colder the planet gets.

I thought CO2 was supposed to warm things up, or does SE not predict that sort of stuff?

....Or does that mean that N2 is a much stronger greenhouse gas than CO2?

thx,

Did the color of the atmosphere change when you did this?
N2 isn't a greenhouse gas, but H2O is.  Check on your water vapor levels.

Atmosphere Scripting

Posted: 06 Dec 2019 12:44
by senuaafo
Water vapour stays the same, as I said, all other levels stay the same. I withdrew percentage from N2 only to raise the CO2 level.
Couldn't really see any visible difference.

Atmosphere Scripting

Posted: 07 Dec 2019 12:00
by SpaceEngineer
Don't confuse SpaceEngine with Universe Sandbox. SE in not a physics simulator.

Atmosphere Scripting

Posted: 08 Dec 2019 10:14
by donatelo200
It does seem that N2 is acting as a stronger greenhouse gas in SE than CO2 is.  I have also attached my test planet in which I simply isolated the gases and then checked the greenhouse effect.
scr00055.jpg

scr00056.jpg

Atmosphere Scripting

Posted: 08 Dec 2019 10:33
by SpaceEngineer
SE does not take into account chemical composition of atmosphere while calculating greenhouse effect. It uses simple empirical formula which takes only pressure, temperature and average molar mass of atmospheric gases. Precise greenhouse calculation is far more complex problem of a radiative energy transfer in a non-uniform media, which must take into account absorption and emission spectrum of each gas, spectrum of stellar radiation, global energy balance of the planet, and thousands other things (and requires a supercomputer actually).

Atmosphere Scripting

Posted: 09 Dec 2019 08:48
by A-L-E-X
SpaceEngineer wrote:
SE does not take into account chemical composition of atmosphere while calculating greenhouse effect. It uses simple empirical formula which takes only pressure, temperature and average molar mass of atmospheric gases. Precise greenhouse calculation is far more complex problem of a radiative energy transfer in a non-uniform media, which must take into account absorption and emission spectrum of each gas, spectrum of stellar radiation, global energy balance of the planet, and thousands other things (and requires a supercomputer actually).

But as far as atmospheric colors those are accurate, I think? Or as close to accurate as we can expect.

Atmosphere Scripting

Posted: 10 Dec 2019 13:48
by Watsisname
senuaafo wrote:
Source of the post I wanted to see what effect CO2 levels in atmosphere would have, to I tried an experiment.

As SpaceEngineer says, calculating the greenhouse effect is very complex and not something that SE does.  But if you want some intuition for how it works with varying CO2 or other greenhouse gases, then we can use a simple model.  

Imagine the atmosphere as being made up of some number of layers of greenhouse gas, where each layer absorbs all of the infrared radiation that passes into it (each layer is one "extinction thickness"), while the atmosphere as a whole is transparent to the star's visible light.  

What will the surface temperature of the planet be, if the atmosphere has 1 layer?  The energy in sunlight coming in must balance the energy in infrared radiation given back out.  The power per square meter in sunlight is called the "solar constant".  At Earth, this is about 1370 Watts per square meter.   If 1370 Watts per square meter of visible sunlight strikes the planet, then to be in equilibrium, the top of the atmosphere must emit 1370 W/m2 of infrared radiation to space.  But the atmosphere emits both upward and downward, so 1370W/m2 of infrared is emitted down to the planet surface as well.  So the surface absorbs twice the solar constant worth of energy, which means it must be emitting 2740W/m2 in infrared (then the atmosphere absorbs all of that, which then balances the energy we just said it must be emitting up and down.) 
 
Schematically we can visualize these energy flows with some arrows, with each arrow representing one solar constant worth of power per unit area.  The rule here is that for every arrow absorbed by something, an arrow must also be emitted.  (Otherwise they will not be in thermal equilibrium and the temperature somewhere would change very quickly.)

Image


Now we use the Stefan Boltzmann Law.  The power per unit area emitted by a material is proportional to its temperature to the fourth power.  (P/A = σT4 where σ is the Stefan Boltzmann constant, 5.67x10-8 W/m2/K4).  According to our sketch above, adding 1 layer of greenhouse gas to the atmosphere doubles the amount of infrared energy the surface must be emitting, which means the surface temperature must be increased by a factor of 21/4 = 1.189 from what it would be without an atmosphere.  

Without an atmosphere, Earth's equilibrium temperature would be 255K or -18C.  One extinction thickness of greenhouse gas raises it to 303K or almost 30C!  In fact Earth's surface temperature averages 288K, indicating a greenhouse effect of about 60% of one extinction thickness.  Most of that is due to water vapor, while our burning of fossil fuels is increasing the CO2 concentration and increasing the surface temperature further.

What if we add another entire layer of greenhouse gas to the atmosphere?  Then the diagram looks like this (remember the rule is for every arrow in there must be an arrow out).
Image

With 2 layers, the top of the atmosphere radiates in equilibrium with the solar constant, while the surface radiates 3 times that amount, raising the surface temperature by a factor of 31/4 = 1.316.  3 layers makes it 41/4 = 1.414.  Now you might be able to see the trend.  In general for an atmosphere with N extinction thicknesses of greenhouse gas, the surface temperature is multiplied by a factor of (N+1)1/4 from what it would be with no atmosphere.

Venus' atmosphere is well approximated as having about 70 extinction thicknesses of CO2, raising its surface temperature from -20C to 460C. 

Atmosphere Scripting

Posted: 22 Feb 2020 08:59
by thenginer
great question