Project XB-70 Valkyrie Development Thread

Matias Saibene

Developing and CMakin'
Joined
Jul 7, 2012
Messages
1,113
Reaction score
744
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
This is the development thread for the XB-70 Valkyrie that I am developing for Orbiter (Windows/Linux).

Since I ran into some roadblocks in development and was encouraged to ask for help, I'm going to post questions here about problems I encounter in development. I thank you all for your responses in advance.
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,656
Reaction score
3,615
Points
138
Location
Massachusetts
I know a guy that made an add-on library for air-breathing jet engines that may interest you ;)


I think @Urwumpe did some organizational coding improvements on this library for his B-58 project. My forte is engine thermodynamics and not so much efficient and streamlined coding.
 

Matias Saibene

Developing and CMakin'
Joined
Jul 7, 2012
Messages
1,113
Reaction score
744
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
Well, my first problem I encountered is that my XB-70 won't take off.
I have no or very limited knowledge of aerodynamics, but I want to learn and would appreciate any help.
I have tried changing the area values of the elevators and the lift coefficient shift but I can't get it to take off.

It also has a problem with the landing gear, but I'll fix that soon, it must definitely be a bug in the landing gear logic.

This is the repo: https://github.com/MatiasSaibene/XB-70_Valkyrie_for_Orbiter.git

And here is attached a compiled version to test the problem I have.

Thanks in advance.
 

Attachments

  • XB70_Valkyrie_Alpha_v0-4.zip
    1.5 MB · Views: 7

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,656
Reaction score
3,615
Points
138
Location
Massachusetts
Well, my first problem I encountered is that my XB-70 won't take off.
I have no or very limited knowledge of aerodynamics, but I want to learn and would appreciate any help.
It's rather hard to determine what the problem is without knowledge of your vessel parameters and your lift coefficient definitions. It could be incorrect mass or incorrect aerodynamic properties, or both. Are you comfortable posting snippets of that code?

There are some legacy drag models that are superceded by drag models in the lift coefficient definitions, which is fine but it means that you need to take any drag coefficient data based on frontal area and recast it to a modified coefficient based on wing planform area. If you used published data for XB-70 drag coefficients and applied them in the airfoil definitions it will have exceedingly high drag.
 

Matias Saibene

Developing and CMakin'
Joined
Jul 7, 2012
Messages
1,113
Reaction score
744
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
It's rather hard to determine what the problem is without knowledge of your vessel parameters and your lift coefficient definitions. It could be incorrect mass or incorrect aerodynamic properties, or both. Are you comfortable posting snippets of that code?

There are some legacy drag models that are superceded by drag models in the lift coefficient definitions, which is fine but it means that you need to take any drag coefficient data based on frontal area and recast it to a modified coefficient based on wing planform area. If you used published data for XB-70 drag coefficients and applied them in the airfoil definitions it will have exceedingly high drag.

XB-70_Valkyrie_for_Orbiter/Windows/XB70Valkyrie.h

C++:
//Vessel parameters
const double XB70_SIZE = 22.8;  //Mean radius in meters.

const double XB70_EMPTYMASS = 93000; //Empty mass in kg.

const double XB70_FUELMASS = 149500; //Fuel mass in kg.

const double XB70_ISP = 50e4; //Fuel-specific impulse in m/s.

const double XB70_MAXMAINTH = 504e3; //Max main thrust in kN.

const double XB70_AFTERBRNTH = 768e3; //Max afterburner thrust.

const double LANDING_GEAR_OPERATING_SPEED = 0.25;

const VECTOR3 XB70_CoP = {0, 0, 0}; //Center of pressure for airfoils in m.

const VECTOR3 XB70_CS = {199.5443, 585.7, 33.2172};

const double XB70_VLIFT_C = 23.94; //Chord lenght in m.

const double XB70_VLIFT_S = 585.07; //Wing area in m^2.

const double XB70_VLIFT_A = 1.751; //Wing aspect ratio.

const double XB70_HLIFT_C = 5.01;

const double XB70_HLIFT_S = 21.74;

const double XB70_HLIFT_A = 1;

XB-70_Valkyrie_for_Orbiter/Windows/XB70Valkyrie.cpp

C++:
// 1. vertical lift component (code from DeltaGlider)

void VLiftCoeff (VESSEL *v, double aoa, double M, double Re, void *context, double *cl, double *cm, double *cd)
{
    const int nabsc = 9;
    static const double AOA[nabsc] = {-180*RAD,-60*RAD,-30*RAD, -2*RAD, 15*RAD,20*RAD,25*RAD,60*RAD,180*RAD};
    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};
    int i;
    for (i = 0; i < nabsc-1 && AOA[i+1] < aoa; i++);
    if (i < nabsc - 1) {
        double f = (aoa - AOA[i]) / (AOA[i + 1] - AOA[i]);
        *cl = CL[i] + (CL[i + 1] - CL[i]) * f;  // aoa-dependent lift coefficient
        *cm = CM[i] + (CM[i + 1] - CM[i]) * f;  // aoa-dependent moment coefficient
    }
    else {
        *cl = CL[nabsc - 1];
        *cm = CM[nabsc - 1];
    }
    double saoa = sin(aoa);
    double pd = 0.015 + 0.4*saoa*saoa;  // profile drag
    *cd = pd + oapiGetInducedDrag (*cl, 1.5, 0.7) + oapiGetWaveDrag (M, 0.75, 1.0, 1.1, 0.04);
    // profile drag + (lift-)induced drag + transonic/supersonic wave (compressibility) drag
}

// 2. horizontal lift component (code from DeltaGlider)

void HLiftCoeff (VESSEL *v, double beta, double M, double Re, void *context, double *cl, double *cm, double *cd)
{
    int i;
    const int nabsc = 8;
    static const double BETA[nabsc] = {-180*RAD,-135*RAD,-90*RAD,-45*RAD,45*RAD,90*RAD,135*RAD,180*RAD};
    static const double CL[nabsc]   = {       0,    +0.3,      0,   -0.3,  +0.3,     0,   -0.3,      0};
    for (i = 0; i < nabsc-1 && BETA[i+1] < beta; i++);
    if (i < nabsc - 1) {
        *cl = CL[i] + (CL[i + 1] - CL[i]) * (beta - BETA[i]) / (BETA[i + 1] - BETA[i]);
    }
    else {
        *cl = CL[nabsc - 1];
    }
    *cm = 0.0;
    *cd = 0.015 + oapiGetInducedDrag (*cl, 1.5, 0.6) + oapiGetWaveDrag (M, 0.75, 1.0, 1.1, 0.04);
}

C++:
    //Code from DeltaGlider

    hwing = CreateAirfoil3 (LIFT_VERTICAL, _V(-0.0958, 0.0574, -11.9142), VLiftCoeff, 0, XB70_VLIFT_C, XB70_VLIFT_S, XB70_VLIFT_A);
    // wing and body lift+drag components

    CreateAirfoil3 (LIFT_HORIZONTAL, _V(0.0789, 1.8259, -24.2352), HLiftCoeff, 0, XB70_HLIFT_C, XB70_HLIFT_S, XB70_HLIFT_A);
    // vertical stabiliser and body lift and drag components
   
   
    hlaileron = CreateControlSurface3 (AIRCTRL_AILERON, 18.37, 1.7, _V(-7.6463, 0.3196, -26.8960), AIRCTRL_AXIS_XPOS, 1.0, anim_raileron);
    hraileron = CreateControlSurface3 (AIRCTRL_AILERON, 18.37, 1.7, _V(7.4547, 0.3174, -26.8053), AIRCTRL_AXIS_XNEG, 1.0, anim_laileron);

    canards = CreateControlSurface3(AIRCTRL_ELEVATOR, 10.16, 1.7, _V(-0.0440, 1.4532, 14.7854),AIRCTRL_AXIS_XPOS, 1.0, anim_canards);

    CreateControlSurface3 (AIRCTRL_ELEVATOR, 36.74, 1.7, _V(-0.0833, 0.3068, -26.6097), AIRCTRL_AXIS_XPOS, 1.0, anim_elevator);
    CreateControlSurface3
    (AIRCTRL_ELEVATORTRIM, 36.74, 1.7, _V(-0.0833, 0.3068, -26.6097), AIRCTRL_AXIS_XPOS, 1.0, anim_elevatortrim);
}

I obtained the information from a PDF that @Urwumpe recommended to me. See page 31.
https://www.nasa.gov/centers/dryden/pdf/87774main_H-587.pdf
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,656
Reaction score
3,615
Points
138
Location
Massachusetts
Your thrust values XB70_MAXMAINTH and XB70_AFTERBRNTH look to be in N instead of kN. I'd check your Isp definition in the thruster setup.
 

Matias Saibene

