CONFIG LIB 1.5
Configuration Files Library (by TGG 2020)
Loading...
Searching...
No Matches
NACA_PROFILE Class Reference

NACA_PROFILE class to generate 4-digit and 5-digit naca airfoils

Created by Alexandre Naaman (hoser.nosp@m.@ste.nosp@m.p.pol.nosp@m.ymtl.nosp@m..ca) 30-08-1995
Code clean-up, modifications to include more 5-digit sections:
Shamim Mohamed (shami.nosp@m.m@sy.nosp@m.nopsy.nosp@m.s.co.nosp@m.m) 8-09-1995
corrected & modified to encapsulate into C++ class
by Tomasz Grabowski (tgrab.nosp@m.@mei.nosp@m.l.pw..nosp@m.edu..nosp@m.pl) Jan.2012
included to PanuklConfigLib 20.11.2020. More...

#include <naca.h>

Inheritance diagram for NACA_PROFILE:
MEMFUN

Public Member Functions

int generate_naca (char *name, int num, FILE *fp)
 generates naca airfoil coordinates (NN points) and stores it in file defined by stream "fp"
 
int generate_naca (char *file_name, char *cNACA)
 generates naca airfoil coordinates (NN points) and stores it in file "file_name"
 
int generate_naca (char *cNACA, int NN=100)
 generates naca airfoil coordinates (NN points) and stores it in vectores X and Z
 
void setTE0 (int TE=1)
 TE=1 forces the zero thickness trailing edge.
 

Public Attributes

double * X
 x coordinates vector
 
double * Z
 z coordinates vecotr
 
int N
 coordiantes vectors' size
 

Additional Inherited Members

- Static Public Member Functions inherited from MEMFUN
static void * operator new (size_t st, const char *text="(unknown)", int ierr_print=1)
 Overloaded "new" operator initializing object with zeros.
 

Detailed Description

NACA_PROFILE class to generate 4-digit and 5-digit naca airfoils

Created by Alexandre Naaman (hoser.nosp@m.@ste.nosp@m.p.pol.nosp@m.ymtl.nosp@m..ca) 30-08-1995
Code clean-up, modifications to include more 5-digit sections:
Shamim Mohamed (shami.nosp@m.m@sy.nosp@m.nopsy.nosp@m.s.co.nosp@m.m) 8-09-1995
corrected & modified to encapsulate into C++ class
by Tomasz Grabowski (tgrab.nosp@m.@mei.nosp@m.l.pw..nosp@m.edu..nosp@m.pl) Jan.2012
included to PanuklConfigLib 20.11.2020.

Definition at line 68 of file naca.h.

Constructor & Destructor Documentation

◆ NACA_PROFILE()

NACA_PROFILE::NACA_PROFILE ( void )
inline

Definition at line 101 of file naca.h.

101{ X=Z=0; };
double * Z
z coordinates vecotr
Definition naca.h:111
double * X
x coordinates vector
Definition naca.h:110

◆ ~NACA_PROFILE()

NACA_PROFILE::~NACA_PROFILE ( void )

Definition at line 348 of file naca.cpp.

349{
350 ClearTabs();
351}

Member Function Documentation

◆ generate_naca() [1/3]

int NACA_PROFILE::generate_naca ( char * cNACA,
int NN = 100 )

generates naca airfoil coordinates (NN points) and stores it in vectores X and Z

Definition at line 268 of file naca.cpp.

269{
270 N = 2*NN - 1; // must be odd
271 CreateTabs( N );
272
273 char *cname;
274
275 if(!(cname = check_name(cNACA)))
276 {
277 fprintf(stderr, "%s is not a valid NACA section name.\n", cNACA );
278 return -1;
279 }
280 else
281 {
282 fprintf( stderr, "NACA %s - cname %s\n", cNACA, cname );
283 }
284
285 iWrite = 0;
286 iLicz = 0;
287
288 get_params(&data, cname);
289
290 draw_surface(NN, &data, stderr);
291
292 return 0;
293}
int N
coordiantes vectors' size
Definition naca.h:112

◆ generate_naca() [2/3]

int NACA_PROFILE::generate_naca ( char * file_name,
char * cNACA )

generates naca airfoil coordinates (NN points) and stores it in file "file_name"

Definition at line 295 of file naca.cpp.

296{
297 FILE *fp = fopen( file_name, "w" );
298
299 char *cname;
300
301 if(!(cname = check_name(cNACA)))
302 {
303 fprintf(stderr, "%s is not a valid NACA section name.\n", cNACA );
304 return -1;
305 }
306 else
307 {
308 fprintf( stderr, "NACA %s - cname %s\n", cNACA, cname );
309 }
310
311 return generate_naca(cname, 160, fp);
312}
int generate_naca(char *name, int num, FILE *fp)
generates naca airfoil coordinates (NN points) and stores it in file defined by stream "fp"
Definition naca.cpp:314

◆ generate_naca() [3/3]

int NACA_PROFILE::generate_naca ( char * name,
int num,
FILE * fp )

generates naca airfoil coordinates (NN points) and stores it in file defined by stream "fp"

Definition at line 314 of file naca.cpp.

315{
316 iWrite = 1;
317
318 get_params(&data, name);
319
320 fprintf(fp, "NACA %s\n", name);
321
322#ifdef Debug
323 fprintf(stderr, "%s:\n camber: %g\n thickness: %g\n max_camber_pos: %g\n series: %s\n",
324 data.name, data.maxor, data.thmax, data.posmax,
325 ((data.serie == four_digit)? "four digit" : "five digit"));
326#endif
327
328 draw_surface(num, &data, fp);
329
330 fclose (fp);
331
332 return 0;
333}
double posmax
the location of maximum camber
Definition naca.h:49
double thmax
the maximum thickness
Definition naca.h:50
enum series serie
type of serie - 4- or 5-digit
Definition naca.h:52
double maxor
the maximum camber
Definition naca.h:48
const char * name
4- or 5-digit airfoil code
Definition naca.h:47

Referenced by generate_naca(), and AIRFOIL::ReadNaca().

◆ setTE0()

void NACA_PROFILE::setTE0 ( int TE = 1)
inline

TE=1 forces the zero thickness trailing edge.

Definition at line 108 of file naca.h.

108{ data.iTE0 = TE; };
int iTE0
trailing edge flag, 1 - TE thickness equal to zero
Definition naca.h:54

Referenced by AIRFOIL::ReadNaca().

Member Data Documentation

◆ N

int NACA_PROFILE::N

coordiantes vectors' size

Definition at line 112 of file naca.h.

Referenced by generate_naca(), and AIRFOIL::ReadNaca().

◆ X

double* NACA_PROFILE::X

x coordinates vector

Definition at line 110 of file naca.h.

Referenced by AIRFOIL::ReadNaca().

◆ Z

double* NACA_PROFILE::Z

z coordinates vecotr

Definition at line 111 of file naca.h.

Referenced by AIRFOIL::ReadNaca().


The documentation for this class was generated from the following files: