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

Parameters file to add propellers info to 3D panel code. More...

#include <panukl_acd.h>

Public Member Functions

void Clean ()
 cleans local variables
 
int Read (char *FileName)
 reads parameters file
 
int Write (char *Filename)
 writes parameters file
 

Public Attributes

double ro
 air density [kg/m^3]
 
double V
 airspeed [m/s]
 
std::vector< PropDefProp
 vector of propellers
 

Detailed Description

Parameters file to add propellers info to 3D panel code.

Definition at line 46 of file panukl_acd.h.

Constructor & Destructor Documentation

◆ ACD_FILE()

ACD_FILE::ACD_FILE ( void )

Definition at line 24 of file panukl_acd.cpp.

24{ Clean (); }
void Clean()
cleans local variables

◆ ~ACD_FILE()

ACD_FILE::~ACD_FILE ( void )

Definition at line 26 of file panukl_acd.cpp.

26{}

Member Function Documentation

◆ Clean()

void ACD_FILE::Clean ( void )

cleans local variables

Definition at line 28 of file panukl_acd.cpp.

29{
30 Prop.clear();
31}
std::vector< PropDef > Prop
vector of propellers
Definition panukl_acd.h:52

◆ Read()

int ACD_FILE::Read ( char * FileName)

reads parameters file

Definition at line 33 of file panukl_acd.cpp.

34{
35 ifstream in(FileName);
36
37 if(in.fail())
38 {
39 fprintf( stderr, "[.ACD] file open error to reading (%s)\n", FileName );
40 return (-1);
41 }
42 else
43 {
44 char Trush[256];
45 int n_Props;
46 PropDef PropData;
47
48 in >> Trush >> n_Props >> ro >> V;
49
50 for(int x=0; x<n_Props; x++)
51 {
52 in >> PropData.Id;
53 in >> PropData.X0;
54 in >> PropData.Y0;
55 in >> PropData.Z0;
56 in >> PropData.Xthrust;
57 in >> PropData.Ythrust;
58 in >> PropData.Zthrust;
59 in >> PropData.Omega;
60 in >> PropData.D;
61 in >> PropData.T;
62 in >> PropData.P;
63
64 Prop.push_back(PropData);
65 }
66 }
67
68 in.close();
69 return 0;
70}
double V
airspeed [m/s]
Definition panukl_acd.h:51
double ro
air density [kg/m^3]
Definition panukl_acd.h:50
Structure to define actuator (propeller disc)
Definition panukl_acd.h:30
double Zthrust
Z component of thrust direction.
Definition panukl_acd.h:37
double Y0
Y coordinate of disc center.
Definition panukl_acd.h:33
double P
shaft power of propeller [W]
Definition panukl_acd.h:41
double Ythrust
Y component of thrust direction.
Definition panukl_acd.h:36
int Id
identification number
Definition panukl_acd.h:31
double D
propeller diameter [m]
Definition panukl_acd.h:39
double T
thrust generated by propeller [N]
Definition panukl_acd.h:40
double Xthrust
X component of thrust direction (for definition vector normal to actuator disc plane,...
Definition panukl_acd.h:35
double X0
X coordinate of disc center.
Definition panukl_acd.h:32
double Z0
Z coordinate of disc center.
Definition panukl_acd.h:34
double Omega
propeller angular rate in RPM, positive direction of rotation (right hand rule) defined around the th...
Definition panukl_acd.h:38

◆ Write()

int ACD_FILE::Write ( char * Filename)

writes parameters file

Definition at line 72 of file panukl_acd.cpp.

73{
74 ofstream out(FileName);
75
76 if(out.fail())
77 {
78 fprintf( stderr, "[.ACD] file open error to writing (%s)\n", FileName );
79 return (-1);
80 }
81 else
82 {
83 out << "n_Props:\t" << Prop.size() << endl;
84 out << ro << "\t" << V << endl << endl;
85
86 for(unsigned int x=0; x<Prop.size(); x++)
87 {
88 out << Prop[x].Id << "\t";
89 out << Prop[x].X0 << "\t";
90 out << Prop[x].Y0 << "\t";
91 out << Prop[x].Z0 << "\t";
92 out << Prop[x].Xthrust << "\t";
93 out << Prop[x].Ythrust << "\t";
94 out << Prop[x].Zthrust << "\t";
95 out << Prop[x].Omega << "\t";
96 out << Prop[x].D << "\t";
97 out << Prop[x].T << "\t";
98 out << Prop[x].P << endl;
99 }
100 }
101
102 out.close();
103 return 0;
104}

Member Data Documentation

◆ Prop

std::vector<PropDef> ACD_FILE::Prop

vector of propellers

Definition at line 52 of file panukl_acd.h.

Referenced by Clean(), Read(), and Write().

◆ ro

double ACD_FILE::ro

air density [kg/m^3]

Definition at line 50 of file panukl_acd.h.

Referenced by Read(), and Write().

◆ V

double ACD_FILE::V

airspeed [m/s]

Definition at line 51 of file panukl_acd.h.

Referenced by Read(), and Write().


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