Developing and CMakin'
Joined
Jul 7, 2012
Messages
1,113
Reaction score
744
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
Your thrust values XB70_MAXMAINTH and XB70_AFTERBRNTH look to be in N instead of kN. I'd check your Isp definition in the thruster setup.
C++:
//Define main engine
    th_main[0] = CreateThruster(_V(-3.6722, -0.8294, -25.5365), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    th_main[1] = CreateThruster(_V(-2.2222, -0.8294, -25.5401), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    th_main[2] = CreateThruster(_V(-0.8022, -0.8294, -25.5437), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    th_main[3] = CreateThruster(_V(0.6378, -0.8294, -25.5473), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    th_main[4] = CreateThruster(_V(2.0678, -0.8294, -25.5509), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    th_main[5] = CreateThruster(_V(3.5278, -0.8294, -25.5545), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    thg_main = CreateThrusterGroup(th_main, 6, THGROUP_MAIN);
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,656
Reaction score
3,615
Points
138
Location
Massachusetts
C++:
//Define main engine
    th_main[0] = CreateThruster(_V(-3.6722, -0.8294, -25.5365), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    th_main[1] = CreateThruster(_V(-2.2222, -0.8294, -25.5401), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    th_main[2] = CreateThruster(_V(-0.8022, -0.8294, -25.5437), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    th_main[3] = CreateThruster(_V(0.6378, -0.8294, -25.5473), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    th_main[4] = CreateThruster(_V(2.0678, -0.8294, -25.5509), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    th_main[5] = CreateThruster(_V(3.5278, -0.8294, -25.5545), _V(0, 0, 1), XB70_MAXMAINTH, JP6, XB70_ISP);
    thg_main = CreateThrusterGroup(th_main, 6, THGROUP_MAIN);

C++:
const double XB70_EMPTYMASS = 93000; //Empty mass in kg.

const double XB70_FUELMASS = 149500; //Fuel mass in kg.

const double XB70_ISP = 50e4; //Fuel-specific impulse in m/s.

const double XB70_MAXMAINTH = 504e3; //Max main thrust in kN.

const double XB70_AFTERBRNTH = 768e3; //Max afterburner thrust.

It seems that you are setting the maximum total thrust for the entire XB-70 to each of the six engines. From Wikipedia, the maximum thrust per engine is 89 kN per engine, for 534 kN total for all six engines. Orbiter expects this thrust to be in Newtons per the API_Reference, so XB70_MAXMAINTH = 89e3; //thrust per engine in N should be what you enter. Similarly, afterburning thrust from Wikipedia is 120 kN per engine, 720 kN for all six engines, so XB70_AFTERBRNTH = 120e3; //afterburning thrust per engine in N should be what you enter there.

Also, your Isp value is extremely high at 500,000 m/s. More typical values for afterburning jet engines are under 20,000 m/s. This value should be the same for each engine (the Isp of each engine is equal to the Isp of all six engines, it doesn't multiply by the number of engines).

Also, your mass numbers are close but not quite the same as published values. Wiki has an empty mass for the XB-70 of 115,031 kg (vs your 93,000 kg). Wiki says 140,000 kg of fuel mass vs. your 149,500 kg, which might be just a difference in data sources.

As for aerodynamic properties, it looks like from your VLiftCoeff definition that you used the coefficients for the DeltaGlider, but you applied them in the airfoil definition to the area of the XB-70 wing without modification. The resulting drag on the XB-70 will be astronomical.
 

Col Brubaker

Hoax Developer
Joined
May 21, 2011
Messages
83
Reaction score
41
Points
33
Location
Free Republic of Germany
I don't know much about code, but same as with the hoods... Have you tried to "hook" or set an inverter on the flaps in the imgui-node?
Because such a delta-wing would probably not lift and land, without flaps?

Do you reach full-thrust?
Did you hook, the Air-Surface-Mode?
Perhaps something with the airfoils?
What happen if you use my joystick module? New Default.json https://ufile.io/e587t1xe
You could set a "Button to Axis" Node between a Flap-Key and the flaps at the Airfoil module. So before lIft-off, You activate the flaps and before landing?
 

Col Brubaker

Hoax Developer
Joined
May 21, 2011
Messages
83
Reaction score
41
Points
33
Location
Free Republic of Germany
Not sure if this is related to my AMD?
Sol: Neptune
./Config/Neptune.cfg
./Config/Triton.cfg
./Config/Proteus.cfg
./Config/Nereid.cfg
XB-70_Valkyrie (XB-70 20001)
Vessel::RegisterModule XB70
basename=XB70
dirname=.
Vessel::RegisterModule failed
Could not load vessel module: XB70 (code /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by Modules/./libXB70.so))
[Thread 0x7fffe27fc6c0 (LWP 127538) exited]
[Thread 0x7fffe2ffd6c0 (LWP 127537) exited]
[Thread 0x7fffe37fe6c0 (LWP 127536) exited]
[Thread 0x7fffc4bf96c0 (LWP 127546) exited]
[Thread 0x7fffc53fa6c0 (LWP 127545) exited]
[Thread 0x7fffc65fc6c0 (LWP 127543) exited]
[Thread 0x7fffc6dfd6c0 (LWP 127542) exited]
[Thread 0x7fffc75fe6c0 (LWP 127541) exited]
[Thread 0x7fffe1ffb6c0 (LWP 127539) exited]
[Thread 0x7fffe3fff6c0 (LWP 127535) exited]
[Thread 0x7fffe8ffe6c0 (LWP 127534) exited]
[Thread 0x7fffe97ff6c0 (LWP 127533) exited]
double free or corruption (fasttop)

Thread 1 "Orbiter" received signal SIGABRT, Aborted.
0x00007ffff79c90ec in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) Quit
 

Matias Saibene

Developing and CMakin'
Joined
Jul 7, 2012
Messages
1,113
Reaction score
744
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
C++:
const double XB70_EMPTYMASS = 93000; //Empty mass in kg.

const double XB70_FUELMASS = 149500; //Fuel mass in kg.

const double XB70_ISP = 50e4; //Fuel-specific impulse in m/s.

const double XB70_MAXMAINTH = 504e3; //Max main thrust in kN.

const double XB70_AFTERBRNTH = 768e3; //Max afterburner thrust.

It seems that you are setting the maximum total thrust for the entire XB-70 to each of the six engines. From Wikipedia, the maximum thrust per engine is 89 kN per engine, for 534 kN total for all six engines. Orbiter expects this thrust to be in Newtons per the API_Reference, so XB70_MAXMAINTH = 89e3; //thrust per engine in N should be what you enter. Similarly, afterburning thrust from Wikipedia is 120 kN per engine, 720 kN for all six engines, so XB70_AFTERBRNTH = 120e3; //afterburning thrust per engine in N should be what you enter there.

Also, your Isp value is extremely high at 500,000 m/s. More typical values for afterburning jet engines are under 20,000 m/s. This value should be the same for each engine (the Isp of each engine is equal to the Isp of all six engines, it doesn't multiply by the number of engines).

Also, your mass numbers are close but not quite the same as published values. Wiki has an empty mass for the XB-70 of 115,031 kg (vs your 93,000 kg). Wiki says 140,000 kg of fuel mass vs. your 149,500 kg, which might be just a difference in data sources.

As for aerodynamic properties, it looks like from your VLiftCoeff definition that you used the coefficients for the DeltaGlider, but you applied them in the airfoil definition to the area of the XB-70 wing without modification. The resulting drag on the XB-70 will be astronomical.
How many errors in the variables I made!
Regarding VliftCoeff what exactly should change? Excuse me but I don't realize.
 

Matias Saibene

Developing and CMakin'
Joined
Jul 7, 2012
Messages
1,113
Reaction score
744
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
I don't know much about code, but same as with the hoods... Have you tried to "hook" or set an inverter on the flaps in the imgui-node?
Because such a delta-wing would probably not lift and land, without flaps?

Do you reach full-thrust?
Did you hook, the Air-Surface-Mode?
Perhaps something with the airfoils?
What happen if you use my joystick module? New Default.json https://ufile.io/e587t1xe
You could set a "Button to Axis" Node between a Flap-Key and the flaps at the Airfoil module. So before lIft-off, You activate the flaps and before landing?
It is undoubtedly a problem with airfoils. You had recommended FLZ Vortex to me but I don't understand exactly what values I should use.
 

Col Brubaker

Hoax Developer
Joined
May 21, 2011
Messages
83
Reaction score
41
Points
33
Location
Free Republic of Germany
It is undoubtedly a problem with airfoils. You had recommended FLZ Vortex to me but I don't understand exactly what values I should use.
I think with the FLZ Vortex https://flz-vortex.de/ , we should create an own threat and ask if there could be found a group of coders and aerodynamic-specialists who could build a real time simulation out of it?

First you need to enter airfoil profiles and build a wing from it. Then you can start calculations with different angles. And there has to be an angle of indifference: https://en.wikipedia.org/wiki/Angle_of_incidence_(aerodynamics)
At a flying wings the wing tips have a slightly downwards angle of indifference. For normal planes you need to build a second wing for the elevator.

FLZ could really be used to build a very realistic real time flight behaviour into our mainly delta-wings. - But I am not a coder.
Computers are fast enough now.
 

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,712
Reaction score
1,407
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him

Matias Saibene

Developing and CMakin'
Joined
Jul 7, 2012
Messages
1,113
Reaction score
744
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
Wouldn't it be better to build aerodynamic coefficient tables from existing data? Building tables from an incompressible solver for a supersonic aircraft coesnt seem like it would work well.

There is some data available:

Thanks @n72.75.
I have written the data from the NASA report that you shared with me but still the XB-70 does not take off. I'm sure I've done something wrong because I'm new to programming and have little knowledge of aeronautics.

I share my code of how I implemented the lift coefficient table of the page 76, maybe you can guide me.

C++:
void VLiftCoeff (VESSEL *v, double aoa, double M, double Re, void *context, double *cl, double *cm, double *cd)
{
    const int nabsc = 7;
    static const double AOA[nabsc] = {  -4*RAD, -2*RAD,  0*RAD,  2*RAD,  4*RAD, 6*RAD, 8*RAD,};
    static const double CL[nabsc]  = {   -0.14,  -0.11,  -0.02,   0.06,   0.13,  0.20,  0.28,};
    static const double CM[nabsc]  = {    0.02,      0,      0,      0,      0,     0, -0.01,};
    int i;
    for (i = 0; i < nabsc-1 && AOA[i+1] < aoa; i++);
    if (i < nabsc - 1) {
        double f = (aoa - AOA[i]) / (AOA[i + 1] - AOA[i]);
        *cl = CL[i] + (CL[i + 1] - CL[i]) * f;  // aoa-dependent lift coefficient
        *cm = CM[i] + (CM[i + 1] - CM[i]) * f;  // aoa-dependent moment coefficient
    }
    else {
        *cl = CL[nabsc - 1];
        *cm = CM[nabsc - 1];
    }
    double saoa = sin(aoa);
    double pd = 0.015 + 0.4*saoa*saoa;  // profile drag
    *cd = pd + oapiGetInducedDrag (*cl, XB70_VLIFT_A, 1) + oapiGetWaveDrag (M, 0.6, 0.75, 0.8, 0.95);
    // profile drag + (lift-)induced drag + transonic/supersonic wave (compressibility) drag
}

g2.png

And I apologize in advance for my ignorance, I know this should be easy to achieve but I can't.

I also have to fix the landing gear mechanism, it's a disaster. But my priority is to get the Valkyrie off the ground.
 

Col Brubaker

Hoax Developer
Joined
May 21, 2011
Messages
83
Reaction score
41
Points
33
Location
Free Republic of Germany
Either it is too heavy to fly, or ...
I can't run it: Could not load vessel module: XB70 (code /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by Modules/./libXB70.so))
But your folder contains a:
libXB70Valkyrie.so
 

Col Brubaker

Hoax Developer
Joined
May 21, 2011
Messages
83
Reaction score
41
Points
33
Location
Free Republic of Germany
Vessel::RegisterModule failed
Could not load vessel module: XB70 (code /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by Modules/./libXB70.so))
Sorry, but I still can't run it, even after installation on GLIBC 2.37-8, the latest available for Debian.
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,656
Reaction score
3,615
Points
138
Location
Massachusetts
Screenshot at 2023-09-26 00-08-10.png

Well, just using the visual helpers, your total engine thrust is over 3 MN, it should not be more than 720 kN or 0.72 MN with afterburner.

The weight is 2.369 MN which seems about right for maximum weight.

Generally it feels like the controls are all crossed up. Trying to roll right rolls the vessel to the left, etc. I modified the scenario to start while airborne, and it is extremely unstable. I think you have some flight control surfaces set up forward of the center of gravity and it really wants to fly backwards because of it. I don't know if you are trying to implement the canards but if so they seem to be overpowering the wings and tail surfaces.

There seems to be a problem with your contact point definitions:

Screenshot at 2023-09-26 00-15-52.png
You also seem to have some spurious forces acting at the wheel contacts which don't seem to be doing good things.
 
Last edited:
Top