Orbiter "wind tunnel"

Calsir

New member
Joined
Jan 8, 2009
Messages
71
Reaction score
0
Points
0
Hi, I was looking at the challenge posted by agentgonzo: http://www.orbiter-forum.com/showthread.php?t=10982, so I have been thinking about finding the most efficient angle of attack. Then I got stuck due to the lack of any tabulated aerodynamic coefficient for orbiter spacecraft. I know that AerobrakeMFD calculates the current efficiency, but I wondered if a sort of "wind tunnel" program existed to evaluate the flight characteristics of a vessel. If that is not the case, I would wonder what libraries or functions would be needed to write one, not being a C++ coder (I worked mostly on Matlab). Data about TSFC (or Isp) of engines at a given altitude could also be calculated to compute optimal flight profiles.

Of course, one could just fly a spacecraft through an atmosphere and write down the results, but I think that a systematic approach would be more helpful.
 
Last edited:

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
38
Location
Hampshire, UK
Website
orbiter.quorg.org
There are various parameters that the vessel supplies to Orbiter via variables and callbacks that are used to determine the atmospheric flight characteristics of the vessel in orbiter.

I may be entirely wrong on this, but I believe that AerobrakeMFD takes snapshots of values like drag and lift for various angles of attack, speed and atmospheric densities during flight and saves these to a file at some point. It then uses these for future flights (and probably the current flight) to determine the landing site and reentry profile.

I was contemplating using this method (or extending it if it already is used) for launch MFD to get much more accurate ascent profiles, but never had the time to put in the leg work.

I think your project is a very good idea, and wish that I had the time to contribute towards it.
 

RisingFury

OBSP developer
Addon Developer
Joined
Aug 15, 2008
Messages
6,427
Reaction score
492
Points
173
Location
Among bits and Bytes...
Why not just tap into the API to get the current AOA, current lift and current drag, calculate L/D and assume the pilot will try to hold the current AOA or close to it?
 

Calsir

New member
Joined
Jan 8, 2009
Messages
71
Reaction score
0
Points
0
agentgonzo said:
I may be entirely wrong on this, but I believe that AerobrakeMFD takes snapshots of values like drag and lift for various angles of attack, speed and atmospheric densities during flight and saves these to a file at some point. It then uses these for future flights (and probably the current flight) to determine the landing site and reentry profile

I could not find the resulting file, nor in the aerobrakeMFD code, nor in Orbiter directory tree. Or does it save the data in the scenario file? Also, it is your fault if I even thought about this :lol:.

Why not just tap into the API to get the current AOA, current lift and current drag, calculate L/D and assume the pilot will try to hold the current AOA or close to it?

That may be a workaround, but actually flying the thing is time consuming. Besides, it may well be more difficult to gather the data at the edge of the envelope (very high angle of attack or sideslip). Also, you would need to gather the data at different Mach and Reynolds numbers (which means, wildly different altitudes and speed).

I was thinking about something like this: set the intervals of the parameters (AOA, Mach, Reynolds), then perform the tests at all the different points. It would be much less redundant than actually flying the spacecraft.

The trouble so far is that the flight characteristics of the vessels are buried within the "airfoils" created by CreateAirfoil() and that the sdk does not provide a way to directly set Mach, AOA, Reynolds to objects of Vessel2 class. I may be missing something, as all my knowledge of this topic stems from reading the API reference, its guide and DeltaGlider.cpp.
 

DarkWanderer

Active member
Orbiter Contributor
Donator
Joined
Apr 27, 2008
Messages
213
Reaction score
83
Points
43
Location
Moscow
You may use this as a start. Don't remember if I added L/D ratio plot into it, but you can use polar diagram to determine the "glide point".
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,669
Reaction score
798
Points
128
I know that AerobrakeMFD calculates the current efficiency, but I wondered if a sort of "wind tunnel" program existed to evaluate the flight characteristics of a vessel.
There is some kind of "wind tunnel" (aerodynamic simulation) program for the Orbiter. The project thread existed in the old forum witch, unfortunately, seems to be unaccessible at a moment. The project author is Radu (Creator of Dragonfly)

http://orbiter-forum.com/showthread.php?t=7495
 

Calsir

New member
Joined
Jan 8, 2009
Messages
71
Reaction score
0
Points
0
No, I am not looking for a software to determine the performance of an airfoil, but I am looking to determine the aerodynamic performance of ships in orbiter.

