Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter SDK Orbiter software developers post your questions and answers about the SDK, the API interface, LUA, meshing, etc.

Reply
 
Thread Tools
Old 11-19-2019, 11:24 AM   #1
asbjos
tuanibrO
 
asbjos's Avatar
Default Airfoils and rotation for capsule

Hello! I'm remaking vessel modules for the Mercury capsule, and having some trouble with the aerodynamic definitions.
I found coefficients for drag (cd), moment (cm) and lift (cl) in NTRS document 19710069960 (specifically pages 25-27).
I must admit: I'm not much used to aerodynamics, so my implementation could be wrong. But what I've done is to have the values for cd, cm and cl in the vertical lift function (vlift), and cd and cl in the horizontal lift (hlift), while setting cm = 0 in hlift, and halving the cd and cl from hlift and vlift, so that the sum of the cd is the original value from the NTRS document.

But, the problem is in the rotation. The cm orients the spacecraft blunt side first, as in real life. But historically, a 10 degree per second rotation was applied with roll thruster during reentry. During my simulation, the capsule simply refuses to roll. See video here

What changes do I need to do to make the capsule orient itself correctly when entering the atmosphere, but still allow rolling of the capsule?

The vlift and hlift functions are here:
PHP Code:
void ProjectMercury::vlift(VESSELvdouble aoadouble Mdouble Revoidcontextdoublecldoublecmdoublecd)
{
    static const 
double cmp[13] = { // for mach 1
        
0, -0.204, -0.193, -0.238, -0.337, -0.2230.030.230.310.2350.1940.1920
    
};

    static const 
double clp[13] = { // for mach 1
        
0, -0.42, -0.040.38, -0.38, -0.450.060.40.24, -0.380.020.420.0
    
};

    
// cd is dependent on mach, for aoa 0
    
static const  double mach[14] = {
        
0.00.500.70.901.001.11.301.602.003.05.007.09.620.0
    
};
    static const 
double cdp[14] = { // drag coeff at 0 AoA (blunt side first) for different mach numbers
        
1.01.021.11.231.341.41.461.491.531.61.561.51.51.5
    
};

    
double aoastep 30.0 RAD;
    
aoa += PI;
    
int idx max(0min(11, (int)(aoa aoastep)));
    
double d aoa aoastep idx;

    
int i 0;
    while (
14 && mach[i])
    {
        
i++;
    }

    
double machFraction;
    if (
== 14)
    {
        *
cd cdp[13];
    }
    else if (
== 0)
    {
        *
cd cdp[0];
    }
    else
    {
        *
cd cdp[1] + (cdp[i] - cdp[1]) * (mach[1]) / (mach[i] - mach[1]);
    }

    *
cl clp[idx] + (clp[idx 1] - clp[idx]) * d;
    *
cm cmp[idx] + (cmp[idx 1] - cmp[idx]) * d;

    *
cd *= 0.5;
}

