CONFIG LIB  1.5
Configuration Files Library (by TGG 2020)
naca.h
1 /*********************************************************************/
2 /* */
3 /* Panukl package - (C) TGG 2002 */
4 /* Config files library - (C) TGG 2015 */
5 /* */
6 /*********************************************************************/
7 /* Warszawa, 2020 */
8 /*********************************************************************/
9 /* */
10 /* File: naca.h */
11 /* */
12 /* Author: T.Grabowski */
13 /* */
14 /* Contents - NACA_PROFILE class - declaration */
15 /* */
16 /* Last update: 21.11.2020 */
17 /* */
18 /*********************************************************************/
19 /* */
20 
21 /*
22  * naca.h
23  *
24  * Created by Alexandre Naaman (hoser@step.polymtl.ca) 30-08-1995
25  * Code clean-up, modifications to include more 5-digit sections:
26  * Shamim Mohamed (shamim@synopsys.com) Sept. 8 95
27  * corrected & modified to encapsulate into C++ class
28  * by Tomasz Grabowski (tgrab@meil.pw.edu.pl) Jan. 2012
29  * included to PanuklConfigLib 20.11.2020
30  */
31 
32 #ifndef _NACA_H_
33 #define _NACA_H_
34 
35 #include <cstdio>
36 #include <cmath>
37 #include <cctype>
38 
39 #include "memfun.h"
40 
41 enum series { four_digit, five_digit };
42 
44 
46 {
47  const char *name;
48  double maxor;
49  double posmax;
50  double thmax;
51  double k1;
52  enum series serie;
53  int ireflex;
54  int iTE0;
55 };
56 
68 class NACA_PROFILE : public MEMFUN
69 {
70  private:
71 
72  double A[5];
73 
74  NACA_AIRFOIL_DATA data;
75 
76  int iWrite;
77  int iLicz;
78 
79  double sqr(double x) { return x*x; };
80  double cube(double x) { return x*x*x; };
81 
82  double xcoord( double angle);
83  double ytfunc( double x, double thmax );
84 
85  void camber_four(double *yc, double *slope, double x, double maxor, double posmax);
86  void camber_five(double *yc, double *slope, double x, double maxor, double posmax, double k1, int iReflex);
87 
88  void out_point(double x, double yc, double yt, double slope, int is_upper, FILE *fp);
89 
90  void get_params(struct NACA_AIRFOIL_DATA *data, const char *name);
91 
92  void draw_surface(int ndiv, const struct NACA_AIRFOIL_DATA *data, FILE *fp);
93 
94  char *check_name(char *name);
95 
96  void ClearTabs( void );
97  void CreateTabs( int nn );
98 
99  public:
100 
101  NACA_PROFILE(void){ X=Z=0; };
102  ~NACA_PROFILE(void);
103 
104  int generate_naca(char *name, int num, FILE *fp);
105  int generate_naca(char *file_name, char* cNACA);
106  int generate_naca(char* cNACA, int NN=100);
107 
108  void setTE0( int TE = 1 ){ data.iTE0 = TE; };
109 
110  double *X;
111  double *Z;
112  int N;
113 };
114 
115 #endif /*_NACA_H_*/
NACA_AIRFOIL_DATA::iTE0
int iTE0
trailing edge flag, 1 - TE thickness equal to zero
Definition: naca.h:54
NACA_AIRFOIL_DATA::thmax
double thmax
the maximum thickness
Definition: naca.h:50
NACA_PROFILE::generate_naca
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:311
MEMFUN
class with overloaded "new" operator initializing object with zeros
Definition: memfun.h:34
NACA_PROFILE::N
int N
coordiantes vectors' size
Definition: naca.h:112
NACA_AIRFOIL_DATA::serie
enum series serie
type of serie - 4- or 5-digit
Definition: naca.h:52
NACA_PROFILE
NACA_PROFILE class to generate 4-digit and 5-digit naca airfoils Created by Alexandre Naaman (hoser...
Definition: naca.h:69
NACA_AIRFOIL_DATA::maxor
double maxor
the maximum camber
Definition: naca.h:48
NACA_PROFILE::Z
double * Z
z coordinates vecotr
Definition: naca.h:111
NACA_AIRFOIL_DATA::posmax
double posmax
the location of maximum camber
Definition: naca.h:49
NACA_PROFILE::X
double * X
x coordinates vector
Definition: naca.h:108
NACA_AIRFOIL_DATA::k1
double k1
constant to determine the desired lift coefficient (5-digit serie)
Definition: naca.h:51
NACA_AIRFOIL_DATA
A struct containing airfoil data.
Definition: naca.h:46
NACA_AIRFOIL_DATA::ireflex
int ireflex
reflex flag - if ireflex = 1, Cm should be close to 0 (5-digit serie)
Definition: naca.h:53
memfun.h
NACA_PROFILE::setTE0
void setTE0(int TE=1)
TE=1 forces the zero thickness trailing edge.
Definition: naca.h:108
NACA_AIRFOIL_DATA::name
const char * name
4- or 5-digit airfoil code
Definition: naca.h:47