-
Notifications
You must be signed in to change notification settings - Fork 4
/
designModeVal.py
45 lines (35 loc) · 1.48 KB
/
designModeVal.py
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
# VSP2WOPWOP Operational Mode 1 Value Return
# Author: Daniel Weitsman
# 10/28/20
# When using the design mode (operMode = 1), distinct operating conditions can be defined for each blade geometry.
# This module returns the correct quantity corresponding to each geometry variant.
def designModeVal(UserIn,XsecPolar, i):
# In the design mode each can be trimmed to a distinct operating condition. This set of if
# statement checks the length of the quantities specified as lists in the input module. If the list consists of a
# single element, this value is retained for all subsequent DegenGeom variant. However, if its length is greater
# than one the value corresponding to the current DegenGeom iteration is returned.
if len(UserIn['T']) > 1:
T = UserIn['T'][i]
else:
T = UserIn['T'][0]
if len(UserIn['Vz']) > 1:
Vz = UserIn['Vz'][i]
else:
Vz = UserIn['Vz'][0]
if len(UserIn['omega']) > 1:
omega = UserIn['omega'][i]
else:
omega = UserIn['omega'][0]
if len(UserIn['Vx']) > 1:
Vx = UserIn['Vx'][i]
else:
Vx = UserIn['Vx'][0]
if len(UserIn['alphaShaft']) > 1:
alphaShaft = UserIn['alphaShaft'][i]
else:
alphaShaft = UserIn['alphaShaft'][0]
if len(UserIn['airfoilPolarFileName']) > 1:
XsecPolar = XsecPolar[list(XsecPolar.keys())[i]]
else:
XsecPolar = XsecPolar[list(XsecPolar.keys())[0]]
return T,Vz,Vx,omega,alphaShaft,XsecPolar