agentgonzo said:
Interesting. I wonder where I got that idea from then.
Actually, there is a file, deltaglider.ld in modules/plugin. The previous lack of results was more due to my carelessness.

DarkWanderer said:
You may use this as a start. Don't remember if I added L/D ratio plot into it, but you can use polar diagram to determine the "glide point".

Interesting MFD, but I am unable to run it: I put it in modules/plugin, load it, but I cannot open the mfd.

jarmonik said:
There is some kind of "wind tunnel" (aerodynamic simulation) program for the Orbiter. The project thread existed in the old forum witch, unfortunately, seems to be unaccessible at a moment. The project author is Radu (Creator of Dragonfly)

Too bad that his work is not accessible...

I tried to use the FlightData module, and I did manage to record some performance, but since there are so many parameters involved (M, Re and AoA), a thorough "real life" test is very difficult.
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
I tried to use the FlightData module, and I did manage to record some performance, but since there are so many parameters involved (M, Re and AoA), a thorough "real life" test is very difficult.
What about writing a plugin to be used with orbiter_ng? By manipulation of the vessel state (position, velocity, attitude) at each time step, you could get a much larger range of vessel aerodynamic parameters in much less time.
 

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,819
Reaction score
641
Points
188
Interesting MFD, but I am unable to run it: I put it in modules/plugin, load it, but I cannot open the mfd.

I un-rar'd it into the \Modules directory, then activated it in the 'Modules' tab as the 'CustomMFD'.
It then appears as 'Ascent Profile' in the MFD.

Assuming this is what we are taling about?

N.
 

Calsir

New member
Joined
Jan 8, 2009
Messages
71
Reaction score
0
Points
0
I un-rar'd it into the \Modules directory, then activated it in the 'Modules' tab as the 'CustomMFD'.
It then appears as 'Ascent Profile' in the MFD.
Thanks, I see it now. Of course, it had been there all the time :\.


tblaxland said:
What about writing a plugin to be used with orbiter_ng? By manipulation of the vessel state (position, velocity, attitude) at each time step, you could get a much larger range of vessel aerodynamic parameters in much less time.

It is an interesting hypothesis. However I see three issues here:
a) how to prevent orbiter from taking over the state vector and let me manipulate the object without killing it due to overpressure or heating.
b) afaik, orbiter_ng is present in the beta only, which would exclude many models from testing.
c) I have no bloody clue on how to write such a plugin, as I can find no relevant API, or rather, I cannot see which functions I should call to perform what I need.

Thank you for all your replies :).
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
It is an interesting hypothesis. However I see three issues here:
a) how to prevent orbiter from taking over the state vector and let me manipulate the object without killing it due to overpressure or heating.
i) You can set the vessel state at each time step (use opcPreStep). That way, Orbiter can apply only one time step worth of integration to the vessel's state which would be a very small difference. And the difference would be detectable in opcPostStep anyway.

ii) Most addon vessels for Orbiter are "indestructable" anyway. Those that do have damage models normally have a way to turn such features off.

b) afaik, orbiter_ng is present in the beta only, which would exclude many models from testing.
orbiter_ng uses the same vessel interfaces as Orbiter.exe, it just has no graphics engine. I can't see any reason why most vessels would not work with it.

c) I have no bloody clue on how to write such a plugin, as I can find no relevant API, or rather, I cannot see which functions I should call to perform what I need.
Set its state using the VESSELSTATUSx structure (it is in the API docs).
 

Calsir

New member
Joined
Jan 8, 2009
Messages
71
Reaction score
0
Points
0
i) You can set the vessel state at each time step (use opcPreStep). That way, Orbiter can apply only one time step worth of integration to the vessel's state which would be a very small difference. And the difference would be detectable in opcPostStep anyway.

I see, I should build a plugin that uses the callback opcPreStep to set the aircraft attitude and speed. Then I use the callback after the integration to gauge the lift and drag magnitudes.

ii) Most addon vessels for Orbiter are "indestructable" anyway. Those that do have damage models normally have a way to turn such features off.

I forgot that part :).


orbiter_ng uses the same vessel interfaces as Orbiter.exe, it just has no graphics engine. I can't see any reason why most vessels would not work with it.

I have just seen that the vessel API has not changed since 2006. I read somewhere that the xr2 had issues with orbiter2009rc1, but I have just flown it correctly as long as it stayed below 80km altitude.

Set its state using the VESSELSTATUSx structure (it is in the API docs).

