From: Erik H. <eh...@us...> - 2016-08-16 11:41:49
|
Update of /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5471/Systems Modified Files: Controls.cpp Log Message: Extend the Lift table to +1.57 and -1.57 by supplying a sine function based on TC Index: Controls.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Systems/Controls.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -r1.42 -r1.43 *** Controls.cpp 13 Aug 2016 09:39:39 -0000 1.42 --- Controls.cpp 16 Aug 2016 11:41:46 -0000 1.43 *************** *** 38,41 **** --- 38,42 ---- #include <math.h> + #include <iostream> #include <sstream> #include <iomanip> *************** *** 291,298 **** #if 0 ! printf("Cma: %f, Cmadot: %f, Cmq: %f, Cmde: %f\n", _aircraft->_Cmalpha, _aircraft->_Cmadot, _aircraft->_Cmq, _aircraft->_Cmde); ! printf("CYbeta: %f, CYr: %f, CYp: %f, CYdr: %f\n", _aircraft->_CYbeta, _aircraft->_CYr, _aircraft->_CYp, _aircraft->_CYdr); ! printf("Cnbeta: %f, Cnr: %f, Cnp: %f, Cndr: %f\n", _aircraft->_Cnbeta, _aircraft->_Cnr, _aircraft->_Cnp, _aircraft->_Cndr); ! printf("Clbeta: %f, Clr: %f, Clp: %f\n", _aircraft->_Clbeta, _aircraft->_Clr, _aircraft->_Clp); #endif } --- 292,299 ---- #if 0 ! printf("Cma: %f, Cmadot: %f, Cmq: %f, Cmde: %f\n", _aircraft->_Cmalpha, _aircraft->_Cmadot, _aircraft->_Cmq, _aircraft->_Cmde); ! printf("CYbeta: %f, CYr: %f, CYp: %f, CYdr: %f\n", _aircraft->_CYbeta, _aircraft->_CYr, _aircraft->_CYp, _aircraft->_CYdr); ! printf("Cnbeta: %f, Cnr: %f, Cnp: %f, Cndr: %f\n", _aircraft->_Cnbeta, _aircraft->_Cnr, _aircraft->_Cnp, _aircraft->_Cndr); ! printf("Clbeta: %f, Clr: %f, Clp: %f\n", _aircraft->_Clbeta, _aircraft->_Clr, _aircraft->_Clp); #endif } *************** *** 301,307 **** std::string CableControls::lift() { ! float CLalpha, CLmax, CL0, CLde, CLq, CLadot, alpha; std::stringstream file; CLalpha = _aircraft->_CLalpha[0]; CLmax = _aircraft->_CLmax[0]; --- 302,310 ---- std::string CableControls::lift() { ! float CLalpha, CLmax, CL0, CLde, CLq, CLadot; ! float alpha, alpha0, TCF; std::stringstream file; + TCF = 1.0f + _aircraft->_wing.thickness/_aircraft->_wing.chord_mean; CLalpha = _aircraft->_CLalpha[0]; CLmax = _aircraft->_CLmax[0]; *************** *** 312,316 **** --- 315,332 ---- alpha = (CLmax-CL0)/CLalpha; + alpha0 = -CL0/CLalpha; + if (alpha >= 0.60) { + std::cerr << std::endl; + std::cerr << "*** ERROR: The alpha value for maximum lift is too high." << std::endl; + std::cerr << " This means the specified Stall Speed was too low." << std::endl; + std::cerr << " Make sure it is for a clean (no gear and no flaps) configurtion." << std::endl; + std::cerr << std::endl; + } + + // Post stall behaviour is loosly based on: + // http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20140000500.pdf + + file << " <!-- Lift above 0.85 and below -0.85 is generalised -->" << std::endl; file << std::setprecision(4) << std::fixed << std::showpoint; file << " <function name=\"aero/force/Lift_alpha\">" << std::endl; *************** *** 322,329 **** file << " <independentVar lookup=\"row\">aero/alpha-rad</independentVar>" << std::endl; file << " <tableData>" << std::endl; ! file << " -0.20 " << std::setw(5) << (-0.2*CLalpha + CL0) << std::endl; file << " 0.00 " << std::setw(6) << CL0 << std::endl; file << " " << std::setprecision(2) << (alpha) << std::setprecision(4) << " " << (CLmax) << std::endl; file << " 0.60 " << std::setw(6) << (CLmax-(0.6*alpha*CLalpha)) << std::endl; file << " </tableData>" << std::endl; file << " </table>" << std::endl; --- 338,354 ---- file << " <independentVar lookup=\"row\">aero/alpha-rad</independentVar>" << std::endl; file << " <tableData>" << std::endl; ! file << " -1.57 0.0000" << std::endl; ! file << " -1.22 " << std::setw(6) << (-0.6428*TCF) << std::endl; ! file << " -1.05 " << std::setw(6) << (-0.8660*TCF) << std::endl; ! file << " -0.88 " << std::setw(6) << (-1.0f*TCF) << std::endl; ! file << " " << std::setprecision(2) << (-0.6+alpha0) << " " << std::setw(6) << std::setprecision(4) << -(CLmax-(0.6*alpha*CLalpha)-CL0) << std::endl; ! file << " " << std::setprecision(2) << (-alpha+alpha0) << std::setprecision(4) << " " << (-CLmax) << std::endl; file << " 0.00 " << std::setw(6) << CL0 << std::endl; file << " " << std::setprecision(2) << (alpha) << std::setprecision(4) << " " << (CLmax) << std::endl; file << " 0.60 " << std::setw(6) << (CLmax-(0.6*alpha*CLalpha)) << std::endl; + file << " 0.88 " << std::setw(6) << (1.0f*TCF) << std::endl; + file << " 1.05 " << std::setw(6) << (0.8660*TCF) << std::endl; + file << " 1.22 " << std::setw(6) << (0.6428*TCF) << std::endl; + file << " 1.57 0.0000" << std::endl; file << " </tableData>" << std::endl; file << " </table>" << std::endl; *************** *** 1198,1201 **** --- 1223,1230 ---- CLaw[2] = 4.0f / (sqrtf(M2 - 1.0f)*(1.0f-TR/(2.0f*AR*sqrtf(M2 - 1.0f)))); + /* + * Comparison of different methods of estimating the Oswald factor (Grosu). + * http://www.fzt.haw-hamburg.de/pers/Scholz/OPerA/OPerA_PUB_DLRK_12-09-10.pdf + */ // Pamadi approximation for Oswald Efficiency Factor e k = (AR*TR) / cosf(sweep_le); |