# ProjectAir Breathing Turbojet Engine Model for Orbiter

#### Thunder Chicken

Donator
What do we do about variable geometry inlets, like on the XB-70 or SR-71?
XB-70 has movable ramps to change the inlet area, SR-71 does the same thing with a movable inlet spike.
Right now the model assumes an isentropic acceleration/deceleration of the flow in the inlet, which is fine for subsonic and near sonic flight, but not at all correct for supersonic flight. A normal shock relation (not isentropic) could probably be implemented to do a better job with this. I'll put it on my to-do list. Oblique shocks are a whole other thing and that's heavily geometry dependent, and that simply isn't going to be done in this model. This model, as advertised, should generally act like a jet engine, and in many instances may yield very good agreement with most jet engines, but it simply cannot cover all the details.

If you can find me some flight performance data for these engines that would be helpful in validating whatever I can piece together. Right now the best validation of the models I can do is compare sea level stationary thrust values (which I did) and simply note that the engine model trends as expected for real engines at different flight conditions. If you can find me some usable data from supersonic flight conditions for any real jet engine that would be a help.

#### Thunder Chicken

Donator
OK, so I am doing some troubleshooting trying to isolate the mystery drag problem. Here's what I have done so far
1. Removed CreateAirfoil3 definitions, set SetCW to all zeroes. Result - no drag at all, aircraft accelerates correctly based on thrust and mass. No aerodynamic flight controls work. Tops out at over Mach 4.
2. Restored LIFT_HORIZONTAL airfoil definition, but set cd = 0. Result - no drag at all, aircraft accelerates correctly based on thrust and mass. All aerodynamic flight controls seem to work now. Tops out at over Mach 4.
3. Removed LIFT_HORIZONTAL airfoil, restored LIFT_VERTICAL airfoil, but set cd = 0. Result - now experiencing mystery drag force, but it does not show in visual helpers. Get a correct lift force with correct display of visual helper. Apparent drag does not seem to be affected by angle of attack. With cd = 0 induced drag should not occur. Top out at about Mach 1.55 maximum velocity.
4. Same as 3, but set the wing area to 0 in the CreateAirfoil3 for LIFT_VERTICAL, cd = 0. Result - no drag at all, aircraft accelerates correctly based on thrust and mass. Tops out at over Mach 4.
5. Same as 3 and 4, but set wing area to 0.5 normal wing area, cd = 0. Result - mystery drag force is there, but is decreased. Now top speed about Mach 1.7.
So the problem seems to be with some hidden drag on my wing surface. But here is the code implementing my wing airfoil. Find the mystery drag!

C++:
void VLiftCoeff(VESSEL *v, double aoa, double M, double Re, void *context, double *cl, double *cm, double *cd)
{
int i;
const int nabsc = 9;
static const double CL[nabsc] = { 0,      0,   -0.4,      0,    0.7,     1,   0.8,     0,      0 };
static const double CM[nabsc] = { 0,      0,  0.014, 0.0039, -0.006,-0.008,-0.010,     0,      0 };
for (i = 0; i < nabsc - 1 && AOA[i + 1] < aoa; i++);
double f = (aoa - AOA[i]) / (AOA[i + 1] - AOA[i]);
//*cl = CL[i] + (CL[i + 1] - CL[i]) * f;  // aoa-dependent lift coefficient
double eaoa = aoa + wing_pitch; //effective angle of attack of wing
*cl = Kp * sin(eaoa)*cos(eaoa)*cos(eaoa) + Kv * cos(eaoa)*sin(eaoa)*sin(eaoa);
*cm = CM[i] + (CM[i + 1] - CM[i]) * f;  // aoa-dependent moment coefficient
double saoa = sin(aoa);
//double pd = 0.003 + 0.0*saoa*saoa;  // profile drag
*cd = 0.0; //Nuke drag from orbit, just to be sure.
//*cd = pd + oapiGetInducedDrag(*cl, wing_aspect_ratio, wing_effectiveness) + oapiGetWaveDrag(M, 0.75, 1.0, 1.1, 0.001);
// profile drag + (lift-)induced drag + transonic/supersonic wave (compressibility) drag
}