I do not see how to directly access a field of type VESSELSTATUS or VESSELSTATUS2 in a vessel, but am I correct if I suppose that I can directly use
Code:
VESSELSTATUS2 *status;
vesselHandle->GetStatusEx(status);
vesselHandle->DefSetStateEx(&status);
to properly get and set the status of a vessel? I am sorry about pestering with these issues, but my C skills need some refreshing, and C++ is somewhat different.
 

garyw

O-F Administrator
Administrator
Moderator
Addon Developer
Tutorial Publisher
Joined
May 14, 2008
Messages
10,485
Reaction score
209
Points
138
Location
Kent
Website
blog.gdwnet.com
Interesting. I wonder where I got that idea from then.

You are right. Aerobrake MFD does record L/D values if you are below 200km and if you tell it to. I think the key combination is SHFT-S but I'm not sure. It is in the documentation.
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
I have just seen that the vessel API has not changed since 2006. I read somewhere that the xr2 had issues with orbiter2009rc1, but I have just flown it correctly as long as it stayed below 80km altitude.
IIRC, that is actually an issue with the XR2's heating code. I don't use the XR2 but I think it has an option to be indestructible. If so, it should report correct aerodynamics regardless of the temperature.

I do not see how to directly access a field of type VESSELSTATUS or VESSELSTATUS2 in a vessel, but am I correct if I suppose that I can directly use
Code:
VESSELSTATUS2 *status;
vesselHandle->GetStatusEx(status);
vesselHandle->DefSetStateEx(&status);
to properly get and set the status of a vessel? I am sorry about pestering with these issues, but my C skills need some refreshing, and C++ is somewhat different.
Mostly. You don't need to call DefSetStateEx. Manipulating the members of "status" will directly change the vessel's state. DefSetStateEx is used when creating a new vessel or when a vessel is being loaded at sim start, to fill the VESSELSTATUS2 structure will default values.
 

Calsir

New member
Joined
Jan 8, 2009
Messages
71
Reaction score
0
Points
0
IIRC, that is actually an issue with the XR2's heating code. I don't use the XR2 but I think it has an option to be indestructible. If so, it should report correct aerodynamics regardless of the temperature.

Yes, it is possible to configure it so as to disable damage.

Mostly. You don't need to call DefSetStateEx. Manipulating the members of "status" will directly change the vessel's state. DefSetStateEx is used when creating a new vessel or when a vessel is being loaded at sim start, to fill the VESSELSTATUS2 structure will default values.

I guess that it really shows the time since I last coded anything in C... Well, now the hard part comes in: actually try to code it...
 

Calsir

New member
Joined
Jan 8, 2009
Messages
71
Reaction score
0
Points
0
It works! If I use the graphical client I can even see the velocity vector sweep the vertical plane as the aoa changes!

some early results:

Code:
Input Mach; Actual Mach; Input AOA; Actual AOA; Dynamic Pressure; Actual Airspeed; CL*S; CD*S; L/D
0.100000; 0.099936; -10.000000; -9.814929; 185.127859; 29.926443; -10.299028; 3.020797; -3.409375
0.100000; 0.099938; -9.545455; -9.360203; 185.137475; 29.927216; -9.713352; 2.885580; -3.366170
0.100000; 0.099941; -9.090909; -8.905501; 185.147100; 29.927989; -9.127736; 2.756968; -3.310788
0.100000; 0.099999; -8.636364; -8.633286; 185.363965; 29.945414; -8.532630; 2.632036; -3.241836
0.100000; 0.099999; -8.181818; -8.178770; 185.364158; 29.945430; -7.948195; 2.516956; -3.157860
0.100000; 0.099999; -7.727273; -7.724238; 185.364333; 29.945444; -7.363762; 2.408525; -3.057374
0.100000; 0.099999; -7.272727; -7.269711; 185.364511; 29.945458; -6.779330; 2.306763; -2.938893
0.100000; 0.099999; -6.818182; -6.814567; 185.364110; 29.945426; -6.194918; 2.211695; -2.800982
0.100000; 0.099999; -6.363636; -6.360576; 185.364788; 29.945480; -5.610472; 2.123319; -2.642312
0.100000; 0.099999; -5.909091; -5.906060; 185.364973; 29.945495; -5.026042; 2.041670; -2.461731
0.100000; 0.099999; -5.454545; -5.451513; 185.365130; 29.945508; -4.441615; 1.966758; -2.258344

Now I have to externalize the configuration.
 
Top