SDK Question Atmosphere that Changes over Time

Interstellar Planet

Cosmic Voyager
Joined
Jul 6, 2013
Messages
74
Reaction score
0
Points
6
Location
0,0,0,0 in my reference frame
Is it possible to write an atmosphere module in which the parameters vary over time? I'm trying to create one for Pluto so that the surface pressure changes with its seasons. The module loads correctly, but there is still a problem. When I run a scenario, the atmosphere originally has the correct pressure for that date. However, the surface pressure never updates over the course of the scenario.

Here's a basic outline of the code:

Code:
bool MyPlanet::clbkAtmParam(double alt, ATMPARAM *prm)
{
	if (alt < 1000000)
	{
		double mjd = oapiGetSimMJD();
		
		//...calculate surface pressure from date

		//...calculate pressure from altitude and surface pressure

		//...calculate temperature and density from altitude

		return true;
	}
	else return false;
}

Is there any way to get the date to constantly update while running a scenario?
 
I'm not 100% sure, but I think that clbkAtmParam is only ran once at scenario startup. Which makes it unusable for varying the parameters.
 
Is it possible to write an atmosphere module in which the parameters vary over time?

If you call your function MyPlanet::clbkAtmParam() from ATMOSPHERE::clbkParams(), it seems possible to do what you need, because I read in "Orbiter API Reference Manual" section 8.4.4.3 that the function ATMOSPHERE::clbkParams() is "Called by Orbiter to obtain atmospheric parameters for a given set of input parameters at the current simulation time.".

I'm trying to create one for Pluto so that the surface pressure changes with its seasons.

Do you have a reliable model for the Pluto atmosphere?
 
If you call your function MyPlanet::clbkAtmParam() from ATMOSPHERE::clbkParams(), it seems possible to do what you need, because I read in "Orbiter API Reference Manual" section 8.4.4.3 that the function ATMOSPHERE::clbkParams() is "Called by Orbiter to obtain atmospheric parameters for a given set of input parameters at the current simulation time.".

I tried using ATMOSPHERE::clbkParams() like you said, but the problem is still there. However, the API guide does specifically say "more sophisticated models can make use of the additional parameters such as position (longitude and latitude), solar flux, geomagnetic index, and date."

Interestingly, there doesn't appear to be any parameter flag for the date.:shrug:

In the API guide:

enum ATMOSPHERE::PRM_IN_FLAG

Parameter flags for atmospheric data input.


See also:
ATMPRM_IN

Enumerator:
PRM_ALT altitude valid (otherwise use alt=0)
PRM_LNG longitude valid (otherwise use lng=0)
PRM_LAT latitude valid (otherwise use lat=0)
PRM_FBR average flux valid (otherwise use f107avg=140)
PRM_F current flux valid (otherwise use f107=f107avg)
PRM_AP geomagnetic index valid (otherwise use ap=3)


---------- Post added at 07:24 PM ---------- Previous post was at 07:18 PM ----------

Do you have a reliable model for the Pluto atmosphere?

I created some piece-wise functions to model the data in this paper and this paper.

---------- Post added at 08:25 PM ---------- Previous post was at 07:24 PM ----------

Actually it does work!!:)

I've been using the Object info box to check the surface pressure. It's just that the atmospheric pressure doesn't change while the spacecraft is sitting on the ground... If I change the date, I have to give the spacecraft a nudge to cause the surface pressure to "snap" to the correct value.

I guess orbiter just doesn't update parameters for stationary spacecraft. Oops. :shifty:

Thanks for the suggestions. I want to upload the module to the hangar after I tweak a few things. However, there is still the problem that it will overwrite any other pluto modules that may exist.
 
I created some piece-wise functions to model the data in this paper and this paper.

Thank you, very interesting.
I'm trying to collect data for the atmospheric model of Pluto, Titan, Io, Triton, Mars and Venus (and, almost impossible, Eris).

Thanks for the suggestions. I want to upload the module to the hangar after I tweak a few things.

I'll be happy to use your dll. :)

However, there is still the problem that it will overwrite any other pluto modules that may exist.

Why? Just write the dll for the atmospheric model, then it'll be loaded by the planet dll which should read the line "Module_Atm = ..." in Pluto.cfg.

---------- Post added at 13:02 ---------- Previous post was at 02:11 ----------

I guess orbiter just doesn't update parameters for stationary spacecraft. Oops. :shifty:

You're right!
I wrote a dll that changes the temperature with the time, but to update the atmosphere the ship needs a nudge, as you said. :(
I think that the bug should be reported in the "ORBITER: 2010-P1" section.
 
Last edited:
It's true, atmospheric parameters (amongst other things) are currently not updated for vessels with "idle" status. This was done on purpose in the interest of scalability, i.e. avoid inactive vessels take up CPU cycles in a densely populated scenario. So far this wasn't a problem since atmospheres were mostly static on the ground.

As a compromise, would it be sufficient to update the amosphere data for an idle focus object only, or can you see a situation where atmosphere parameters need to be updated even for idle vessels that don't have camera focus?
 
I can imagine a simulation of thermal systems, taking into account the external temperature.
Let's say a greenhouse on Mars implemented as a landed vessel.
You might want to simulate the necessary (electrical) heating and fuel consumption (to generate electricity) over time, while you are traveling there on another vessel.
 
As a compromise, would it be sufficient to update the amosphere data for an idle focus object only, or can you see a situation where atmosphere parameters need to be updated even for idle vessels that don't have camera focus?

Probably for ships in the Solar System what you say is a good solution, but imagine ships on a fictional planet with a "challenging" atmosphere (the ship could be damaged by the high temperature while in idle and not focused).

Even if I don't think that the atmospheric parameters calculation takes a significant amount of time, probably the best solution would be to add a check box, if possible, in the launchpad to enable/disable the atmospheric parameters calculation for not focused landed ships.

Thank you for your reply.
 
Back
Top