CONFIG LIB 1.5
Configuration Files Library (by TGG 2020)
Loading...
Searching...
No Matches
panukl_struct.h
Go to the documentation of this file.
1/*********************************************************************/
2/* */
3/* Config files library - (C) TGG 2018 */
4/* */
5/*********************************************************************/
6/* Warszawa, 2018 */
7/*********************************************************************/
8/* */
9/* File: panukl_struct.h */
10/* */
11/* Author: T.Grabowski */
12/* */
13/* Contents - structures definitions */
14/* */
15/* */
16/*********************************************************************/
17/* */
18/* */
19
24#ifndef _PANUKL_STRUCT_H_
25#define _PANUKL_STRUCT_H_
26
27#include <string>
28#include <vector>
29#include <cstdio>
30
31#include <errno.h>
32
33#include "iofun.h"
34#include "memfun.h"
35#include "panel.h"
36
37#define MaxWakePanelNumber 1000
38#define MaxWakesNumber 1000
39
41
42struct MS2_OBJ
43{
44 std::string Name;
45 std::string NameID;
46 int n1;
47 int n2;
48 int iActive;
50
51 int ID;
52 int iType;
53
55 int RibNr;
56 int DivNo;
57 int DivType;
58};
59
60#define VERSION 4.00
61
63
64class GRID_ARRAYS : public MEMFUN, IOFUN
65{
66 public:
67
68 GRID_ARRAYS( void );
69 ~GRID_ARRAYS( void );
70
71 float fVer;
72 double dWsp_sk;
73
75 double dSS;
76 double dCa;
77 double dBs;
78 double dXca25;
79 double dZca25;
81
88
90 double *dX;
91 double *dXw;
92 double *dXkw;
93
94 std::vector<PANEL> Panels;
95 std::vector<VECTOR_3D> Points;
96 std::vector<MS2_OBJ> Objs;
98
100 int iLiczp;
101 int iLiczw;
102
103 int *iNkw;
104 int *iKw;
105
106 int *iNeigh;
107 int *iNnww;
113 int *iNpas;
114 int *iIpas;
116
118 int iN;
119 int iNp;
120
121 int iNw;
122 int iNw2;
123 int iNww;
124 int iNww2;
125
126 double *dAi;
127 double *dRhs;
128 double *dRh;
129 int *IPIV;
130 int iSym;
132
134 double *dXp;
135 double *dYp;
136 double *dZp;
138
140 double *dX0;
141 double *dY0;
142 double *dZ0;
144
146 double *dAlf1;
147 double *dAlf2;
148 double *dAlf3;
149
150 double *dBet1;
151 double *dBet2;
152 double *dBet3;
153
154 double *dGam1;
155 double *dGam2;
156 double *dGam3;
158
160 double *dQx;
161 double *dQy;
162 double *dQz;
163 double *dSig;
164
165 double *dVxd;
166 double *dVyd;
167 double *dVzd;
168
169 double *dVVVV;
170 double *dCpp;
171 double *dCxi;
172 double *dCzi;
173 double *dVv2;
174 double *dMach;
175
176 double *dSss;
177 double *dSs_rzut;
178 double *dSs_cpr;
179 double *dSs_cpr0;
180
181 double *dZzz;
182 double *dObr;
183 double *dCpb;
184 double *dCpr;
185 double *dCmr;
186 double *dCay;
187 double *dCzr;
188 double *dCyr;
189 double *dCxr;
191
193 int ReadINP( char *FileName );
194 int ReadIN1( FILE *File );
195 int ReadIN2( FILE *File );
196 int ReadDAT( char *FileName, int iProg );
197 int ReadDATw( char *FileName );
198
199 int WriteInpFromPanels( char *FileName, int iScale = 0 );
200 int WriteInpFromPoints( char *FileName, int iScale = 0 );
201 int WriteDAT( char *FileName );
202
203 void Panels2Points( void );
204 void Points2Panels( void );
205 void Corner2Points( int *iD, VECTOR_3D *P );
206
207 void Panels2Array( void );
208 void Array2Panels( void );
209
210 int ReadObjs( FILE *f );
211 void WriteObjs( FILE *f );
213
221 static int ReadObjs( FILE *f, std::vector<MS2_OBJ> &Objs, int N1=0, float fVer=VERSION );
229 static int ReadObjs( std::ifstream &f, std::vector<MS2_OBJ> &Objs, int N1=0, float fVer=VERSION );
235 static void WriteObjs( FILE *f, std::vector<MS2_OBJ> &Objs );
236
238 void InitRob( void );
239 void InitCommon( void );
240 void InitForPanukl( void );
241 void InitForPress( void );
243
245 void DeleteINP( void );
246 void DeleteDAT( void );
247 void DeleteDATw( void );
249
251 char File_DAT_date[100];
252 char File_INP_date[100];
253 char File_TXT_date[100];
255
257 double* pdWyniki[23];
258 int iNwyn;
259 int iMwyn;
260
261 char TXTfile[256];
262
263 int ReadWyn( char *FileName );
264 void SupWyn( void );
265 void DeleteWyn( void );
266 int WriteWyn( char *FileName );
268};
269
270#endif /*_PANUKL_STRUCT_H_*/
271
main class for PANUKL input and output files manipulation
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 * dCay
strip chord
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 iN
= iMaxPanelNumber;
static int ReadObjs(std::ifstream &f, std::vector< MS2_OBJ > &Objs, int N1=0, float fVer=VERSION)
Reads objects from stream (ifstream object) f, with offset by N1 panels.
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 dSS
reference area
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
static int ReadObjs(FILE *f, std::vector< MS2_OBJ > &Objs, int N1=0, float fVer=VERSION)
Reads objects from stream (FILE) f, with offset by N1 panels.
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
double dBs
wingspan
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
int iSym
symmetry flag
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...
int iNp
Number of nodes;.
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
int * IPIV
pivot table
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
Simple I/O functions class.
Definition iofun.h:42
class with overloaded "new" operator initializing object with zeros
Definition memfun.h:34
Vector 3D class - vector manipulation.
Definition vector3d.h:34
This file contains some smart I/O functions.
This file contains some smart functions, operators, macros for safe initializing end erasing the memo...
This file contains declaration of PANEL class.
#define VERSION
VERSION of the data file [.inp] format currently is equal to 4.00
structure that contains data of main airplane objects (wings, fuselage)
std::string Name
name of the object (e.g. "main wing")
std::string NameID
nameID - global object name
int n2
the last panel number in the object
int n1
the first panel number in the object
int ID
global number of the object (e.g. several subobjects with the same ID make up one gobal object)
int iActive
a flag - if the object is active mesh is created
int RibNr
number of ribs
int iType
typw of the object (0 - wing, 1 - fuselage)
int DivNo
number of chord division points
int DivType
chord division type ( see MS2DivType )
int SurfType
wing surface to create ( see MS2WingSurf : WS_ALL = 0, WS_TOP = 1, WS_BOTTOM = 2 )
int iClosingRib
closing rib flag - see MS2WingRibType