CONFIG LIB 1.5
Configuration Files Library (by TGG 2020)
Loading...
Searching...
No Matches
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
41enum 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
68class NACA_PROFILE : public MEMFUN
69{
70 private:
71
72 double A[5];
73
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_*/
class with overloaded "new" operator initializing object with zeros
Definition memfun.h:34
NACA_PROFILE class to generate 4-digit and 5-digit naca airfoils Created by Alexandre Naaman (hoser...
Definition naca.h:69
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
void setTE0(int TE=1)
TE=1 forces the zero thickness trailing edge.
Definition naca.h:108
double * Z
z coordinates vecotr
Definition naca.h:111
int N
coordiantes vectors' size
Definition naca.h:112
double * X
x coordinates vector
Definition naca.h:110
This file contains some smart functions, operators, macros for safe initializing end erasing the memo...
A struct containing airfoil data.
Definition naca.h:46
double posmax
the location of maximum camber
Definition naca.h:49
int ireflex
reflex flag - if ireflex = 1, Cm should be close to 0 (5-digit serie)
Definition naca.h:53
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
double k1
constant to determine the desired lift coefficient (5-digit serie)
Definition naca.h:51
int iTE0
trailing edge flag, 1 - TE thickness equal to zero
Definition naca.h:54
const char * name
4- or 5-digit airfoil code
Definition naca.h:47