-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfPropInput.m
149 lines (113 loc) · 5.16 KB
/
fPropInput.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
function [geo]=fPropInput(geo)
loop1=1;
while loop1==1
disp(' ')
%ok1=0;
disp('_______________________________________________________')
disp(' ')
disp(' New Propeller Definition ')
disp('_______________________________________________________')
disp(' ');
disp(' b - Back one question. ')
disp(' q - Abort input sequence. ')
disp(' ')
disp('-------------------------------------------------------')
data=input('Number of propellers on centerline ANDOR Starboard side: ','s');
for i=1:str2double(data)
disp(' ')
disp(strcat(' Data for propeller number: ',32, num2str(i)));
disp(' ')
stepper=-1;
while (stepper < 99)
switch stepper
case -1
data=input('Number of propeller blades: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.n(i)=str2double(data);
end
case 0
data=input('Propeller Diameter [m]: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.dia(i)=str2double(data);
end
case 1
data=input('Propeller RPM [RPM]: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.rpm(i)=str2double(data);
end
case 2
data=input('Propeller Thrust [N]: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.T(i)=str2double(data);
end
case 3
data=input('Propeller hub X-position [m]: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.pos(i,1)=str2double(data);
end
case 4
data=input('Propeller hub Y-position [m]: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.pos(i,2)=str2double(data);
end
case 5
data=input('Propeller hub Z-position [m]: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.pos(i,3)=str2double(data);
end
case 6
disp (' ')
disp (' Right hand positive, [-1 0 0] rotates clockwise from behind propeller. ')
data=input('Propeller rotation axis X-Coordinate: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.rot(i,1)=str2double(data);
end
case 7
data=input('Propeller rotation axis Y-Coordinate: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.rot(i,2)=str2double(data);
end
case 8
data=input('Propeller rotation axis Z-Coordinate: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.rot(i,3)=str2double(data);
end
case 9
data=input('Is the prop symmetrically placed wtr the XZ plane? [1 0]: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.Psym(i)=str2double(data);
if geo.prop.Psym(i)
data=input('Is the prop rotation symmetric [1 0]: ','s');
type=1;
if isinptok(data,type)==1
geo.prop.Rsym(i)=str2double(data);
end
else
geo.prop.Rsym(i)=0;
end
end
end %case
if isinptok(data,type)==1
stepper=stepper+1;
elseif isinptok(data,type)==-1
stepper=stepper-1;
elseif isinptok(data,type)==-2
stepper=99;
return
end %If
end %while
disp('-------------------------------------------------------')
end
loop1=0;
end