Orbiter-Forum [Advanced Question] Airfoils and rotation for capsule
 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.

 11-19-2019, 11:24 AM #1 asbjos tuanibrO 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(VESSEL* v, double aoa, double M, double Re, void* context, double* cl, double* cm, double* cd) {     static const double cmp[13] = { // for mach 1         0, -0.204, -0.193, -0.238, -0.337, -0.223, 0.03, 0.23, 0.31, 0.235, 0.194, 0.192, 0     };     static const double clp[13] = { // for mach 1         0, -0.42, -0.04, 0.38, -0.38, -0.45, 0.06, 0.4, 0.24, -0.38, 0.02, 0.42, 0.0     };     // cd is dependent on mach, for aoa 0     static const  double mach[14] = {         0.0, 0.50, 0.7, 0.90, 1.00, 1.1, 1.30, 1.60, 2.00, 3.0, 5.00, 7.0, 9.6, 20.0     };     static const double cdp[14] = { // drag coeff at 0 AoA (blunt side first) for different mach numbers         1.0, 1.02, 1.1, 1.23, 1.34, 1.4, 1.46, 1.49, 1.53, 1.6, 1.56, 1.5, 1.5, 1.5     };     double aoastep = 30.0 * RAD;     aoa += PI;     int idx = max(0, min(11, (int)(aoa / aoastep)));     double d = aoa / aoastep - idx;     int i = 0;     while (i < 14 && M > mach[i])     {         i++;     }     double machFraction;     if (i == 14)     {         *cd = cdp[13];     }     else if (i == 0)     {         *cd = cdp[0];     }     else     {         *cd = cdp[i - 1] + (cdp[i] - cdp[i - 1]) * (M - mach[i - 1]) / (mach[i] - mach[i - 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(VESSEL* v, double aoa, double M, double Re, void* context, double* cl, double* cm, double* cd) {     static const double cmp[13] = {         0, 0.204, 0.193, 0.238, 0.337, 0.223, -0.03, -0.23, -0.31, -0.235, -0.194, -0.192, 0     };     static const double clp[13] = {         0, -0.42, -0.04, 0.38, -0.38, -0.45, 0.06, -0.45, -0.38, 0.38, -0.04, -0.42, 0.0     };     static const  double mach[14] = {         0.0, 0.50, 0.7, 0.90, 1.00, 1.1, 1.30, 1.60, 2.00, 3.0, 5.00, 7.0, 9.6, 20.0     };     static const double cdp[14] = { // drag coeff at 0 AoA (blunt side first) for different mach numbers         1.0, 1.02, 1.1, 1.23, 1.34, 1.4, 1.46, 1.49, 1.53, 1.6, 1.56, 1.5, 1.5, 1.5     };     int i = 0;     while (i < 14 && M > mach[i])     {         i++;     }     double machFraction;     if (i == 14)     {         *cd = cdp[13];     }     else if (i == 0)     {         *cd = cdp[0];     }     else     {         *cd = cdp[i - 1] + (cdp[i] - cdp[i - 1]) * (M - mach[i - 1]) / (mach[i] - mach[i - 1]);     }     double aoastep = 30.0 * RAD;     aoa += PI;     int idx = max(0, min(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(0, 0, 0.635), vlift, NULL, 1.89, 1.89 * 1.89 * PI / 4.0, 1.0);CreateAirfoil3(LIFT_HORIZONTAL, _V(0, 0, 0.635), hlift, NULL, 1.89, 1.89 * 1.89 * PI / 4.0, 1.0); // spherical symmetry   I.e. assuming capsule diameter 1.89 m and contact surface ---------- 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.
 Thanked by:
 11-21-2019, 03:53 PM #2 martins Orbiter Founder 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?
 11-22-2019, 12:00 PM #3 asbjos tuanibrO Quote: Originally Posted by martins  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.
 11-23-2019, 04:16 PM #4 kuddel Donator Quote: Originally Posted by asbjos  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?!
 Thanked by:
 11-23-2019, 07:13 PM #5 asbjos tuanibrO Quote: Originally Posted by kuddel  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. is , with being angular deceleration, the angular velocity, the dynamic pressure, and 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 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

 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 User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Orbiter-Forum.com     Announcements     Meets & Greets Orbiter Space Flight Simulator     Orbiter Web Forum         OFMM         Orbiter Forum Space Station         Simpit Forum     General Questions & Help     MFD Questions & Help     Hardware & Software Help     Tutorials & Challenges     Orbiter SDK     Orbiter Visualization Project     Orbiter Beta » Orbiter Project Orbiter Addons     OrbitHangar Addons & Comments     Addons     Addon Development     Addon Requests     Addon Support & Bugs         Addon Developer Forums             Project Apollo - NASSP     Orbiter Lua Scripting Far Side of the Moon     Spaceflight News     Math & Physics     Astronomy & the Night Sky     Backyard Rocketry     Brighton Lounge     International Forum

All times are GMT. The time now is 05:12 PM.