variable name consistency & docstrings

Commit
576c9232ec279b6f9e50f7c4d56c9836208d1c07
Author
Marius Peter <blendoit@gmail.com>
Author date
Committer
Marius Peter <blendoit@gmail.com>
Committer date
Changed files
creator.py
index 3d13c8f4..40a25bc7 100644..100644
@@ -168,13 +168,13 @@
168 168 '''Returns thickness from 1 'x' along the airfoil chord.'''
169 169
170 170 x = 0 if x < 0 else x
171 Removed: y_t = 5 * t * self.chord * (
171 Added: z_t = 5 * t * self.chord * (
172 172 + 0.2969 * sqrt(x / self.chord)
173 173 - 0.1260 * (x / self.chord)
174 174 - 0.3516 * (x / self.chord) ** 2
175 175 + 0.2843 * (x / self.chord) ** 3
176 176 - 0.1015 * (x / self.chord) ** 4)
177 Removed: return y_t
177 Added: return z_t
178 178
179 179 def get_theta(x):
180 180 dz_c = float()
@@ -238,9 +238,8 @@
238 238 Add a single spar at the % chord location given to function.
239 239
240 240 Parameters:
241 Removed: coordinates: provided by Airfoil.coordinates[x, z, x, z].
242 Removed: material: spar's material. Assumes homogeneous material.
243 Removed: spar_x: spar's location as a % of total chord length.
241 Added: airfoil: gives the spar access to airfoil's coordinates.
242 Added: x_loc_percent: spar's location as a % of total chord length.
244 243
245 244 Return:
246 245 None
evaluator.py
index 04746e73..8e82312c 100644..100644
@@ -143,21 +143,21 @@
143 143 '''Return the coordinates of the centroid.'''
144 144
145 145 stringer_area = self.stringer.area
146 Removed: caps_area = self.spar.cap_area
146 Added: cap_area = self.spar.cap_area
147 147
148 148 caps_x = [value for spar in self.spar.x for value in spar]
149 149 caps_z = [value for spar in self.spar.z for value in spar]
150 150 stringers_x = self.stringer.x
151 151 stringers_z = self.stringer.z
152 152
153 Removed: denominator = float(len(caps_x) * caps_area
153 Added: denominator = float(len(caps_x) * cap_area
154 154 + len(stringers_x) * stringer_area)
155 155
156 Removed: centroid_x = float(sum([x * caps_area for x in caps_x])
156 Added: centroid_x = float(sum([x * cap_area for x in caps_x])
157 157 + sum([x * stringer_area for x in stringers_x]))
158 158 centroid_x = centroid_x / denominator
159 159
160 Removed: centroid_z = float(sum([z * caps_area for z in caps_z])
160 Added: centroid_z = float(sum([z * cap_area for z in caps_z])
161 161 + sum([z * stringer_area for z in stringers_z]))
162 162 centroid_z = centroid_z / denominator
163 163 return(centroid_x, centroid_z)
@@ -166,7 +166,7 @@
166 166 '''Obtain all inertia terms.'''
167 167
168 168 stringer_area = self.stringer.area
169 Removed: caps_area = self.spar.cap_area
169 Added: cap_area = self.spar.cap_area
170 170
171 171 # Adds upper and lower components' coordinates to list
172 172 x_stringers = self.stringer.x
@@ -177,17 +177,17 @@
177 177 spar_count = range(len(self.spar.x))
178 178
179 179 # I_x is the sum of the contributions of the spar caps and stringers
180 Removed: I_x = (sum([caps_area * (z_spars[i] - self.centroid[1]) ** 2
180 Added: I_x = (sum([cap_area * (z_spars[i] - self.centroid[1]) ** 2
181 181 for i in spar_count])
182 182 + sum([stringer_area * (z_stringers[i] - self.centroid[1]) ** 2
183 183 for i in stringer_count]))
184 184
185 Removed: I_z = (sum([caps_area * (x_spars[i] - self.centroid[0]) ** 2
185 Added: I_z = (sum([cap_area * (x_spars[i] - self.centroid[0]) ** 2
186 186 for i in spar_count])
187 187 + sum([stringer_area * (x_stringers[i] - self.centroid[0]) ** 2
188 188 for i in stringer_count]))
189 189
190 Removed: I_xz = (sum([caps_area * (x_spars[i] - self.centroid[0])
190 Added: I_xz = (sum([cap_area * (x_spars[i] - self.centroid[0])
191 191 * (z_spars[i] - self.centroid[1])
192 192 for i in spar_count])
193 193 + sum([stringer_area * (x_stringers[i] - self.centroid[0])
main.py
index 170901e2..0a5dc7fb 100644..100644
@@ -25,7 +25,7 @@
25 25 # Airfoil dimensions
26 26 NACA_NUM = 2412
27 27 CHORD_LENGTH = 68 # inches
28 Removed: SEMI_SPAN = 100 # inches
28 Added: SEMI_SPAN = 150 # inches
29 29
30 30 # Airfoil thickness
31 31 T_UPPER = 0.1
@@ -44,7 +44,7 @@
44 44 TOP_STRINGERS = 6
45 45 BOTTOM_STRINGERS = 4
46 46 NOSE_TOP_STRINGERS = 3
47 Removed: NOSE_BOTTOM_STRINGERS = 6
47 Added: NOSE_BOTTOM_STRINGERS = 5
48 48
49 49 # population information & save path
50 50 POP_SIZE = 1
@@ -98,7 +98,7 @@
98 98 af.stringer.info_save(SAVE_PATH, _)
99 99
100 100 # Plot components with matplotlib
101 Removed: creator.plot_geom(af)
101 Added: # creator.plot_geom(af)
102 102
103 103 # Evaluator object contains airfoil analysis results.
104 104 eval = evaluator.Evaluator(af)
@@ -106,7 +106,7 @@
106 106 eval.analysis()
107 107 # eval.info_print(2)
108 108 eval.info_save(SAVE_PATH, _)
109 Removed: # evaluator.plot_geom(eval)
109 Added: evaluator.plot_geom(eval)
110 110 # evaluator.plot_lift(eval)
111 111
112 112 # Print final execution time