20#include "panukl_prj.h"
22PANUKL_PRJ::PANUKL_PRJ(
void ){
Clean(); }
24PANUKL_PRJ::~PANUKL_PRJ(
void ){}
55 File =
fopen( PrjFile,
"r" );
58 fprintf( stderr,
"[.PRJ] file open error to reading (%s)\n", PrjFile );
107 File =
fopen( PrjFile,
"w" );
110 fprintf( stderr,
"[.PRJ] file open error to writing (%s)\n", PrjFile );
114 fprintf( File,
"# Panukl -> SDSA configuration file\n");
115 fprintf( File,
"%s # SDSA project directory\n",
SDSA_dir );
116 fprintf( File,
"%s # clean configuration data file [.dat] (grid with wake)\n",
DAT_file );
117 fprintf( File,
"%s # Elevator deflected configuration data file [.dat] (grid with wake)\n",
DAT_file1 );
118 fprintf( File,
"%s # Aileron deflected configuration data file [.dat] (grid with wake)\n",
DAT_file2 );
119 fprintf( File,
"%s # Rudder deflected configuration data file [.dat] (grid with wake)\n",
DAT_file3 );
120 fprintf( File,
"%d %d %d # deflected configuration flags\n",
iH,
iL,
iV );
121 fprintf( File,
"%f %f %f # control surfaces deflection\n",
dH,
dL,
dV );
123 fprintf( File,
"%7.3f %7.3f %7.3f # Alfa0, Alfa1, dA - angle of attack sequence [deg]\n",
dAlfa0,
dAlfak,
dAlf );
124 fprintf( File,
"%7.3f %7.3f %7.3f # Mach0, Mach1, dM - Mach number sequence \n",
dMa0,
dMak,
dMa );
125 fprintf( File,
"%7.3f # beta - sideslip angle [deg]\n",
dBeta );
126 fprintf( File,
"%6.2f # P - roll rate [rad/s]\n",
dP );
127 fprintf( File,
"%6.2f # Q - pitch rate [rad/s]\n",
dQ );
128 fprintf( File,
"%6.2f # R - yaw rate [rad/s]\n",
dR );
129 fprintf( File,
"%3d # type of linear system solver (1-LAPACK OPTIMIZED, 0-NOT OPTIMIZED)\n",
iProc );
131 fprintf( File,
"%d %d # range of panel's indices for pressure calculation\n",
iNum1,
iNum2 );
132 fprintf( File,
"%3d # number of differentiation method\n",
iMeth );
133 fprintf( File,
"%3d # averaging flag\n",
iAngle );
134 fprintf( File,
"%6.2f %6.2f # range of X coordinates for pressure calculation\n",
dXNum1,
dXNum2 );
135 fprintf( File,
"%3d # compressibility flag (0-none, 1-PG, 2-KT, 3-direct)\n",
iCompress );
136 fprintf( File,
"%3d # X component of pressure in pitching moment\n",
iPitchX );
138 fprintf( File,
"%10.6f # Cfe - equivalent parasite drag\n",
dCfe );
139 fprintf( File,
"%10.3f # AoA max - estimated max. angle of attack [deg]\n",
dAoA_max );
141 fprintf( File,
"%3d # max number of parallel process\n",
iMaxProc );
static FILE * fopen(const char *filename, const char *mode)
Cross-platform function to fopen function that supports UTF-8 encoded name.
static void ClipFileName(char *string)
Clipping of the ending blanc characters of "string".
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.
int iNum2
number of the last panel taken for global coefficients calculation
double dAlfa0
left (lower) bound of angle of attack [deg]
double dV
rudder deflection corresponding to mesh from DAT_file3 [deg]
char SDSA_dir[256]
path name for output - aerodynamic data files set for SDSA
char DAT_file1[256]
data (mesh+wake) file [.DAT] elevator deflected
int iCompress
compressibility flag (0-none, 1-Prandtl-Galuert, 2-Karman-Tsien, 3-direct)
double dAlf
step of angle of attack [deg]
char DAT_file3[256]
data (mesh+wake) file [.DAT] rudder deflected
int iMaxProc
max number of parallel process (shouldn't be greater than real number of CPUs (cores)
double dH
elevator deflection corresponding to mesh from DAT_file1 [deg]
int iPitchX
flag to take X component of forces for pitching moment calculation(0/1)
int iH
flag to compute configuration with elevator deflected (0/1)
double dBeta
sideslip angle [deg]
double dMak
right (upper) bound of Mach number range
double dL
aileron deflection corresponding to mesh from DAT_file2 [deg]
double dXNum2
upper bound of range of X coordinate taken for global coefficients calculation
int iProc
current number of CPUs (cores) - set by program
double dP
roll rate [rad/s]
int iMeth
number of differentiation method (see PANUKL manual)
double dR
yaw rate [rad/s]
double dAlfak
right (upper) bound of angle of attack [deg]
double dMa0
left (lower) bound of Mach number range
void Clean()
cleans local variables
char DAT_file2[256]
data (mesh+wake) file [.DAT] aileron deflected
int iV
flag to compute configuration with rudder deflected (0/1)
int Write(char *PrjFile)
writes the [.prj] file
double dAoA_max
max. value of angle of attack [deg]
char DAT_file[256]
data (mesh+wake) file [.DAT] for basic configuration
double dCfe
parasite drag coefficient
double dMa
step of Mach number
double dXNum1
lower bound of range of X coordinate taken for global coefficients calculation
int iAngle
averaging flag (0/1)
int iL
flag to compute configuration with aileron deflected (0/1)
int iNum1
number of the first panel taken for global coefficients calculation
int Read(char *PrjFile)
reads the [.prj] file
double dQ
pitch rate [rad/s]