20#include "panukl_prs.h" 
   22PRS_FILE::PRS_FILE( 
void ){ 
Clean(); }
 
   24PRS_FILE::~PRS_FILE( 
void ){}
 
   60    File = 
fopen( FileName, 
"r" );
 
   63        fprintf( stderr, 
"[.PRS] file open error to reading (%s)\n", FileName );
 
 
  110    File = 
fopen( FileName, 
"w" );
 
  113        fprintf( stderr, 
"[.PRS] file open error to writing (%s)\n", FileName );
 
  117    fprintf( File, 
"#   Press program configuration file\n");
 
  118    fprintf( File, 
"%s  # input data file [.PAN]\n", 
PAN_file );
 
  119    fprintf( File, 
"%3d     # downwash calculation flag\n", 
iEps );
 
  120    fprintf( File, 
"%3d     # induced drag calculation flag\n", 
iInd );
 
  121    fprintf( File, 
"%d %d       # range of panel's indices for downwash calculation\n", 
iNXY_Eps, 
iNZ_Eps );
 
  122    fprintf( File, 
"%6.2f       # X coordinate of downwash plane\n", 
dXEps );
 
  123    fprintf( File, 
"%6.2f %6.2f # Y (X) boundary coordinates for downwash calculation\n", 
dYX1_Eps, 
dYX2_Eps );
 
  124    fprintf( File, 
"%6.2f %6.2f # Z boundary coordinates for downwash calculation\n", 
dZ1_Eps, 
dZ2_Eps );
 
  125    fprintf( File, 
"%d %d       # range of panel's indices for pressure calculation\n", 
iNum1, 
iNum2 );
 
  126    fprintf( File, 
"%3d     # number of differentiation method\n", 
iMeth );
 
  127    fprintf( File, 
"%3d     # averaging flag\n", 
iAngle );
 
  128    fprintf( File, 
"%6.2f %6.2f # range of X coordinates for pressure calculation\n", 
dXNum1, 
dXNum2 ); 
 
  129    fprintf( File, 
"%6.2f       # Mach number for correction\n", 
dMach );
 
  130    fprintf( File, 
"%3d     # compressibility correction flag (0-none, 1-PG, 2-KT)\n", 
iMach );
 
  131    fprintf( File, 
"%3d     # X component of pressure in pitching moment\n", 
iPitchX );
 
  132    fprintf( File, 
"%3d     # output files names flag (0-automatic, 1-user defined)\n", 
iOutFiles );
 
  135        fprintf( File, 
"%s  # output file - pressure distribution [.txt] and other results\n", 
TXT_file );
 
  136        fprintf( File, 
"%s  # output file - aerodynamic forces and moments coefficients & other global results [.out]\n", 
OUT_file );
 
  137        fprintf( File, 
"%s  # output file - wingspan loads distribution [.czy]\n", 
CZY_file );
 
  138        fprintf( File, 
"%s  # output file - contour of cross section [.bln]\n", 
BLN_file );
 
  139        fprintf( File, 
"%s  # output file - velocity and downwash distribution [.eps]\n", 
EPS_file );
 
  140        fprintf( File, 
"%s  # output file - the same as [.out] in SDSA format [.sdsa]\n", 
SDS_file );
 
 
  152        strcpy( cFile, cRob );
 
 
  160    strcpy( cRob, OUTdir );
 
 
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 const char * filename_name(const char *name)
Returns pointer to filename without path.
 
static char * filename_setext(char *buf, int buflen, const char *ext)
set/change filename extension
 
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.
 
void Clean(void)
cleans local variables
 
char SDS_file[256]
output file - the same as [.out] in SDSA format [.sdsa]
 
int iNXY_Eps
number of mesh nodes for velocity field calculation longwise X (iEps=2) or Y (iEps=1) axis
 
int iPitchX
flag to take X component of forces for pitching moment calculation(0/1)
 
double dYX1_Eps
Y coordinate of left bound (or X in case iEps=2) of plane where velocity field is calculated.
 
double dYX2_Eps
Y coordinate of right bound (or X in case iEps=2) of plane where velocity field is calculated.
 
int iMach
compressibility flag (0-none, 1-Prandtl-Galuert, 2-Karman-Tsien) - not active in case compressibility...
 
int iAngle
averaging flag (0/1)
 
int iInd
calculation of induced drag - flag (0,1)
 
double dZ1_Eps
Z coordinate of lower bound of plane where velocity field is calculated.
 
int iMeth
number of differentiation method (see PANUKL manual)
 
char CZY_file[256]
output file - spanwise loads distribution [.czy]
 
int iEps
calculation of velocity and downwash distribution - flag (0-none,1-YZ plane,2-XZ plane)
 
double dZ2_Eps
Z coordinate of upper bound of plane where velocity field is calculated.
 
double dXNum2
upper bound of range of X coordinate taken for global coefficients calculation
 
double dXEps
X coordinate (or Y coordinate in case iEps=2) of plane where velocity field is calculated.
 
char PAN_file[256]
input file - doublet distribution file [.PAN]
 
int iNum2
number of the last panel taken for global coefficients calculation
 
double dMach
Mach number to take into account compressibility effect - not active in case compressibility was set ...
 
char PRS_file[256]
name of current [.prs] file
 
int iNum1
number of the first panel taken for global coefficients calculation
 
char TXT_file[256]
output file - pressure distribution [.txt] and other results
 
int iOutFiles
flag to control output files names: 0 - automatic names derived from PRS_file, 1 - set by user
 
char DAT_file[256]
input file - mesh + wake data file [.DAT]
 
double dXNum1
lower bound of range of X coordinate taken for global coefficients calculation
 
char EPS_file[256]
output file - velocity and downwash distribution [.eps]
 
void DefNames(char *OUTdir)
set default names of output files
 
int WritePRS(const char *Filename)
writes the [.prs] file
 
int iNZ_Eps
number of mesh nodes for velocity field calculation longwise Z
 
void DefFile(char *cRob, char *cFile, const char *cExt)
set default name if it is empty
 
int ReadPRS(const char *FileName)
reads the [.prs] file
 
char OUT_file[256]
output file - aerodynamic forces and moments coefficients & other global results [....
 
char BLN_file[256]
output file - contour of cross section [.bln]