forked from wcs211/BEM-3D-Python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
input_parameters.py
137 lines (122 loc) · 8 KB
/
input_parameters.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
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
import numpy as np
# Constants that determine other parameters and don't actually need lookup
MU = 0.001003
P = PARAMETERS = {
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Data I/O #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
'SW_SAVE_DATA': False
, 'SW_SV_L_CYCLE': True
, 'SW_SV_FORCES': False
, 'SAVE_EVERY': 1
, 'OUTPUT_DIR': '/home/wcs211/BEM-3D-Python/data'
, 'START_FROM': 'zeroTime'
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Geometry Definition #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
, 'SW_GEOMETRY': 'VDV'
, 'N_CHORD': 31 # Number of chordwise panels.
, 'N_SPAN': 31 # Number of spanwise panels.
, 'C': 1.0 # Chord length of rectangular body.
, 'SPAN': 2.0 # Span length of the body
, 'C_B': 2.0 # Body chord length.
, 'K': 2.-(12.4/180) # Van de Vooren airfoil parameter.
, 'EPSILON': 0.075 # Van de Vooren airfoil parameter.
, 'T_MAX': 0.2 # Maximum thickness.
, 'S': 0.1 # Collocation point shifting coefficient.
, 'AR_b': 3.5 # Ellipsoidal body aspect ratio.
, 'S_wp': 10 # Wetted area of the body+propulsor compared to planform area of the propulsor.
, 'Cd_bod': 0.01 # Virtual body drag coefficient.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Time-step and Misc. Parameters #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
, 'N_STEP': 50 # Number of time-steps per cycle
, 'N_CYC': 10 # Number of cycles to simulate
, 'N_LUMP': 2 # Number of cycles of the wake panels that are not lumped into a single element.
, 'DSTEP': 10**-5 # Displacement incremental time-step
, 'TSTEP': 10**-5 # Translation incremental time-step
, 'VERBOSITY': 1 # Frequency of information is printed to terminal
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Fluid Body Constants #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
, 'V0': -1.0 # Free-stream velocity, m/s.
, 'THETA_MAX': 5.73*np.pi/180 # Maximum pitch amplitude.
, 'ALPHA_MAX': -0*np.pi/180 # Angle of attack (in radians).
, 'F': 2.5 # Frequency of the body's pitching motion, Hz.
, 'PHI': 0 # Phase of flapping time signal.
, 'CE': 0.4 # Constant that determines the length of Edge panels (TE Factor).
, 'DELTA_CORE': 0.25 # Desingularization radius of wake panels in root chord lengths.
, 'DELTA_CORE_F': 0.02 # Fence distance from the body surface in body chord lengths.
, 'RHO': 998.2 # Fluid density, kg/m^3.
, 'NU': 1.004*10**-6 # Fluid kinematic viscosity, m^2/s.
, 'HEAVE_MAX': 0.31 # Heave amplitude, m.
, 'SCw': 0
, 'SW_KUTTA': False
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Skin Friction Solver Constants #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Structural Solver Constants #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
, 'INT_METHOD': 'HHT'
, 'M_TYPE': 'consistent'
, 'ALPHA': 0.02
, 'BETA': 0.25*(1+0.02)**2
, 'GAMMA': 0.5+0.02
, 'N_ELEMENTS_S': 100
, 'MATERIAL': 'Polyethylene'
, 'E': 3.8e9
, 'RHO_S': 935
, 'FRAC_DELT': 1.0
, 'FLEX_RATIO': 0.1
, 'T_CONST': 0.95
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# FSI Coupling Constants #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
, 'SW_FSI': False
, 'N_OUTERCORR_MAX': 1500
, 'OUTER_CORR_TOL': 1e-7
, 'FIXED_PT_RELAX': 1e-8
, 'COUPLING_SCHEME': 'Aitken'
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Solver Switches #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
, 'SW_FREE_SWIM': False
, 'SW_VISC_DRAG': False
, 'SW_INTERP_MTD': True
, 'SW_CNST_THK_BM': True
, 'SW_PLOT_FIG': True
}
##### The Following parameters are based on perviously declared variables #####
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Multi-Swimmer Parameters #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
P['N_SWIMMERS'] = 1
P['X_START'] = [i * 0.0 for i in xrange(P['N_SWIMMERS'])]
P['Y_START'] = [i * 0.0 for i in xrange(P['N_SWIMMERS'])]
P['Z_START'] = [i * 0.4 for i in xrange(P['N_SWIMMERS'])]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Time-step Parameters #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
P['DEL_T'] = 1. / P['F'] / P['N_STEP']
P['COUNTER'] = P['N_CYC'] * P['N_STEP'] + 1
# Constants dependent on declared parameters
P['N_BODY'] = 4*P['N_CHORD']*P['N_SPAN'] # Total number of body panels.
P['RE'] = -P['V0']*P['C']/P['NU'] # Reynolds number based on the body chord length.
P['U0'] = -P['V0']*np.cos(P['ALPHA_MAX']) # U component of free-stream velocity.
P['W0'] = P['V0']*np.sin(P['ALPHA_MAX']) # W component of free-stream velocity.
P['RF'] = (2*np.pi*P['F']*P['C'])/abs(P['U0']) # Reduced frequency based on root chord.
P['ST'] = P['F']*2*P['HEAVE_MAX']/abs(P['U0']) # Strouhal number based on the fin tip peak-to-peak amplitude.
P['V_CORE'] = P['C_B']*P['DELTA_CORE'] # Vortex core radius.
P['CUT_OFF'] = 1**-10*P['C_B'] # Cutoff distance for influence coeff. calc: body panels.
P['DELTA_CORE'] = (0.005*P['THETA_MAX']+0.09)*P['C']
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Body Motion Parameters #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
P['T'] = [P['DEL_T'] * i for i in xrange(P['COUNTER'])]
P['THETA'] = [P['THETA_MAX'] * np.sin(2 * np.pi * P['F'] * P['T'][i] + P['PHI']) for i in xrange(P['COUNTER'])]
P['THETA_MINUS'] = [P['THETA_MAX'] * np.sin(2 * np.pi * P['F'] * (P['T'][i] - P['TSTEP']) + P['PHI']) for i in xrange(P['COUNTER'])]
P['THETA_PLUS'] = [P['THETA_MAX'] * np.sin(2 * np.pi * P['F'] * (P['T'][i] + P['TSTEP']) + P['PHI']) for i in xrange(P['COUNTER'])]
P['HEAVE'] = [P['HEAVE_MAX'] * np.sin(2 * np.pi * P['F'] * P['T'][i]) for i in xrange(P['COUNTER'])]
P['HEAVE_MINUS'] = [P['HEAVE_MAX'] * np.sin(2 * np.pi * P['F'] * (P['T'][i] - P['TSTEP'])) for i in xrange(P['COUNTER'])]
P['HEAVE_PLUS'] = [P['HEAVE_MAX'] * np.sin(2 * np.pi * P['F'] * (P['T'][i] + P['TSTEP'])) for i in xrange(P['COUNTER'])]