28map<int,const char*> CreateFusTypeStr(
void )
30 map<int,const char*> mFusTypeStr;
31 mFusTypeStr[(int)
FT_FILE] =
"FromFile";
32 mFusTypeStr[(int)
FT_PARAMS] =
"FromParams";
36map<int,const char*> CreateFusCvrStr(
void )
38 map<int,const char*> mFusCvrStr;
39 mFusCvrStr[(int)CRV_SPINE] =
"Spine";
40 mFusCvrStr[(int)CRV_UP_CONT] =
"UpCont";
41 mFusCvrStr[(int)CRV_SIDE_CONT] =
"SideContour";
42 mFusCvrStr[(int)CRV_DOWN_CONT] =
"DownContour";
43 mFusCvrStr[(int)CRV_CV_FACT_UP] =
"UpConvFact";
44 mFusCvrStr[(int)CRV_CV_FACT_DOWN] =
"DownConvFact";
48map<int,const char*> CreateFusCvrTypeStr(
void )
50 map<int,const char*> mFusCvrTypeStr;
51 mFusCvrTypeStr[(int)ELLIPSE] =
"SupEllipse";
52 mFusCvrTypeStr[(int)
AIRFOIL] =
"Airfoil";
53 mFusCvrTypeStr[(int)CONSTANT] =
"Constant";
54 return mFusCvrTypeStr;
57map<int,const char*> CreateFusAirfoilSide(
void )
59 map<int,const char*> mFusAirfoilSide;
60 mFusAirfoilSide[(int)
AS_UP] =
"Top";
61 mFusAirfoilSide[(int)
AS_DOWN] =
"Bottom";
62 return mFusAirfoilSide;
65map<int,const char*> CreateWingTypeStr(
void )
67 map<int,const char*> mWingTypeStr;
74map<int,const char*> CreateAirfoilTypeStr(
void )
76 map<int,const char*> mAirfoilTypeStr;
80 return mAirfoilTypeStr;
83map<int,const char*> CreateWingModTypeStr(
void )
85 map<int,const char*> mWingModTypeStr;
86 mWingModTypeStr[(int)WING_MOD_TYPE_ROOT] =
"Root";
87 mWingModTypeStr[(int)WING_MOD_TYPE_EQUI_LINE] =
"EquiLine";
88 mWingModTypeStr[(int)WING_MOD_TYPE_ARC] =
"Arc";
89 mWingModTypeStr[(int)WING_MOD_TYPE_LINE] =
"Line";
90 return mWingModTypeStr;
93map<int,const char*> CreateWingModConcStr(
void )
95 map<int,const char*> mWingModPanConcStr;
96 mWingModPanConcStr[(int)WING_MOD_PAN_CONC_LEFT] =
"Left";
97 mWingModPanConcStr[(int)WING_MOD_PAN_CONC_CENTER] =
"Center";
98 mWingModPanConcStr[(int)WING_MOD_PAN_CONC_RIGHT] =
"Right";
99 return mWingModPanConcStr;
102map<int,const char*> CreateWingDivSourceStr(
void )
104 map<int,const char*> mWingDivSourceStr;
108 return mWingDivSourceStr;
111map<int,const char*> CreateWingSurfSideStr(
void )
113 map<int,const char*> mWingSurfSideStr;
114 mWingSurfSideStr[(int)
WS_ALL] =
"All";
115 mWingSurfSideStr[(int)
WS_TOP] =
"Top";
116 mWingSurfSideStr[(int)
WS_BOTTOM] =
"Bottom";
117 return mWingSurfSideStr;
120map<int,const char*> CreateWingRibTypeStr(
void )
122 map<int,const char*> mWingRibTypeStr;
127 return mWingRibTypeStr;
130map<int,const char*> CreateWingSectionDivStr(
void )
132 map<int,const char*> mWingSectionDivStr;
133 mWingSectionDivStr[(int)
DT_LINEAR] =
"Linear";
134 mWingSectionDivStr[(int)
DT_COSINE] =
"Cosine";
135 mWingSectionDivStr[(int)
DT_USER] =
"UserDef";
136 mWingSectionDivStr[(int)
DT_PROFILE] =
"Profile";
137 mWingSectionDivStr[(int)
DT_AUTO] =
"Unknown";
138 return mWingSectionDivStr;
141map<int,const char*> CreateNacelleSwirlStr(
void )
143 map<int,const char*> mNacelleSwirlStr;
144 mNacelleSwirlStr[(int)SWIRL_UP] =
"SwirlUp";
145 mNacelleSwirlStr[(int)SWIRL_DOWN] =
"SwirlDown";
146 return mNacelleSwirlStr;
149map<int,const char*> CreateNacelleRangeStr(
void )
151 map<int,const char*> mNacelleRangeStr;
152 mNacelleRangeStr[(int)FULL_NACELLE] =
"Full";
153 mNacelleRangeStr[(int)HALF_NACELLE] =
"Half";
154 return mNacelleRangeStr;
173MS2_Data::MS2_Data(
void )
178MS2_Data::~MS2_Data(
void )
374 sect.
X = sect.
Z = 0.0;
392 sect.
X = sect.
Z = 0.0;
435 mod.
X0 = mod.
Y0 = mod.
Z0 = 0.0;
449 mod.
Type = WING_MOD_TYPE_ROOT;
453 mod.
Y0 = mod.
Z0 = 0.0;
481 conn.
Name =
"Connection";
507 wake.
Name =
"main_wing";
524 nac.
X0 = nac.
Y0 = nac.
Z0 = 0.0;
538 nac.
X0 = nac.
Y0 = nac.
Z0 = 0.0;
601 retStr =
"Vertical (#1) to horizontal (#2)";
604 retStr =
"Horizontal (#1) to vertical (#2)";
607 retStr =
"Parallel connection";
622 retStr =
"Horizontal";
628 retStr =
"Horizontal";
638 if( retStr[0] ==
'\"')
640 retStr = retStr.substr(1,retStr.size()-1);
642 if( retStr[retStr.size()-1] ==
'\"' )
644 retStr.resize( retStr.size()-1);
653 for( i=0; i<(int)str.length();i++ )
655 if( !isspace(retStr[i]) )
break;
659 retStr = retStr.erase(0,i);
668 sprintf(tmp,
"%05u",no);
670 sprintf(tmp,
"%04u",no);
671 return string( tmp );
676 fprintf( stderr,
"%s\n",
cComment );
688 char ss[200],sss[20],ssss[11];
693 sprintf(
cComment,
"Can't find file %s.", file );
707 if( iVer!=2 && iVer != 3 && iVer != 31 && iVer != 32 && iVer != 40 && iVer != 50 && iVer != 51 && iVer != 52 && iVer != 53 && iVer != 54 && iVer != 55)
709 sprintf(
cComment,
"Version - wrong ms2 data file version (%d)", iVer );
721 sprintf(
cComment,
"Error: No global section in configuration file.");
726 fscanf( t,
"%s", ss );
729 if (strcmp(ss,
"*****")!=0)
773 fscanf( t,
"%s", ss );
787 sprintf( ssss,
"%d", NN );
788 string cname = string(
"begin_airfoil" ) + string( ssss );
790 if(
has_section( t, cname.c_str() ) ==
false )
break;
794 if( bRestrictive )
return false;
804 for (np=0;np<PPil;np++)
807 sprintf(ssss,
"%d",np);
808 strcpy(sss,
"begin_wing");
813 fscanf( t,
"%s", ss );
816 while (strcmp(ss,sss));
819 if( !
ReadWing( t, newWing, np, bRestrictive, auto_mod ) )
return false;
820 Wings.push_back( newWing );
844 sprintf(
cComment,
"Fuselage - wrong fuselage type (type=%s)", tmpStr );
858 sprintf(
cComment,
"Fuselage - wrong fuselage type (type=%s)", tmpStr );
872 sprintf(
cComment,
"Fuselage - empty fuselage name" );
892 for (i=0;i<Kidod;i++)
894 fscanf (t,
"%lf",&wspKdod);
915 for(
int i=0; i<ICon; i++ )
926 Conns.push_back( newConn );
936 for(
int i=0; i<IConV; i++ )
947 Conns.push_back( newConn );
958 for(
int i=0; i<IWake; i++ )
971 newWake.
Name = string( name );
972 fscanf ( t,
"%d", &newWake.
Active );
973 fscanf ( t,
"%d", &newWake.
Wing1No );
974 fscanf ( t,
"%d", &newWake.
Wing2No );
975 fscanf ( t,
"%d", &newWake.
Wing1Rib );
976 fscanf ( t,
"%d", &newWake.
Wing2Rib );
982 Wakes.push_back( newWake );
1006 double dVect[5] = {0};
1011 memset( dVect, 0,
sizeof(
double)*5 );
1019 memset( dVect, 0,
sizeof(
double)*5 );
1026 bool bReadStat =
true;
1030 int iRead = fscanf( t,
"%s", tempStr );
1031 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1035 sprintf(
cComment,
"Fuselage spine definition error. Spine definition was not found or was defined incorrectly. (%s)",tempStr);
1040 iRead = fscanf( t,
"%s", tempStr );
1052 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1063 sprintf(
cComment,
"Fuselage spine definition error. Wrong spine type (%s)", tempStr );
1067 if( bReadStat ==
false )
1069 sprintf(
cComment,
"Fuselage spine definition error." );
1076 iRead = fscanf( t,
"%s", tempStr );
1078 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1082 sprintf(
cComment,
"Fuselage up contour definition error. Up contour definition was not foud or was defined incorrectly. (%s)",tempStr);
1087 iRead = fscanf( t,
"%s", tempStr );
1088 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1109 sprintf(
cComment,
"Fuselage up contour definition error. Wrong contour type (%s)", tempStr );
1113 if( bReadStat ==
false )
1115 sprintf(
cComment,
"Fuselage up contour definition error.\n" );
1122 iRead = fscanf( t,
"%s", tempStr );
1124 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1128 sprintf(
cComment,
"Fuselage side contour definition error. Side contour definition was not foud or was defined incorrectly. (%s)",tempStr);
1133 iRead = fscanf( t,
"%s", tempStr );
1134 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1155 sprintf(
cComment,
"Fuselage side contour definition error. Wrong contour type (%s)", tempStr );
1159 if( bReadStat ==
false )
1161 sprintf(
cComment,
"Fuselage side contour definition error." );
1169 iRead = fscanf( t,
"%s", tempStr );
1170 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1174 sprintf(
cComment,
"Fuselage down contour definition error. Down contour definition was not foud or was defined incorrectly. (%s)",tempStr);
1179 iRead = fscanf( t,
"%s", tempStr );
1180 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1201 sprintf(
cComment,
"Fuselage down contour definition error. Wrong contour type (%s)", tempStr );
1205 if( bReadStat ==
false )
1207 sprintf(
cComment,
"Fuselage down contour definition error." );
1215 iRead = fscanf( t,
"%s", tempStr );
1216 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1220 sprintf(
cComment,
"Fuselage up convexity factors definition error. Up convexity factors definition was not foud or was defined incorrectly. (%s)",tempStr);
1225 iRead = fscanf( t,
"%s", tempStr );
1226 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1255 sprintf(
cComment,
"Fuselage up convexity factors definition error. Wrong type (%s)", tempStr );
1259 if( bReadStat ==
false )
1261 sprintf(
cComment,
"Fuselage up convexity factors definition error." );
1268 iRead = fscanf( t,
"%s", tempStr );
1269 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1273 sprintf(
cComment,
"Fuselage down convexity factors definition error. Down convexity factors definition was not foud or was defined incorrectly. (%s)",tempStr);
1278 iRead = fscanf( t,
"%s", tempStr );
1279 if( iRead == 0 || iRead == EOF ) bReadStat =
false;
1308 sprintf(
cComment,
"Fuselage down convexity factors definition error. Wrong type (%s)", tempStr );
1312 if( bReadStat ==
false )
1314 sprintf(
cComment,
"Fuselage down convexity factors definition error." );
1326 if( SupEll.
EllType == ELLIPSE_SPINE )
1328 SupEll.
NF = (int)vect[0];
1329 SupEll.
NR = (int)vect[1];
1331 else if( SupEll.
EllType == ELLIPSE_NORMAL )
1339 fprintf( stderr,
"Wrong super ellipse type (%d) in %s\n", SupEll.
EllType, desc );
1352 int iRead = fscanf( t,
"%s", tempStr );
1353 if( iRead == 0 || iRead == EOF )
1355 fprintf( stderr,
"Empty/wrong airfoil side in %s.\n", desc );
1369 fprintf( stderr,
"Empty/wrong airfoil side in %s.\n", desc );
1383 iRead = fscanf( t,
"%s", tempStr );
1385 if( iRead == 0 || iRead == EOF )
1387 fprintf( stderr,
"Empty/wrong airfoil source in %s.\n", desc );
1401 fprintf( stderr,
"Empty/wrong airfoil source in %s.\n", desc );
1409 if( strlen(name)==0 || iRead == EOF )
1411 sprintf(
cComment,
"Empty/wrong airfoil name in %s", desc );
1416 airfoil.
Name =
"NACA4415.prf";
1420 airfoil.
Name = string( name );
1429 iRead =
ReadStr( t, nacastr );
1431 if( (strlen(nacastr) == 4 || strlen(nacastr) == 5 ) && iRead != EOF )
1437 sprintf(
cComment,
"Empty/wrong NACA airfoil number in %s. NACA number %s was read.", desc, nacastr );
1466 wing.
Name =
"Wing " + oss.str();
1484 sprintf(
cComment,
"Wing %d - wrong wing type", iW );
1489 if(
iVersion >= 40 )fscanf( t,
"%d", &wing.
ID );
1493 wing.
Name = string( name );
1494 if( wing.
Name.empty() )
1496 sprintf(
cComment,
"Wing %d - empty wing's name", iW );
1505 sprintf(
cComment,
"Wing \"%s\" - wrong wing division source (%s)", wing.
Name.c_str(), tmpStr );
1517 sprintf(
cComment,
"Wing \"%s\" - wrong wing division source (%s)", wing.
Name.c_str(), tmpStr );
1558 sprintf(
cComment,
"Wing \"%s\" - wrong wing surface name (%s)", wing.
Name.c_str(), ss );
1569 sprintf(
cComment,
"Wing \"%s\" - wrong wing rib's type", tmpStr );
1586 sprintf(
cComment,
"Wing \"%s\" - wrong wing rib type", wing.
Name.c_str() );
1600 sprintf(
cComment,
"Wing \"%s\" - wrong twist reference point (%f). Value should be between 0 and 1", wing.
Name.c_str(),wing.
TwistRef );
1608 iRead = fscanf( t,
"%lf %lf", &wing.
SRef, &wing.
CzDes );
1609 if( iRead == 0 || iRead == EOF || ferror(t) != 0 )
1611 sprintf(
cComment,
"Wing \"%s\" - wrong referece area (%f) or Clift design (%f) for minimum drag calculation. Minimum induced drag calculation will be disabled.", wing.
Name.c_str(),wing.
SRef, wing.
CzDes );
1621 sprintf(
cComment,
"Wing \"%s\" - wrong minimum drag calculation flag (%d). Value 0 or 1 was expected.", wing.
Name.c_str(),wing.
UseMunk );
1645 sprintf(
cComment,
"Wing \"%s\" - wrong wing rib type", wing.
Name.c_str() );
1675 for(
int i=0;i<iSect;i++)
1687 fscanf( t,
"%s", ss );
1689 if (strcmp(ss,
"end_wing")!=0)
1703 for(
int i=0; i< count; i++ )
1713 sprintf(
cComment,
"Wing \"%s\" - wrong wing module #%d definition!", wing.
Name.c_str(),i );
1729 int iRead =
ReadStr( t, airfoil );
1734 if( iRead == 0 || iRead == EOF || nac.
Profil.
Name.empty() )
1736 sprintf(
cComment,
"Wing \"%s\" - empty airfoil's name for nacelle", wing.
Name.c_str() );
1753 int iRead =
ReadPar( t,
"%s %s", tmpStr, nacRange );
1770 sprintf(
cComment,
"Wing \"%s\" - wrong nacelle swirl type!", wing.
Name.c_str() );
1787 sprintf(
cComment,
"Wing \"%s\" - wrong nacelle swirl range!", wing.
Name.c_str() );
1799 sprintf(
cComment,
"Wing \"%s\" - wrong wing type!", wing.
Name.c_str() );
1827 int iRead = fscanf( t,
"%s", tmpStr );
1830 sprintf(
cComment,
"Wing \"%s\" - wrong wing section division", wing.
Name.c_str() );
1874 while( tmpStr[i] !=
'\0' )
1876 if( isdigit( tmpStr[0]) == 0 )
1878 sprintf(
cComment,
"Wing \"%s\" - Wrong chord division \"%s\"", wing.
Name.c_str(), tmpStr );
1880 if( bRestrictive )
return false;
1887 tmp.push_back( (
double)atof(tmpStr) );
1893 iRead = fscanf( t,
"%s", tmpStr );
1895 while( tmpStr[i] !=
'\0' )
1897 if( isdigit( tmpStr[0]) == 0 )
1899 sprintf(
cComment,
"Wing \"%s\" - Wrong chord division \"%s\"", wing.
Name.c_str(), tmpStr );
1908 sprintf(
cComment,
"Wing \"%s\" - Wrong chord division.", wing.
Name.c_str() );
1912 tmpDiv = (double)atof(tmpStr) ;
1914 if( tmp[tmp.size()-1 ] > tmpDiv )
1917 sprintf(
cComment,
"Wing \"%s\" - Chord division is not in ascending order.", wing.
Name.c_str() );
1923 if( tmp[tmp.size()-1 ] == tmpDiv )
1925 sprintf(
cComment,
"Wing \"%s\" - Repeated chord division (%4.2f) will be ignored.", wing.
Name.c_str(), tmpDiv );
1931 tmp.push_back( tmpDiv );
1934 while (fabs(tmpDiv-100.0)>1e-19 );
1944 if( tmp[0] != 0 || tmp[tmp.size()-1] != 100 )
1946 sprintf(
cComment,
"Wing \"%s\" - wrong user defined chord division.\nChord division should start with 0 and end at 100.", wing.
Name.c_str() );
1963 bool readSpanConc =
false;
1965 iRead = fscanf( t,
"%s", tmpStr );
1969 mod.
Type = WING_MOD_TYPE_ROOT;
1971 mod.
Type = WING_MOD_TYPE_EQUI_LINE;
1973 mod.
Type = WING_MOD_TYPE_ARC;
1975 mod.
Type = WING_MOD_TYPE_LINE;
1978 sprintf(
cComment,
"Wing module reading error - wrong module type (%s)!", tmpStr);
1983 iRead = fscanf( t,
"%lf %lf", &mod.
C, &mod.
Alfa );
1984 if( iRead == 0 || iRead == EOF || ferror(t) != 0 )
1987 if( mod.
Type == WING_MOD_TYPE_ROOT)
1989 iRead = fscanf( t,
"%lf %lf %lf %lf", &mod.
XRef, &mod.
X0, &mod.
Y0, &mod.
Z0 );
1990 if( iRead == 0 || iRead == EOF || ferror(t) != 0 )
1993 else if( mod.
Type == WING_MOD_TYPE_EQUI_LINE )
1995 iRead = fscanf( t,
"%lf %lf %d %lf %lf %lf %d", &mod.
Fi, &mod.
Gamma, &mod.
N, &mod.
NDist, &mod.
L, &mod.
R, &mod.
UseMunk);
1996 if( iRead == 0 || iRead == EOF || ferror(t) != 0 )
1998 readSpanConc =
true;
2000 else if( mod.
Type == WING_MOD_TYPE_LINE )
2002 iRead = fscanf( t,
"%lf %lf %d %lf %lf %lf %d", &mod.
Fi, &mod.
Gamma, &mod.
N, &mod.
NDist, &mod.
L, &mod.
R, &mod.
UseMunk);
2003 if( iRead == 0 || iRead == EOF || ferror(t) != 0 )
2005 readSpanConc =
true;
2007 else if( mod.
Type == WING_MOD_TYPE_ARC )
2009 iRead = fscanf( t,
"%lf %lf %d %lf %lf %d", &mod.
Fi, &mod.
Gamma, &mod.
N, &mod.
NDist, &mod.
R, &mod.
UseMunk);
2010 if( iRead == 0 || iRead == EOF || ferror(t) != 0 )
2012 readSpanConc =
true;
2016 sprintf(
cComment,
"Wing module reading error - wrong module type (%d)!", mod.
Type );
2021 if( bRead ==
false )
2023 sprintf(
cComment,
"Wing module reading error!" );
2030 if( readSpanConc ==
true )
2032 iRead = fscanf( t,
"%s", tmpStr );
2043 sprintf(
cComment,
"Wing module reading error - wrong span paneling type (%s)!", tmpStr);
2054 iRead =
ReadStr( t, airfoil );
2059 if( iRead == 0 || iRead == EOF )
2061 sprintf(
cComment,
"Wing module reading error - wrong airfoil's name (%s)!", mod.
Profil.
Name.c_str() );
2070 if( bRead ==
false )
2072 sprintf(
cComment,
"Wing module reading error!" );
2095 ReadPar ( t,
"%lf %lf %lf", §.
X, §.
Y, §.
Z );
2112 int iRead =
ReadStr( t, tempStr );
2114 if( iRead == 0 || iRead == EOF )
2116 fprintf( stderr,
"Empty/wrong airfoil source in %s.\n", desc );
2134 fprintf( stderr,
"Empty/wrong airfoil source in %s.\n", desc );
2147 if( strlen(name)==0 || iRead == EOF )
2151 sprintf(
cComment,
"Empty/wrong airfoil name in %s", desc );
Comment();
2157 airfoil.
Name =
"NACA4415.prf";
2162 airfoil.
Name = string( name );
2171 iRead =
ReadStr( t, nacastr );
2173 if( ( strlen(nacastr) == 4 || strlen(nacastr) == 5 ) && iRead != EOF )
2179 sprintf(
cComment,
"Empty/wrong NACA airfoil number in %s. NACA number %s was read.", desc, nacastr );
Comment();
2195 for(
int i=0; i<N; i++ )
2200 for(
int ii=0; ii<NN; ii++ )
2216 sprintf(
cComment,
"Empty/wrong airfoil name %s in %s", name, desc );
Comment();
2221 sprintf(
cComment,
"Empty/wrong airfoil name %s in %s\nNACA 4415 is established", name, desc );
Comment();
2237 double xd, xg, zd, zg;
2244 for(
int i=0; i<NN; i++ )
2246 ReadPar( t,
"%lf %lf %lf %lf", &xd, &zd, &xg, &zg );
2247 airfoil.
Xd.push_back( xd );
2248 airfoil.
Zd.push_back( zd );
2249 airfoil.
Xg.push_back( xg );
2250 airfoil.
Zg.push_back( zg );
2294 fscanf( t,
"%s", ss );
2298 fprintf(stderr,
"brak sekcji: %s\n", sec);
2302 while( strcmp(ss,sec) );
2313 fscanf( t,
"%s", ss );
2317 fprintf(stderr,
"missing section: %s\n", sec); fflush( stderr );
2321 while( strcmp(ss,sec) );
2330 ofstream outFile( file, ios_base::out );
2331 if( outFile.fail() )
2333 sprintf(
cComment,
"Output file can not be opened" );
2341 outFile<<endl<<
"#######################"<<endl;
2342 outFile<<
"/*"<<endl;
2343 outFile<<
"WING Section (\"begin_wing*\")"<<endl;
2344 outFile<<
" is wing active ( 1- active, 2 - not active)"<<endl;
2346 outFile<<
" name"<<endl;
2348 outFile<<
" compute fuselage-wing intersection: 0 - no, 1 - yes"<<endl;
2349 outFile<<
" the fuselage longeron number (according to definition of sections in the fuselage geometry file) which begins the wing"<<endl;
2352 outFile<<
" twist reference point (0...1) (0 - leading edge, 1 - trailing edge)"<<endl;
2353 outFile<<
" <rest of wing definition ( see documentation )>"<<endl;
2375 outFile<<
" End of wing section (\"end\")"<<endl;
2376 outFile<<
" */"<<endl;
2377 outFile<<
"#######################"<<endl<<endl;
2379 for(
int i=0;i < (int)
Wings.size();i++ )
2398 string myFile = filename;
2401 found = myFile.rfind(ext);
2402 if (found!=string::npos)
2403 myFile.erase( found,ext.length() );
2410 fout<<
"# *****************************************"<<endl;
2411 fout<<
"# * *"<<endl;
2412 fout<<
"# * Automatically generated config file *"<<endl;
2413 fout<<
"# * *"<<endl;
2414 fout<<
"# *****************************************"<<endl;
2417 fout<<
"Each section in this file begins by keyword \"begin\" and ends by keyword \"end\"."<<endl;
2418 fout<<
"Keyword \"begin\" could be extended (e.g. \"begin_wing0\") by name of section:"<<endl;
2419 fout<<
"wing*, fuselage, connections, connections_V."<<endl;
2420 fout<<
"In the main section reference values (up to row \"*****\")"<<endl;
2421 fout<<
"can be omitted - then they will be computed using main wing section (section \"wing0\")."<<endl;
2422 fout<<
"The geometry is defined in the axis system defined as follows:"<<endl;
2423 fout<<
"\torigin in fuselage nose, leading edge point of main wing (in the symmetry plane),"<<endl;
2424 fout<<
"\tit should be the most forward point of the aircraft body,"<<endl;
2425 fout<<
"\taxis x - backward, usually longwise the Mean Aerodynamic Chord (MAC)"<<endl;
2426 fout<<
"\taxis y - on the right wing,"<<endl;
2427 fout<<
"\taxis z - up."<<endl;
2432 fout<<endl<<
"#######################"<<endl;
2434 fout<<
"Version section (\"begin_version\")"<<endl;
2435 fout<<
" version number"<<endl;
2436 fout<<
" End of version section (\"end\")"<<endl;
2438 fout<<
"#######################"<<endl<<endl;
2439 fout<<endl<<
"begin_version"<<endl;
2443 fout<<endl<<
"#######################"<<endl;
2445 fout<<
"Main section (\"begin\")"<<endl;
2446 fout<<
"\treference area"<<endl;
2447 fout<<
"\tMAC"<<endl;
2448 fout<<
"\twing span"<<endl;
2449 fout<<
"\tX coordinate of quarter of MAC (it is the point, which is the pole"<<endl;
2450 fout<<
"\tZ coordinate of quarter of MAC for moments calculation)"<<endl;
2451 fout<<
"\tscale coefficient"<<endl;
2452 fout<<
"*****"<<endl;
2453 fout<<
"\tname of the output grid file (without extension - default extension [.inp] will be added)"<<endl;
2454 fout<<
"\tautomatic output file name flag"<<endl;
2455 fout<<
"\t\t1 (default) output file name [.inp] based on ms2 file name"<<endl;
2456 fout<<
"\t\t0 full pathname defined by user"<<endl;
2457 fout<<
"\tnumber of wings with defined chord wise partition"<<endl;
2458 fout<<
"\tnumber of wings without defined chord wise partition"<<endl;
2459 fout<<
"\tsymmetry flag:"<<endl;
2460 fout<<
"\t\t0 (default if flag doesn't exist) - symmetrical object"<<endl;
2461 fout<<
"\t\t1 - right part"<<endl;
2462 fout<<
"\t\t-1 - left part"<<endl;
2463 fout<<
"\toutput type flag:"<<endl;
2464 fout<<
"\t\t0 (default if flag doesn't exist) - mesh written as nodes"<<endl;
2465 fout<<
"\t\t1 - mesh written as panels"<<endl;
2466 fout<<
"The end of main section (\"end\")"<<endl;
2468 fout<<
"#######################"<<endl<<endl;;
2470 fout<<endl<<
"begin"<<endl;
2472 fout.setf(ios::fixed,ios::floatfield);
2483 fout<<
"*****"<<endl;
2487 fout<<
"*****"<<endl;
2489 fout<<
"*****"<<endl;
2505 fout<<endl<<
"#######################"<<endl;
2507 fout<<
"FUSELAGE Section (\"begin_fuselage\")"<<endl;
2508 fout<<
" does the fuselage exist: 1 - fuselage exists, 0 - doesn't exist"<<endl;
2509 fout<<
" is the fuselage active: 1 - active, 0 - not active"<<endl;
2512 fout<<
" name of the fuselage sections data file (default extension [.f])"<<endl;
2514 fout<<
" number of additional sections computed automatically"<<endl;
2515 fout<<
" \"x\" coordinates of additional sections"<<endl;
2516 fout<<
"End of fuselage section (\"end\")"<<endl;
2518 fout<<
"#######################"<<endl<<endl;
2520 fout<<endl<<
"begin_fuselage"<<endl;
2680 fout<<
"end_fuselage"<<endl;
2689 fout<<endl<<
"#######################"<<endl;
2691 fout<<
"CONNECTIONS section (\"begin_connections\")"<<endl;
2692 fout<<
" number of connections - ICon"<<endl;
2693 fout<<
" definitions of successive connections (ICon times)"<<endl;
2694 fout<<
" type ( Horizontal, Vertical)"<<endl;
2695 fout<<
" annotation"<<endl;
2696 fout<<
" is section active ( 1- active, 2 - not active)"<<endl;
2697 fout<<
" number of the 1st wing (vertical)"<<endl;
2698 fout<<
" number of the 2nd wing (horizontal)"<<endl;
2699 fout<<
" number of wing 1 rib connected to wing 2 (0-0, 1-last)"<<endl;
2700 fout<<
" number of wing 2 rib connected to wing 1"<<endl;
2701 fout<<
" number of wing 2 longeron connected to leading point of wing 1"<<endl;
2702 fout<<
" number of wing 2 longeron connected to trailing point of wing 1"<<endl;
2703 fout<<
" wing 2 surface for modification (0-bottom or exterior, 1-top or interior)"<<endl;
2704 fout<<
"End (\"end\")"<<endl;
2706 fout<<
"#######################"<<endl<<endl;
2709 fout<<endl<<
"begin_connections"<<endl;
2710 fout<<
Conns.size()<<endl;
2711 for(
int i=0;i < (int)
Conns.size();i++)
2725 fout<<endl<<
"#######################"<<endl;
2727 fout<<
"WAKE INFO section (\"begin_wake_info\")"<<endl;
2728 fout<<
" number of defined wakes - IWake"<<endl;
2729 fout<<
" definitions of successive wakes (IWake times)"<<endl;
2730 fout<<
" type ( Horizontal, Vertical)"<<endl;
2731 fout<<
" annotation"<<endl;
2732 fout<<
" is section active ( 1- active, 2 - not active)"<<endl;
2733 fout<<
" number of the 1st wing (from)"<<endl;
2734 fout<<
" number of the 2nd wing (through)"<<endl;
2735 fout<<
" number of wing 1 rib connected to wake"<<endl;
2736 fout<<
" number of wing 2 rib connected to wake"<<endl;
2737 fout<<
" wing 2 surface for wake modification (0-bottom or exterior, 1-top or interior)"<<endl;
2738 fout<<
"End (\"end\")"<<endl;
2740 fout<<
"#######################"<<endl<<endl;
2743 fout<<endl<<
"begin_wake_info"<<endl;
2744 fout<<
Wakes.size()<<endl;
2745 for(
int i=0;i < (int)
Wakes.size();i++)
2748 fout<<
Wakes[i].Name<<endl;
2749 fout<<
Wakes[i].Active<<
" ";
2750 fout<<
Wakes[i].Wing1No<<
" ";
2751 fout<<
Wakes[i].Wing2No<<
" ";
2752 fout<<
Wakes[i].Wing1Rib<<
" ";
2753 fout<<
Wakes[i].Wing2Rib<<
" ";
2754 fout<<
Wakes[i].Wing2Surf<<
" ";
2764 fout<<endl<<
"begin_wing"<<No<<endl;
2767 fout<<wing.
ID<<
" "<<wing.
Name<<endl;
2788 for(
int i=0;i < (int)wing.
Sec.
Sections.size(); i++ )
2794 for(
int i=0; i<(int)wing.
Mod.
Modules.size();i++ )
2804 fout<<nac.
X0<<
" "<<nac.
Y0<<
" "<<nac.
Z0<<endl;
2805 fout<<nac.
fi<<
" "<<nac.
theta<<
" "<<nac.
psi<<endl;
2807 fout<<nac.
Y<<
" "<<nac.
ZUp<<
" "<<nac.
ZDown<<endl;
2808 fout<<nac.
NUp<<
" "<<nac.
NDown<<endl;
2822 for(
int i=0;i<(int)wing.
UserDiv.size();i++ ) fout<<wing.
UserDiv[i]<<
" ";
2826 fout<<
"end_wing"<<endl;
2834 fout<<mod.
C<<
"\t"<<mod.
Alfa<<
"\t";
2835 if( mod.
Type == WING_MOD_TYPE_ROOT )
2837 fout<<mod.
XRef<<
"\t"<<mod.
X0<<
"\t"<<mod.
Y0<<
"\t"<<mod.
Z0<<
"\t";
2839 else if( mod.
Type == WING_MOD_TYPE_EQUI_LINE )
2841 fout<<mod.
Fi<<
"\t"<<mod.
Gamma<<
"\t"<<mod.
N<<
"\t"<<mod.
NDist<<
"\t"<<mod.
L<<
"\t"<<mod.
R<<
"\t"<<mod.
UseMunk<<
"\t";
2844 else if( mod.
Type == WING_MOD_TYPE_LINE )
2846 fout<<mod.
Fi<<
"\t"<<mod.
Gamma<<
"\t"<<mod.
N<<
"\t"<<mod.
NDist<<
"\t"<<mod.
L<<
"\t"<<mod.
R<<
"\t"<<mod.
UseMunk<<
"\t";
2849 else if( mod.
Type == WING_MOD_TYPE_ARC )
2866 fout << sect.
Chord << endl;
2867 fout << sect.
X <<
"\t" << sect.
Y <<
"\t" << sect.
Z << endl;
2868 fout << sect.
RotX <<
"\t" << sect.
RotY <<
"\t" << sect.
RotZ << endl;
2870 fout << sect.
No << endl;
2878 fout << airfoil.
Name << endl;
2888 int N = airfoil->size();
2889 for(
int i=0; i<N; i++ )
2892 fout <<
"begin_airfoil" << i << endl;
2893 fout << airfoil->at(i).ShortName << endl;
2894 int NN = airfoil->at(i).Xd.size();
2896 for(
int ii=0; ii<NN; ii++ )
2898 fout << airfoil->at(i).Xd[ii] <<
" ";
2899 fout << airfoil->at(i).Zd[ii] <<
" ";
2900 fout << airfoil->at(i).Xg[ii] <<
" ";
2901 fout << airfoil->at(i).Zg[ii] <<
" ";
2904 fout <<
"end_airfoil" << endl << endl;
2916 for(
int i=0;i < (int)
Wings.size();i++ )
2926 for(
int i=0;i < (int)
Wings.size();i++ )
AIRFOIL class to manipulate the airfoil geometry or it can read geometry data from file (5 commonly ...
Structure, which defines connection of two wings.
int Czeb1
number of wing 1 rib connected to wing 2
int Cend
number of wing 2 longeron connected to trailing point of wing 1
int Czeb2
number of wing 2 rib connected to wing 1
int CP2
number of the 2nd wing (horizontal in case of vertical connection)
int iActive
is connection section active ( 1- active, 2 - not active)
int iTyp
Type of connection ( horizontal, vertical, parallel )
std::string ConName
Name of connection.
int Csurf
surface of wing 2 which will be modified (0-bottom or exterior, 1-top or interior)
int CP1
number of the 1st wing (vertical in case of horizontal connection)
int Cstart
number of wing 2 longeron connected to leading point of wing 1
int Read(FILE *f, int typ, int version=2)
Read connection section (within MS2 file reading)
int Write(std::ostream &fout)
Write connection section (within MS2 file saving)
static int ReadVect(FILE *stream, double *Par, int n, double dScal=1.)
Function to read double vector "Par" of "n" dimension from FILE "stream". The read values are scaled ...
static FILE * fopen(const char *filename, const char *mode)
Cross-platform function to fopen function that supports UTF-8 encoded name.
static const char * filename_name(const char *name)
Returns pointer to filename without path.
static int ReadComm(FILE *stream)
Function to read of a comment till the end of line. It returns 0 or EOF if it is performed.
static void ReadDummy(FILE *stream)
Function to read a comment line.
static int ReadStr(FILE *stream, char *Par)
Function to read the new line from FILE "stream" and to store it in table of char "Par"....
static int ReadPar(FILE *stream, const char *Format, void *Par)
Function to read one variable. The type of variable depends on Format, compatible with stdio library.
static const char * filename_ext(const char *buf)
Returns pointer to filename extension.
static bool CompareStrings(char *str1, char *str2)
Compares two strings (str1 and str2). Returns true if they match, false otherwise.
int GetDpWingNo(void)
returns number of depedentend wings (SLAVE)
std::string WingSurfName(int n)
returns wing surface type (name) - see MS2WingSurf
void SetDefaults(void)
set default reference values
static std::map< int, const char * > AirfoilTypeStr
file, NACA, table
static void ClearWing(MS2_Wing &wing)
cleans MS2_Wing object (wing definition)
static std::map< int, const char * > NacelleSwirlStr
swirl up, swirl down
bool WriteEmbededProfiles(std::ostream &fout, std::vector< MS2_Profile > *airfoil)
writes embeded airfoil geometry
int GetIndpWingNo(void)
returns number of indepedentend wings (MASTER & INDEPENDENT)
static void ClearGeneral(MS2_General &gen)
cleans MS2_General object (general data)
bool WriteFuselage(std::ostream &fout)
writes fuselage data
static std::map< int, const char * > WingModTypeStr
root, equi line, arc, line
virtual void Comment(void)
displays comment (warning or information)
static std::map< int, const char * > FusTypeStr
file, parameters
static void SetSectionDefs(MS2_Section §)
sets MS2_Section object (wing section definition)
static void ClearSection(MS2_Section §)
cleans MS2_Section object (wing section definition)
static void SetModuleDefs(MS2_ModWingModule &mod)
sets MS2_ModWingModule object (wing module definition)
char cComment[256]
message text in case of error
bool ReadFusFromParams(FILE *t, bool bRestrictive)
reads Fuselage data in case fuselage defined using modules
static void ClearWake(MS2_Wake &wake)
cleans MS2_Wake object (wake information)
static void SetWingDefs(MS2_Wing &wing)
sets MS2_Wing object (wing definition)
bool WriteProfile(std::ostream &fout, MS2_Profile airfoil)
writes airfoil data
static void ClearModule(MS2_ModWingModule &mod)
cleans MS2_ModWingModule object (wing module definition)
bool WriteWingModule(std::ostream &fout, MS2_ModWingModule mod)
writes modular wing's data
static std::map< int, const char * > WingSectionDivStr
linear, cosine etc.
int iVersion
version of read file
std::string RemoveExt(std::string filename)
removes the filename extention
static void MS2_Conn2CONNECT(MS2_Conn &Conn, CONNECT_DATA &newCon)
converts MS2_Conn to CONNECT_DATA
static std::string RemoveWhiteSpaces(std::string str)
removes white chars from string
static void ClearFuselage(MS2_Fuselage &fus)
cleans MS2_Fuselage object (fuselage definition)
static void SetFuselageDefs(MS2_Fuselage &fus)
sets MS2_Fuselage object (fuselage definition)
static void SetPrfDefs(MS2_Profile &prf)
sets MS2_Profile object (airfoil)
bool Read(const char *file, bool bRestrictive, bool auto_mod)
reads ms2 file
static const int CURRENT_VERSION
current version of ms2data module
static void ClearConnection(MS2_Conn &conn)
cleans MS2_Conn object (wings connection)
static int find_section(FILE *ff, const char *sec)
to find the section in ms2 file - imported from "mesh2.h"
bool ReadChordDivision(FILE *t, MS2_Wing &wing, bool bRestrictive)
reads user define chord division (see DT_USER)
bool ReadFusEllipse(FILE *t, MS2_SuperEllipse &SupEll, const char *desc)
reads fuselage elipse data
static std::string GetNACANoAsString(int no)
converts NACA profile number to string
static void SetWakeDefs(MS2_Wake &wake)
sets MS2_Wake object (wake information)
static void ClearPrf(MS2_Profile &prf)
cleans MS2_Profile object (airfoil)
static void CONNECT2MS2_Conn(CONNECT_DATA &Con, MS2_Conn &newConn)
converts CONNECT_DATA to MS2_Conn
static std::map< int, const char * > WingModPanConcStr
paneling distribution in module wings modules ( left, right center )
static std::string ConnTypeName(int n)
returns connection type name
static void SetFusCurveDefs(MS2_FusCurve &cvr, int elltype)
sets MS2_Profile object (airfoil)
static std::map< int, const char * > WingRibTypeStr
open, external, both
bool WriteWing(std::ostream &fout, MS2_Wing wing, int no)
writes wing's data
static std::string TruncateQuotMarks(std::string str)
truncates the quote marks from string
static std::map< int, const char * > FusCvrStr
spine, up cvr etc.
bool WriteConns(std::ostream &fout, bool bCom=true)
writes connections data
static std::map< int, const char * > WingTypeStr
sections, modules, nacelle
bool ReadFusAirfoil(FILE *t, MS2_FusAirfoil &airfoil, const char *desc, bool bRestrictive)
reads airfoil data used to define fuselage shape
bool WriteWakes(std::ostream &fout, bool bCom=true)
writes extra wake infos
static std::map< int, const char * > FusAirfoilSide
up , down
static std::map< int, const char * > WingDivSourceStr
master, slave
static std::string WakeTypeName(int n)
returns wake info type name
static bool has_section(FILE *t, const char *sec)
check if section exist
static std::map< int, const char * > NacelleRangeStr
swirl range: full, half
static void SetConnectionDefs(MS2_Conn &conn)
sets MS2_Conn object (wings connection)
static std::map< int, const char * > WingSurfSideStr
all, top, bottom
static void SetNacelleWingDefs(MS2_NacelleWing &nac)
sets MS2_NacelleWing object (jet nacelle definition)
bool ReadWingModule(FILE *t, MS2_ModWingModule &mod, bool bRestrictive)
reads Wing Module data (see MS2_ModWingModule)
static std::map< int, const char * > FusCvrTypeStr
ellipse, airfoil etc.
bool ReadProfile(FILE *t, MS2_Profile &airfoil, const char *desc, bool bRestrictive)
reads Profile data structure (see MS2_Profile)
std::string DivTypeName(int div)
returns chordwise division type (name) - see MS2DivType
bool WriteSection(std::ostream &fout, MS2_Section sect)
writes data of wing built from sections
void Clear(void)
clear local variables
bool Write(const char *file)
writes ms2 file
static void ClearFusCurve(MS2_FusCurve &cvr, int elltype)
cleans MS2_FusCurve object (fuselge module)
bool ReadSection(FILE *t, MS2_Section §)
reads Wing Section data (see MS2_Section)
virtual bool ReadWing(FILE *t, MS2_Wing &wing, int iW, bool bRestrictive, bool auto_mod)
reads wing data (see MS2_Wing)
static void ClearNacelleWing(MS2_NacelleWing &nac)
cleans MS2_NacelleWing object (jet nacelle definition)
bool WriteGeneral(std::ostream &f)
writes general data, incuding reference values
This file contains ms2 (geometry info) data structure manipulation.
@ FDT_DATA
coordinates defined by user (FT_FILE) or by parameters (FT_PARAMS)
@ DT_PROFILE
based on airfoil data
@ DT_AUTO
"unknown" in MS2Edit, in SLAVE wing case (see MS2WingDivSource)
@ DT_LINEAR
linear (constant chordwise length)
@ DT_COSINE
constant chordwise angle projection
@ WING_RIB_BOTH
both ribs are present (e.g. in case of slotted flap)
@ WING_RIB_OPEN
no closing ribs (e.g. wing is open and connected with winglets)
@ WING_RIB_EXTERNAL
only external rib (typical situataion external rib on wing tip)
@ WING_RIB_INTERNAL
only internal rib
@ SDT_LINEAR
linear (constant spanwise length)
@ SDT_COSINE_INT
constant spanwise angle projection (0, pi/2)
@ WAKE_H
horizontal (e.g. wing, horzontal tail)
@ WAKE_V
vertical (e.g. vertical stabilizer)
@ OUT_OPT_NODES
mesh written as nodes
@ WING_TYPE_MODULES
wing defined by modules
@ WING_TYPE_SECTIONS
wing defined by sections
@ WING_TYPE_NACELLE
jet engine nacelle
@ AIRFOIL_DATA
airfoil geometry embeded in MS2 file
@ AIRFOIL_NACA
airfoil geometry computed for 4- and 5-digit NACA profiles
@ AIRFOIL_FILE
airfoil geometry defined in the separate file
@ WING_DIV_MASTER
wing enforces fuselage's chord division
@ WING_DIV_INDEPENDENT
wing has its own division and doesn't enforce division to fuselage
@ WING_DIV_SLAVE
fuselage enforces wing's chord division
@ CON_H
horizontal (e.g. T tail)
@ CON_V
vertical (e.g. winglets)
@ WS_TOP
upper surface (up)
@ WS_ALL
both surfaces (up and bottom)
@ WS_BOTTOM
lower surface (bottom)
@ FT_PARAMS
built from parameters
@ SYM_OPT_SYM
symmetrical object
int Type
Type of connection (horizontal, vertical, parallel) - according to MS2ConnType.
int Wing2No
number of 2'nd wing
int Wing2LongTE
number of wing's 2 longeron connected to trailing point of wing 1
int Wing2Rib
number of wing's 2 rib connected to wing 1
int Active
1 - active, 0 - not active
int Wing1Rib
number of wing's 1 rib connected to wing 2
int Wing2LongLE
number of wing's 2 longeron connected to leading point of wing 1
std::string Name
name of particular connection
int Wing2Surf
wing 2 surface for modification (0-bottom, 1-top in horizontal connection or 0-exterior,...
int Wing1No
number of 1'st wing
std::vector< MS2_Wake > Wakes
special info for wake calculation
std::vector< MS2_Wing > Wings
wings data
std::vector< MS2_Profile > Profiles
embedded profiles
MS2_Fuselage Fuselage
fuselage data
std::vector< MS2_Conn > Conns
connections data
MS2_General General
general geometric data
data of airfoil taken to fuselage geometry generating
int Type
curve type ( see MS2FusCvrType )
MS2_SuperEllipse Ellipse
data used when Type is ELLIPSE
double Factor
data used when Type is CONSTANT
MS2_FusAirfoil Airfoil
data used when Type is AIRFOIL
std::string Name
fuselage data (geometry) filename
double X0
x coordinate of nose origin
double Y0
y coordinate of nose origin
double BendLength
bend distance
MS2_FusCurve CvFactUp
ConvexityFactor curve (upper)
double Length
fuselage length
double ScaleX
scale longwise X axis
double ScaleZup
scale longwise Z axis Up
int Ndown
division of bottom part
MS2_FusCurve UpCvr
Z Upper contour line.
double ScaleY
scale longwise Y axis
int Nup
division of top part
std::string Name
fuselage name
double ScaleZdown
scale longwise Z axis Down
double Scale
general scale
MS2_FusCurve CvFactDown
ConvexityFactor curve (lower)
double Z0
z coordinate of nose origin
MS2_FusCurve DownCvr
Z Lower contour line.
double BendAngle
bend angle [deg]
MS2_FusCurve SpineCvr
X contour line.
MS2_FusCurve SideCvr
Y contour line.
int Active
1 - active, 0 - not active
MS2_Fuselage_File File
fuselage from *.f file
int iSecN
number of points that define the section
std::vector< double > UserDiv
user defined divisions
bool Exists
fuselage presence flag
int iDivSectionType
type of section division - see MS2FusSecDivType
MS2_Fuselage_Params Params
fuselage build from parameters
general data for ms2 structure (geometry)
std::string InpFileName
output [*.inp] file name
int AutoInpFileName
(0,1) automatic output file name [.inp] based on ms2 file name
int OutOpt
output type ( see MS2OutOpt )
MS2_Ref RefVal
reference values
int SymmOpt
symmetry ( see MS2SymmOpt )
module used for "module wing" definition
double Y0
y coordinate of origin
int SpanPanConc
paneling distribution concentration( Left, center, right )
double Alfa
twist angle [deg]
int UseMunk
(0,1) Use Munk minimum induced drag theorem
double Z0
z coordinate of origin
int Type
type of module - see MS2WingModuleType
double Gamma
dihedral angle [deg]
double NDist
division dist
double Fi
skew angle [deg]
MS2_Profile Profil
airfoil data
double X0
x coordinate of origin
double XRef
first definition curve's start point location [MAC]
double C
Mean Aerodynamic Chord (MAC)
std::vector< MS2_ModWingModule > Modules
vector (list) of modules used to define wing
data of nacelle type of wing
int SwirlRange
full or half
double Y
Y dimension (semiaxis longwise Y)
double CvFactUp
convexity factor of top part
int SwirlType
swirl direction (external or internal)
double X0
x coordinate of origin
double Z0
z coordinate of origin
double ZUp
Z up dimension (upper semiaxis longwise Z)
int NUp
division of top part - number of wing sections
int NDown
division of bottom part - number of wing sections
double fi
roll rotation angle [deg]
double psi
yaw rotation angles [deg]
double Y0
y coordinate of origin
MS2_Profile Profil
airfoil data
double theta
pitch rotation angle [deg]
double CvFactDown
convexity factor of bottom part
double ZDown
Z down dimension (lower semiaxis longwise Z)
std::vector< double > Xd
X coordinate of lower contour of airfoil.
std::string ShortName
airfoil name without file path
int NACAnumber
code number of NACA - 4 or 5 digits in case iType == AIRFOIL_NACA
std::vector< double > Zd
Z coordinate of lower contour of airfoil.
std::string Name
full name with file path
std::vector< double > Xg
X coordinate of upper contour of airfoil.
std::vector< double > Zg
Z coordinate of upper contour of airfoil.
int iType
type of profile data: 0 - from file, 1 - NACA 4 or 5 digits airfoil, 2 - data embedded in MS2 file
double MAC
Mean Aerodynamic Chord.
double MX
X coordinate of reference point for moment calculation.
double Scale
scale of geometry (default Scale=1)
double MZ
Z coordinate of reference point for moment calculation.
bool AutoComp
compute reference parameters automatically (flag)
double S
reference (main wing) area
std::vector< MS2_Section > Sections
wing sections set
int DivType
type of spanwise division - see MS2SpanDivType
definition of section (used in "Section Wing")
double Deflection
control surface deflection [deg] (+ down deflection)
bool CtrlFlag
control surface flag: 1 - present, 0 - does not exist
double Hinge_X
hinge X position
double Z
Z coordinate of origin [m].
double Hinge_Z
hinge Z position
double Y
Y coordinate of origin [m].
double X
X coordinate of origin [m].
double RotZ
rotation angle along Z axis [deg]
MS2_Profile Profil
airfoil data
double RotX
rotation angle along X axis [deg]
double RotY
rotation angle along Y axis [deg]
bool CoefPosFlag
position definition flag (see MS2ControlSurfaceDef)
data for module of super ellipse type
int NF
division number front
double CvFactR
convexity factor rear
int EllType
Ellipse type - ( spine ellipse or normal ellipse )
int NR
division number rear
double CvFactF
convexity factor front
int Wing2No
number of 2'nd wing
std::string Name
name of particular wake information
int Wing1Rib
number of wing's 1 rib connected to wing 2 by wake line
int Wing2Rib
number of wing's 2 rib which modifies wake line
int Wing1No
number of 1'st wing (INDEPENDENT)
int Wing2Surf
wing 2 surface for wake modification (0-bottom, 1-top in case of vertical wake or 0-exterior,...
int Active
1 - active, 0 - not active
int Type
type of wake plane WAKE_H (horizontal) or WAKE_V (vertical)
MS2_SecWing Sec
Section wing definition.
double TwistRef
twist reference point (0...1)
int Type
type of the wing ( see MS2WingType )
int RibType
see MS2WingRibType
int DivSource
1 - master, 0 - slave, -1 - independent (
std::vector< double > UserDiv
user defined chord division
int SurfType
wing surface to create ( see MS2WingSurf )
int ComputeInt
1 - compute fuselage-wing intersection, 0 - wing is glued to the fuselage
int Active
1 - active, 0 - not active
MS2_ModWing Mod
Module wing definition.
int DivNo
number of chord division points
int UseMunk
(0,1) Use Munk minimum induced drag theorem
int LongeronNo
fuselage longeron No which will be connected with wing's leading edge
double SRef
reference area for min induced drag calculation
MS2_NacelleWing Nac
Nacelle definition.
int DivType
chord division type
int BypassDepth
max. depth of bypassing - number of longerons to be deflected
int SmartBypass
smart deflection of longerons to bypass the wing (0 - no, 1 - yes, modifies the section points)
std::string Name
name of wing
double CzDes
design lift force coefficient