void ProjectMercury::hlift(VESSELvdouble aoadouble Mdouble Revoidcontextdoublecldoublecmdoublecd)
{
    static const 
double cmp[13] = {
        
00.2040.1930.2380.3370.223, -0.03, -0.23, -0.31, -0.235, -0.194, -0.1920
    
};

    static const 
double clp[13] = {
        
0, -0.42, -0.040.38, -0.38, -0.450.06, -0.45, -0.380.38, -0.04, -0.420.0
    
};

    static const  
double mach[14] = {
        
0.00.500.70.901.001.11.301.602.003.05.007.09.620.0
    
};
    static const 
double cdp[14] = { // drag coeff at 0 AoA (blunt side first) for different mach numbers
        
1.01.021.11.231.341.41.461.491.531.61.561.51.51.5
    
};

    
int i 0;
    while (
14 && mach[i])
    {
        
i++;
    }

    
double machFraction;
    if (
== 14)
    {
        *
cd cdp[13];
    }
    else if (
== 0)
    {
        *
cd cdp[0];
    }
    else
    {
        *
cd cdp[1] + (cdp[i] - cdp[1]) * (mach[1]) / (mach[i] - mach[1]);
    }

    
double aoastep 30.0 RAD;
    
aoa += PI;
    
int idx max(0min(11, (int)(aoa aoastep)));
    
double d aoa aoastep idx;
    *
cl clp[idx] + (clp[idx 1] - clp[idx]) * d;
    *
cm 0.0;

    *
cd *= 0.5;

The thrusters should have pressure-independent thrust/isp, and should give a 1 deg/s^2 acceleration. But also an initial roll is dampened by the airfoils.

So what have I done wrong?



Also, as a sidequestion: on page 27 of the NTRS document, at 0 deg angle and mach 0 the cd is listed as 1.00. Is it fair to assume that this is the actual cd, or do you imagine it has been normalised? I must say I haven't read the entire 111 page document, but haven't found a specific indication for normalisation so far.

---------- Post added 19th Nov 2019 at 08:49 ---------- Previous post was 18th Nov 2019 at 22:23 ----------

And this is how the airfoils are created, by the way:
PHP Code:
CreateAirfoil3(LIFT_VERTICAL_V(000.635), vliftNULL1.891.89 1.89 PI 4.01.0);
CreateAirfoil3(LIFT_HORIZONTAL_V(000.635), hliftNULL1.891.89 1.89 PI 4.01.0); // spherical symmetry 
I.e. assuming capsule diameter 1.89 m and contact surface \frac{\pi d^2}{4}

---------- Post added at 12:24 ---------- Previous post was at 08:49 ----------

I just discovered API call SetRotDrag, so I got the main question answered myself.
asbjos is offline   Reply With Quote
Thanked by:
Old 11-21-2019, 03:53 PM   #2
martins
Orbiter Founder
Default

If the capsule doesn't react to the thrust force to the extent expected, maybe the aerodynamic setup is too stiff? That is, the centre of pressure (the airfoil attack point) may be too far off the centre of gravity. In your code, the offset is 0.635. Is this value based on any data? What happens if you reduce it?
martins is offline   Reply With Quote
Old 11-22-2019, 12:00 PM   #3
asbjos
tuanibrO
 
asbjos's Avatar
Default

Quote:
Originally Posted by martins View Post
 If the capsule doesn't react to the thrust force to the extent expected, maybe the aerodynamic setup is too stiff? That is, the centre of pressure (the airfoil attack point) may be too far off the centre of gravity. In your code, the offset is 0.635. Is this value based on any data? What happens if you reduce it?
Thank you, but I had failed to define a rotational drag, which caused this problem.
Now it rotates also under atmospheric flight, although I'm struggeling with real-life values for Project Mercury, or anything at all, really.

As for the offset, 0.635 was just a placeholder guesstimate. The actual historical value is 0.7239 metres.
asbjos is offline   Reply With Quote
Old 11-23-2019, 04:16 PM   #4
kuddel
Donator
Default

Quote:
Originally Posted by asbjos View Post
 Now it rotates also under atmospheric flight,
I have never compiled any aerodynamic model (vessel), so I might be wrong, but:
Shouldn't the rotations (lifts etc.) be direction depending? I mean in "forward" direction (launch) it should be minimal, while in backward (reentry) direction it should be maximal?!
kuddel is offline   Reply With Quote
Thanked by:
Old 11-23-2019, 07:13 PM   #5
asbjos
tuanibrO
 
asbjos's Avatar
Default

Quote:
Originally Posted by kuddel View Post
 I have never compiled any aerodynamic model (vessel), so I might be wrong, but:
Shouldn't the rotations (lifts etc.) be direction depending? I mean in "forward" direction (launch) it should be minimal, while in backward (reentry) direction it should be maximal?!
Good question. According to the documentation, the definition for the rot. drag coeffs. r_{x,y,z} is a_{x,y,z} = -\omega_{x,y,z} q S_y r_{x,y,z}, with a being angular deceleration, \omega the angular velocity, q the dynamic pressure, and S_y the reference surface defined as the cross section projected along the y-axis.

While of course being a simplification, it does not hold for a dimensional analysis. If we assume the rotational drag coeffs to be dimensionless, we get the units \frac{kg \cdot m \cdot rad}{s^3} for the angular deceleration.

Maybe MartinS could shed some light on this?

Last edited by asbjos; 11-23-2019 at 07:19 PM. Reason: I was stupider than usual
asbjos is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter SDK

Tags
airfoil, pitching moment


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 11:23 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.