- Joined
- Jun 6, 2012
- Messages
- 283
- Reaction score
- 65
- Points
- 28
- Location
- Sydney, Australia, Earth, Sol
- Website
- www.orbithangar.com
Hi All,
I have been stuck on something for a few weeks now, and I am just going round in circles. My goal is to calculate a temperature reading based on some defined parameters (like surface area, emmisivity, etc.) Right now I am not getting into any aerodynamics or atmospheric thermodynamics, I firstly need to be able to calculate temperature in vaccuum conditions from sunlight alone.
This is what I have (runs every timestep):
The parameter "sun" is energy from the sun in W/m^2 (about 1300 at Earth's distance).
The parameter "T" is a header-defined value for temperature in degrees Kelvin.
My issues are, the temperature almost instantly climbs to around 460K when in sunlight (this is when orbiting Earth, so the value seems right-ish, based on my parameters) but I do not understand why this temperature increase is so rapid. When out of sunlight, the temperature will again radiply drop to below 100K in under a second. I would have imagined a realistic climb and drop in temperature respectively.
Additionally, when in sunlight, the output is extremely unstable and will wildly fluctuate and return -1.#INF if any time acceleration is applied at all.
I know I am probably just missing something obvious, or made some simple formula errors, but I could really use a fresh perspective on this, I'm starting to tear my hair out!
Thank you all!
MrMartian
I have been stuck on something for a few weeks now, and I am just going round in circles. My goal is to calculate a temperature reading based on some defined parameters (like surface area, emmisivity, etc.) Right now I am not getting into any aerodynamics or atmospheric thermodynamics, I firstly need to be able to calculate temperature in vaccuum conditions from sunlight alone.
This is what I have (runs every timestep):
C++:
double sA = 12.0; // surface area
double E = 0.5; // emmisivity
double sigma = 5.670373e-8; //Stefan Boltzmann constant
double radiation = E * sigma * pow(T, 4) * sA;
T += ((sun * sA) - radiation) * simdt;
The parameter "sun" is energy from the sun in W/m^2 (about 1300 at Earth's distance).
The parameter "T" is a header-defined value for temperature in degrees Kelvin.
My issues are, the temperature almost instantly climbs to around 460K when in sunlight (this is when orbiting Earth, so the value seems right-ish, based on my parameters) but I do not understand why this temperature increase is so rapid. When out of sunlight, the temperature will again radiply drop to below 100K in under a second. I would have imagined a realistic climb and drop in temperature respectively.
Additionally, when in sunlight, the output is extremely unstable and will wildly fluctuate and return -1.#INF if any time acceleration is applied at all.
I know I am probably just missing something obvious, or made some simple formula errors, but I could really use a fresh perspective on this, I'm starting to tear my hair out!
Thank you all!
MrMartian