SDK Question Questions about the functionality of airfoils

DerNerf

New member
Joined
Mar 21, 2019
Messages
14
Reaction score
0
Points
0
Hello Everyone,

I'm currently working on the soyuz spacecraft for a reentry simulation and have a few questions about the way airfoils work. I've already read this Forum Post: https://www.orbiter-forum.com/showthread.php?t=38047 about how to programm lift generating capsule and the use of airfoils.

I still have a few questions about the basic functionality of airfoils though.
I use the CreatAirfoil2 function to create the needed airfoils when the Soyuz is created (in the clbkSetClassCaps function). There I use a callback function which gives me the airodynamic coefficients.
These are obviously dependant on the flight parameters, such as Angle of Attack and Mach number. However, as far as I understand, the airfoils are not part of the Orbiter update loop. Thus the question: Do the airfoils update themselfes and their Airodynamic properties? From my understanding they have to, to calculate changes of Lift/Drag due to changing Aerodynamic Coefficients.

Furthermore I wanted to ask, if it is possible to change/update the Center of Pressure as the simulation goes as it is part of the creation of the airfoils. For the Soyuz the Trim angle of attack changes over the course of the reentry and as far as I understand, I would have to model that by moving the Center of Pressure along the axis of symmtery during simulation.

If that is possible, then I'd like to know, if it is also possible to update the orientation of the airfoils mid flight. This way, I could use only one airfoil that turns with capsules bank angle and wouldn't need separated horizontal and vertical airfoils.

Thanks in advance for your time and effort.
DerNerf
 

BrianJ

Addon Developer
Addon Developer
Joined
Apr 19, 2008
Messages
1,679
Reaction score
902
Points
128
Location
Code 347
Do the airfoils update themselfes and their Airodynamic properties?
Hi,
as far as my understanding goes, the airfoils will apply the lift/drag/torque that you have specified in the coefficient callback function, at each simulation step.



Furthermore I wanted to ask, if it is possible to change/update the Center of Pressure as the simulation goes as it is part of the creation of the airfoils.
Yes, you can change the CoP and other airfoil parameters by using the EditAirfoil(...) function.



If that is possible, then I'd like to know, if it is also possible to update the orientation of the airfoils mid flight.
No, the orientation is fixed as either VERTICAL or HORIZONTAL.


That's my understanding, but MartinS could tell you for sure.


Cheers,
Brian
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,635
Reaction score
2,352
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Yes, you can change the CoP and other airfoil parameters by using the EditAirfoil(...) function.

Or by using the cm parameter in case of the CoP.
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
I still have a few questions about the basic functionality of airfoils though.
I use the CreatAirfoil2 function to create the needed airfoils when the Soyuz is created (in the clbkSetClassCaps function). There I use a callback function which gives me the airodynamic coefficients.
These are obviously dependant on the flight parameters, such as Angle of Attack and Mach number. However, as far as I understand, the airfoils are not part of the Orbiter update loop. Thus the question: Do the airfoils update themselfes and their Airodynamic properties? From my understanding they have to, to calculate changes of Lift/Drag due to changing Aerodynamic Coefficients.
I think this may be a misunderstanding of how the lift/drag callback functions work. The airfoils are part of the update loop, but the parameters are not updated by orbiter, but by your code. This is the purpose of the callback functions: Orbiter calls them at each frame to query the current lift and drag coefficients. Orbiter then applies them to update the aerodynamic vessel forces.

Orbiter provides a few relevant parameters for the calculation (AOA, Mach number, Reynolds number) as input to the callback function, but you can retrieve any other required values via the vessel API or directly from your module.

BrianJ said:
That's my understanding, but MartinS could tell you for sure.
Couldn't have put it better myself :thumbup:
 

DerNerf

New member
Joined
Mar 21, 2019
Messages
14
Reaction score
0
Points
0
First of all thanks for all the reply's

I think this may be a misunderstanding of how the lift/drag callback functions work. The airfoils are part of the update loop, but the parameters are not updated by orbiter, but by your code. This is the purpose of the callback functions: Orbiter calls them at each frame to query the current lift and drag coefficients. Orbiter then applies them to update the aerodynamic vessel forces.

Orbiter provides a few relevant parameters for the calculation (AOA, Mach number, Reynolds number) as input to the callback function, but you can retrieve any other required values via the vessel API or directly from your module

Thanks for the clarification. I suspected it to work that way but couldn't find it in the API_Reference file. I'm still kinda new to the whole C++ thing.
One more thing: In the API Guide the Lift and Drag Coefficients are defined as:

cl = L/q*S and cd = D/q*S

with q being the dynamic pressure and S the wing area. Do the airfoils also work with this formula to calculate the Lift and Drag they produce? And do I get it right, that everything else (like the projected area perpendicular to the inflow velocity which would be needed for the Drag calculation) is part of the coefficients.
I'm sorry if this is a stupid question but I seem to find different Equations for Lift and Drag calculations wherever I look.

Concerning the CoP: If I want to update it with every Simulation step, would I have to put the EditAirfoil(...) function inside the clbkPre/PostStep function? And can I give EditAirfoil(...) a callback function for the CoP or would I have to simply put a CoP calculating function in front of the EditAirfoil(...) inside the clbkPre/PostStep function?

Once again thanks in advance for all your time and effort, it helps me very much.

Kind regards,
DerNerf
 
Top