116void GRID_ARRAYS::DeleteINP(
void )
145 for(
int i=0;
i<
iN;
i++)
204 for(
int i=0;
i<
iN;
i++ )
227 char cRob[256], cc[10];
259 for(
int i=0;
i<3;
i++ )
iKw[
i] = 0;
264 for(
int i=0;
i<
iKw[
k ];
i++ )
280 fscanf( File,
" %d %lf %lf %lf %lf %lf %lf",
290 for(
int j=0;
j<4;
j++ )
291 for(
int k=0;
k<3;
k++ )
304 fscanf( File,
" %d %d %lf %lf %lf %lf %lf %lf",
350 fprintf( File,
" %5d %10.4f %10.4f %10.4f %10.4f %10.4f %10.4f\n",
368 for(
int i=0;
i<
iKw[
k ];
i++ )
396 fprintf( File,
" %5d %5d %10.4f %10.4f %10.4f %10.4f %10.4f %10.4f\n",
421 for(
int i=0;
i<
iKw[
k ];
i++ )
457 &
rob.SurfType, &
rob.RibNr, &
rob.iClosingRib, &
rob.DivNo, &
rob.DivType );
472 if(
f.eof() ||
iNobj <= 0 )
return 0;
510 fprintf( File,
"%5d %5d %5d %5d %5d %5d %5d %5d %5d %s\n",
516void GRID_ARRAYS::DeleteDAT(
void )
544 fscanf( File,
" %d %d %d %lf %lf %lf %lf %lf",
549 sscanf(
cRob,
" %d %d %d %lf %lf %lf %lf %lf",
565 for(
int i=0;
i<
iN;
i++ )
568 for(
int j=0;
j<4;
j++ )
569 for(
int k=0;
k<3;
k++ )
580 for(
int j=0;
j<4;
j++ )
581 for(
int k=0;
k<3;
k++ )
585 for(
int i=0;
i<
iN;
i++ )
607 else if(
iProg == 2 )
615void GRID_ARRAYS::DeleteDATw(
void )
646 fscanf( File,
" %d %d %d %lf %lf %lf %lf %lf",
650 sscanf(
cRob,
" %d %d %d %lf %lf %lf %lf %lf",
662 for(
int j=0;
j<4;
j++ )
663 for(
int k=0;
k<3;
k++ )
674 for(
int j=0;
j<4;
j++ )
675 for(
int k=0;
k<3;
k++ )
716 fprintf( File,
" %5d %5d %5d %10.4f %10.4f %10.4f %10.4f %10.4f\n",
722 for(
int j=0;
j<4;
j++ )
723 for(
int k=0;
k<3;
k++ )
734 for(
int j=0;
j<4;
j++ )
735 for(
int k=0;
k<3;
k++ )
770 if(
f ==
NULL )
return( -1 );
791 for(
int i=0;
i<
NN;
i++ )
799 for(
int j=0;
j<23;
j++ )
801 if(
iss.good() )
iM =
j+1;
827 for(
int i=0;
i<
iN;
i++ )
829 for(
int j=0;
j<4;
j++ )
838 double dRob =
v.Len();
889 for(
int j=0;
j<4;
j++ )
903 double dRob =
v.Len();
938 fprintf(
f,
"No doublet source vxd vyd vzd qx qy qz v^2 cp x y z Ma cp1 cp2 cp3 cp4 cpw1 cpw2 cpw3 cpw4 ss\n");
939 for(
int i=0;
i<
iN;
i++ )
942 for(
int j=0;
j<23;
j++ )
int ReadIN1(FILE *File)
reads [.inp] data from stream FILE - data written as panels
void InitCommon(void)
initialization of commonly used arrays
double * dSs_cpr0
strip wetted area
int ReadINP(char *FileName)
reads [.inp] file from pathname FileName
int WriteDAT(char *FileName)
writes [.dat] file to pathname FileName
double * dRhs
right hand side vector input - result on output (Nww2)
double * dCzi
strip lift coeffcient
double dZca25
z coordinate of reference point for moment calculation (usually 0.25 MAC)
int WriteInpFromPanels(char *FileName, int iScale=0)
writes [.inp] file to pathname FileName - data stored in panels
double * dSig
source (singularity) value
int iMaxPanelNumber
number of body (airplane) panels
int iLiczw
number of wake strips
int * iNnww
array containing upper surface panels neighbouring with the wake iNnww[i,j] i - strip number j=1...
int iLiczp
number of wake panels
double * dCyr
"y" force coefficient acting on the strip
double dCa
mean aerodynamic chord (MAC)
void WriteObjs(FILE *f)
Writes objects.
void Points2Panels(void)
converts nodes (std::vector<VECTOR_3D>) to panels (std::vector<PANEL>)
int WriteInpFromPoints(char *FileName, int iScale=0)
writes [.inp] file to pathname FileName - data stored in nodes
int ReadObjs(FILE *f)
Reads objects.
double * dQz
tangential undisturbed velocity - z coordinate
double * dCpp
pressure coefficient
void Corner2Points(int *iD, VECTOR_3D *P)
assigns panel corner P to node number iD
int * iNeigh
neighbours numbers array (Nww2,8)
double * dX
main grid (+ wake for Panukl) X[i,j,k], i=panel number, j=corner number, k=coordinate number
double * dCpr
normal force coefficient acting on the strip
double * dXw
wake grid (Xw[i,j,k])
double * dMach
lacal panel Mach number
double * dVv2
square of total velocity on the panel
double * dSss
panels areas
~GRID_ARRAYS(void)
destructor
double * dCzr
"z" force coefficient acting on the strip
int iNww
= iN + iLiczp; # airplane + wake (up)
double * dVyd
"y" component of induced velocity (from doublet distribution)
int * iKw
info about side body wake neighbours iKw[i,j] i - side body-wake neighbour number,...
char File_DAT_date[100]
date and time of mesh with wake file
int * iNkw
numbers of panels in Xkw (wake grid)
double dXca25
x coordinate of reference point for moment calculation (usually 0.25 MAC)
void Panels2Points(void)
converts panels (std::vector<PANEL>) to nodes (std::vector<VECTOR_3D>)
double * dAi
coefficient array (N x Nww)
double * dCxi
induced drag coeffcient (from strip)
char File_INP_date[100]
date and time of mesh file
int iNww2
= iNww + iLiczw; # airplane + wake (up) + wake (down 1 panel/strip)
std::vector< MS2_OBJ > Objs
Objects (MS2_OBJ) vector.
int ReadDATw(char *FileName)
reads [.dat] file from pathname FileName - body and wake panels stored in separated arrays (for visua...
int WriteWyn(char *FileName)
writes results array to pathname FileName
int ReadWyn(char *FileName)
reads results array from pathname FileName
double dWsp_sk
scale factor (default: 1)
char TXTfile[256]
pathname of [.txt] file
void InitForPress(void)
initialization of arrays used by Press program
int * iNpas
number of panels in the wake strip [liczw]
void DeleteWyn(void)
erases results objects
int iMaxWakesNumber
maximum of numbers of wake strips
void Array2Panels(void)
converts array (double X[i,j,k]) to panels (std::vector<PANEL>)
std::vector< PANEL > Panels
panels array
double * dVzd
"z" component of induced velocity (from doublet distribution)
double * dQy
tangential undisturbed velocity - y coordinate
void InitRob(void)
initialization of scratch arrays
double * dXkw
side body-wake neighbours (panels)
std::vector< VECTOR_3D > Points
nodes array
int iMaxBodyNeighbours
number of side body-wake neighbours
void Panels2Array(void)
converts panels (std::vector<PANEL>) to array (double X[i,j,k])
double * dSs_rzut
projection areas of panels on plane xy
double * dVxd
"x" component of induced velocity (from doublet distribution)
float fVer
version number of data file [.inp] format: from data file on input, defined in VERSION on output
double * dRh
working area (N)
int iNw
= iN + iLiczw; # airplane + wake (up) (1 panel/strip)
int iNw2
= iNw + iLiczw; # airplane + wake (up+down) (1 panel/strip)
int iMaxWakePanelNumber
maximum number of panels in wake strip
int * iIpas
wake panels numbers in the strip [liczw, MaxWakePanelNumber]
double * dVVVV
undisturbed velocity
int ReadDAT(char *FileName, int iProg)
reads [.dat] file from pathname FileName - body and wake panels stored in dX array iProg: 1 initial...
void SupWyn(void)
computes data for sides centers
double * dCxr
"z" force coefficient acting on the strip
int iNwyn
current number of rows of pdWyniki array
double * pdWyniki[23]
results array - 22 variables x number of panels
double * dQx
tangential undisturbed velocity - x coordinate
double * dCmr
twisting moment coefficient acting on the strip
void InitForPanukl(void)
initialization of arrays used by PANUKL (main program)
double * dSs_cpr
strip area
int iMwyn
current number of columns of pdWyniki array (<=22)
GRID_ARRAYS(void)
default constructor
char File_TXT_date[100]
date and time of results file
int ReadIN2(FILE *File)
reads [.inp] data from stream FILE - data written as nodes
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_date(const char *name)
Returns pointer to the string that contains the date of last file modification/creation.
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 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.
A class for manipulating the rectangular panel.
VECTOR_3D P1
the coordinates of the 1st corner of the panel
Vector 3D class - vector manipulation.
#define DELETE_TAB(OBJ)
Macro for safe deleteing the array and sets the pointer to zero.
#define NEW_TAB(Var, Typ, Len)
Macro for initializing array with zeros.
This file contains class for PANUKL input and output files manipulation.
#define VERSION
VERSION of the data file [.inp] format currently is equal to 4.00
#define MaxWakesNumber
limit of numbers of wake strips
#define MaxWakePanelNumber
limit of numbers of panels in wake strip
structure that contains data of main airplane objects (wings, fuselage)
int n1
the first panel number in the object