void Mirage2000::clbkSetClassCaps(FILEHANDLE cfg)
{
...
SetCW(0.0, 0.0, 0.0, 0.0);       //this should be ignored when an airfoil is defined.

CreateAirfoil3(LIFT_VERTICAL, _V(0.0, 4.0, 0.0), VLiftCoeff, 0, mean_chord_length, wing_area, wing_aspect_ratio);
//CreateAirfoil3(LIFT_HORIZONTAL, _V(0, 0, -4), HLiftCoeff, 0, 5, 15, 1.5);
...
}

Profile drag, induced drag, and wave drag should all be completely gone based on the VLiftCoeff definition. But if I tinker with the wing area in the CreateAirfoil3 definition for that airfoil, I get some mystery drag that seems to be proportional to that area. Did someone try to bake in induced drag to the CreateAirfoil3 function?

#### Urwumpe

##### Not funny anymore
Donator
What are you using for defining the chord length and wing aspect ratio? Maybe your induced drag is the problem, not the parasitic drag.

#### Thunder Chicken

Donator
What are you using for defining the chord length and wing aspect ratio? Maybe your induced drag is the problem, not the parasitic drag.
If you look at the VLiftCoeff function I posted, I set cd = 0. There shouldn't be any profile, induced, or wave drag at all.

#### Thunder Chicken

Donator
On a hunch, I had my CreateAirfoil3 instance for LIFT_VERTICAL use the HLiftCoeff function and it worked. I don't know where the drag was hiding in VLiftCoeff but this fixed it.

I replaced the code in both this for delta airfoils:

C++:
void VLiftCoeff(VESSEL *v, double aoa, double M, double Re, void *context, double *cl, double *cm, double *cd)
{
//Following are coefficients to calculate lift coefficient for delta wings with
//aspect ratio ~ 2.0 from Polhamus, A concept of the vortex lift of sharp-edge delta wings
//based on a leading edge suction analogy, NASA TN D-3767.

const double Kp = 2.2;
const double Kv = 3.2;

*cl = Kp * sin(aoa)*cos(aoa)*cos(aoa) + Kv * cos(aoa)*sin(aoa)*sin(aoa);
*cm = 0.0; //placeholder until a better model can be found.
*cd = 0.0;
//*cd = 0.015 + oapiGetInducedDrag(*cl, wing_aspect_ratio, wing_effectiveness) + oapiGetWaveDrag(M, 0.75, 1.0, 1.1, 0.04);
}

Mystery drag is gone, and now I will start walking back in the proper drag models and see how they perform.

It's a wonder I'm still sane. But that's exactly what an insane person would tell themselves.

#### Thunder Chicken

Donator
Still challenged to get appropriate high altitude performance out of the engine. Ceiling and top speed are way too low and slow. I realized that I'm starving my afterburner of oxygen as most low bypass afterburning turbofans recombine the cold bypass and hot core gas flows before entering the afterburner. I have a lot of unburned Jet-A coming out of the exhaust right now, which could be fun...

Damn, I forgot how pretty F-111s were.

#### Thunder Chicken

Donator
Now I have afterburning fixed. Mach 2.2 at 55,000 feet, as fast and high as a real Mirage2000C gets.

Speed tops out at just under Mach 1 at sea level, also correct for the Mirage 2000C. Just had to tweak the profile drag coefficient but the InducedDrag and WaveDrag helper functions are straight out of the box. All airfoil data in the model is specific for the Mirage2000C wing properties.

I'll take a look at implementing normal shock functions in the intake for when flying supersonically, but I think the effect will be minor for most aircraft. Thermodynamically what is most important in the engine model is getting the air mass flow into and through the engine correct (that's the vast majority of the reaction mass), and getting the pressure correct at the compressor inlet as the rest of the engine performance depends on that.

There is a lot of physics involved in getting a sensible flight model together. If the engine is wrong, or the aerodynamics are wrong, it won't fly like the real thing. Lots of details.

Progress!

#### Thunder Chicken

Donator
I've released my recompiled add-on module for Kev33's Mirage2000 with the Jet Engine Model Library here:

This is just a new module and updated configuration and scenario files that are installed over Kev33's original Mirage 2000 add-on (downloaded and installed separately). I haven't had any luck reaching him Kev33, but I think the attribution is clear.

It's actually a lot of fun to fly as it behaves pretty realistically now as the engine, airframe, and aerodynamics are as close to the real numbers as I can get them. Take it for a spin and let me know what you think.

#### Thunder Chicken

Donator
Jet Engine Library for Orbiter 2016 is now available through Orbiter Hangar:

#### Thunder Chicken

Donator
Has anyone tried to use this library yet? Curious for feedback.

#### JMW

Has anyone tried to use this library yet? Curious for feedback.
Tried but can't compile.........
What's my error?

#### Attachments

• Aircraft - Microsoft Visual Studio Express 2012 for Windows Desktop 17_09_2022 18_27_12.png
277.8 KB · Views: 7

#### Thunder Chicken

Donator
Tried but can't compile.........
What's my error?
Possibly something not configured correctly in your project properties?

#### JMW

Possibly something not configured correctly in your project properties?
Library n header are in correct directories, and are in project for "belt n braces".
Project compiles fine (with my usual "warnings") without the JEL additions.......
I dunno where to go next........

#### Thunder Chicken

Donator
Have you tried a clean build?

#### JMW

Have you tried a clean build?
Do you mean have I performed a "clean" on the project, and deleted K-Mirage2000 - Copy.obj ?
Yes I have.
Latest errors.........

I'm missing something connected with "_fmin".
Where is this source ref.?
Google says it should be in cmath but it's not.
What version of VS are you using?

Last edited:

#### Thunder Chicken

Donator
Do you mean have I performed a "clean" on the project, and deleted K-Mirage2000 - Copy.obj ?
Yes I have.
Latest errors.........
View attachment 30425
I'm missing something connected with "_fmin".
Where is this source ref.?
Google says it should be in cmath but it's not.
What version of VS are you using?
I was using VS2017, but my Windows HD died and I'm on Linux now, so I can't pull it up.

Are you compiling using static multithreaded /MT as your runtime library and ignoring msvct.lib and mscvrt.lib?

#### JMW

I was using VS2017, but my Windows HD died and I'm on Linux now, so I can't pull it up.

Are you compiling using static multithreaded /MT as your runtime library and ignoring msvct.lib and mscvrt.lib?
It was Multi-threaded DLL (/MD), changed to /MT
Now get conflict with LIBCMT.lib

#### Attachments

• Aircraft - Microsoft Visual Studio Express 2012 for Windows Desktop 18_09_2022 15_54_47.png
265.4 KB · Views: 2

#### Thunder Chicken

Donator
You seem to have two *.cpp files for the same project. Unsure if that is your problem, but you may want to remove one from the project and see if that helps.

You have a very busy solution space with multiple projects. I don't know how that works, but it seems that there is plenty of opportunity to get things crossed up. You might consider trying to have only one project in your solution, beat the bugs out of that, then add projects in incrementally.

#### JMW

I was using VS2017, but my Windows HD died and I'm on Linux now, so I can't pull it up.

Are you compiling using static multithreaded /MT as your runtime library and ignoring msvct.lib and mscvrt.lib?
It was Multi-threaded DLL (/MD), changed to /MT
Now get conflict with LIBCMT.lib

Keep losing internet.
This is Screenshot that should accompany.

#### JMW

You seem to have two *.cpp files for the same project. Unsure if that is your problem, but you may want to remove one from the project and see if that helps.

You have a very busy solution space with multiple projects. I don't know how that works, but it seems that there is plenty of opportunity to get things crossed up. You might consider trying to have only one project in your solution, beat the bugs out of that, then add projects in incrementally.
You might be right though all in Solution work fine until JEL is added to Mirage project.
RL has overtaken me for tonight.
Have a good one and will try and catch up at a later date.

Replies
38
Views
2K
Project Shuttle-A Mk.IX
Replies
72
Views
3K
Replies
0
Views
205
Replies
45
Views
2K