21#include "panukl_plr.h"
23PANUKL_PLR::PANUKL_PLR(
void ){
Clean(); }
25PANUKL_PLR::~PANUKL_PLR(
void ){}
49 File =
fopen( PolarFile,
"r" );
52 fprintf( stderr,
"[.PLR] file open error to reading (%s)\n", PolarFile );
91 File =
fopen( PolarFile,
"w" );
94 fprintf( stderr,
"[.PLR] file open error to writing (%s)\n", PolarFile );
98 fprintf( File,
"# Panukl -> POLAR configuration file\n");
99 fprintf( File,
"%s # POLAR output directory\n",
POLAR_dir );
100 fprintf( File,
"%s # data (grid+wake) file [.dat] for A/C configuration\n",
DAT_file );
101 fprintf( File,
"%s # output polar file [.TXT]\n",
OUT_file );
103 fprintf( File,
"%7.3f %7.3f %7.3f # Alfa0, Alfa1, dA - angle of attack sequence [deg]\n",
dAlfa0,
dAlfak,
dAlf );
104 fprintf( File,
"%7.3f # Mach number \n",
dMa );
106 fprintf( File,
"%3d # type of linear system solver (1-LAPACK OPTIMIZED, 0-NOT OPTIMIZED)\n",
iProc );
108 fprintf( File,
"%d %d # range of panel's indices for pressure calculation\n",
iNum1,
iNum2 );
109 fprintf( File,
"%3d # number of differentiation method\n",
iMeth );
110 fprintf( File,
"%3d # averaging flag\n",
iAngle );
111 fprintf( File,
"%6.2f %6.2f # range of X coordinates for pressure calculation\n",
dXNum1,
dXNum2 );
112 fprintf( File,
"%3d # compressibility flag (0-none, 1-PG, 2-KT, 3-direct)\n",
iCompress );
113 fprintf( File,
"%3d # X component of pressure in pitching moment\n",
iPitchX );
115 fprintf( File,
"%10.6f # Cfe - equivalent parasite drag\n",
dCfe );
117 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.
double dXNum2
upper bound of range of X coordinate taken for global coefficients calculation
int Read(char *PolarFile)
reads the [.plr] file
char POLAR_dir[256]
path name for output - aerodynamic data files to create POLAR
int iProc
current number of CPUs (cores) - set by program
char DAT_file[256]
data (grid+wake) file [.DAT] for A/C configuration
double dAlf
step of angle of attack [deg]
int iAngle
averaging flag (0/1)
void Clean()
cleans local variables
int iPitchX
flag to take X component of forces for pitching moment calculation(0/1)
int iMeth
number of differentiation method (see PANUKL manual)
double dXNum1
lower bound of range of X coordinate taken for global coefficients calculation
int iNum2
number of the last panel taken for global coefficients calculation
double dCfe
parasite drag coefficient
int iCompress
compressibility flag (0-none, 1-Prandtl-Galuert, 2-Karman-Tsien, 3-direct)
double dAlfa0
left (lower) bound of angle of attack [deg]
double dAlfak
right (upper) bound of angle of attack [deg]
int iMaxProc
max number of parallel process (shouldn't be greater than real number of CPUs (cores)
char OUT_file[256]
output polar file [.TXT]
int Write(char *PolarFile)
writes the [.plr] file
int iNum1
number of the first panel taken for global coefficients calculation