summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <blendoit@gmail.com>2019-06-20 18:02:31 -0700
committerMarius Peter <blendoit@gmail.com>2019-06-20 18:02:31 -0700
commit4ee52cf24db8148c54f02022517a06b662509f92 (patch)
tree9caf8b934cff255090466951c4e438c97bb7df77
parentd80486b906e68380afdcf3a3693eaa3e81b38a9c (diff)
elliptical and rectangular lift distributions
-rw-r--r--creator.py20
-rw-r--r--evaluator.py26
-rw-r--r--main.py2
3 files changed, 30 insertions, 18 deletions
diff --git a/creator.py b/creator.py
index 5c01d9c..1f02e71 100644
--- a/creator.py
+++ b/creator.py
@@ -154,12 +154,12 @@ class Airfoil(Coordinates):
"""
y_c = float()
if 0 <= x < p_c:
- y_c = (m / (p**2)) * (2 * p * (x / self.chord)
- - (x / self.chord)**2)
+ y_c = (m / (p ** 2)) * (2 * p * (x / self.chord)
+ - (x / self.chord) ** 2)
elif p_c <= x <= self.chord:
- y_c = (m / ((1 - p)**2)) * ((1 - 2 * p)
- + 2 * p * (x / self.chord)
- - (x / self.chord)**2)
+ y_c = (m / ((1 - p) ** 2)) * ((1 - 2 * p)
+ + 2 * p * (x / self.chord)
+ - (x / self.chord) ** 2)
return (y_c * self.chord)
def get_thickness(x):
@@ -169,17 +169,17 @@ class Airfoil(Coordinates):
y_t = 5 * t * self.chord * (
+0.2969 * sqrt(x / self.chord)
- 0.1260 * (x / self.chord)
- - 0.3516 * (x / self.chord)**2
- + 0.2843 * (x / self.chord)**3
- - 0.1015 * (x / self.chord)**4)
+ - 0.3516 * (x / self.chord) ** 2
+ + 0.2843 * (x / self.chord) ** 3
+ - 0.1015 * (x / self.chord) ** 4)
return y_t
def get_theta(x):
dy_c = float()
if 0 <= x < p_c:
- dy_c = ((2 * m) / p**2) * (p - x / self.chord)
+ dy_c = ((2 * m) / p ** 2) * (p - x / self.chord)
elif p_c <= x <= self.chord:
- dy_c = (2 * m) / ((1 - p)**2) * (p - x / self.chord)
+ dy_c = (2 * m) / ((1 - p) ** 2) * (p - x / self.chord)
theta = atan(dy_c)
return theta
diff --git a/evaluator.py b/evaluator.py
index 824b578..f4768e1 100644
--- a/evaluator.py
+++ b/evaluator.py
@@ -13,7 +13,24 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-# F_z =
+from math import sin, cos, atan, sqrt
+
+
+def get_total_mass(*component):
+ total_mass = float()
+ for _ in component:
+ total_mass += _.mass
+ return total_mass
+
+
+def lift_rectangular(lift, semi_span):
+ L_prime = lift / (semi_span * 2)
+ return L_prime
+
+
+def lift_elliptical(L_0, y, semi_span):
+ L_prime = L_0 * sqrt(1 - (y / semi_span) ** 2)
+ return L_prime
def get_centroid(airfoil):
@@ -25,10 +42,3 @@ def get_centroid(airfoil):
numerator += _ * area
# denominator
# z_c =
-
-
-def get_total_mass(self, *component):
- total_mass = float()
- for _ in component:
- total_mass += _.mass
- return total_mass
diff --git a/main.py b/main.py
index ad24bb2..0631bc9 100644
--- a/main.py
+++ b/main.py
@@ -76,6 +76,8 @@ def main():
af.stringer.add_mass(STRINGER_MASS)
# af.stringer.print_info(2)
+ print(evaluator.get_total_mass(af, af.spar, af.stringer))
+
# Plot components with matplotlib
creator.plot(af, af.spar, af.stringer)
Copyright 2019--2024 Marius PETER