summaryrefslogtreecommitdiff
path: root/example_airfoil.py
diff options
context:
space:
mode:
authorMarius Peter <blendoit@gmail.com>2019-07-04 11:00:26 -0700
committerMarius Peter <blendoit@gmail.com>2019-07-04 11:00:26 -0700
commitcab1c2b9470ddc9099c4458daf2388d30ac12ca6 (patch)
treeb63a5fb97034aed4d8ae5effd0cef6e9d6de5ced /example_airfoil.py
parent04e871de7e318fec404975176800ccebf9e5e741 (diff)
start packagification
Diffstat (limited to 'example_airfoil.py')
-rw-r--r--example_airfoil.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/example_airfoil.py b/example_airfoil.py
index cf279d5..f09ea7f 100644
--- a/example_airfoil.py
+++ b/example_airfoil.py
@@ -1,13 +1,14 @@
"""This example illustrates the usage of creator, evaluator and generator.
+All the steps of airfoil creation & evaluation are detailed here;
+however, the generator.py module contains certain presets (default airfoils).
+
Create an airfoil;
Evaluate an airfoil;
Generate a population of airfoils & optimize.
"""
-import creator # Create geometry
-import evaluator # Evaluate geometry
-import generator # Iteratevely evaluate instances of geometry and optimize
+from tools import creator, evaluator, generator
import time
start_time = time.time()
@@ -36,10 +37,9 @@ BOTTOM_STRINGERS = 4
NOSE_TOP_STRINGERS = 3
NOSE_BOTTOM_STRINGERS = 5
-# population information & save path
-POP_SIZE = 1
SAVE_PATH = 'C:/Users/blend/github/UCLA_MAE_154B/save'
+
# Create airfoil instance
af = creator.Airfoil.from_dimensions(CHORD_LENGTH, SEMI_SPAN)
af.add_naca(NACA_NUM)
@@ -49,10 +49,10 @@ af.info_save(SAVE_PATH, 'foo_name')
# Create spar instance
af.spar = creator.Spar()
-# Define the spar coordinates and mass, stored in single spar object
+# All spar coordinates are stored in single Spar object
af.spar.add_coord(af, 0.23)
af.spar.add_coord(af, 0.57)
-# Automatically adds spar caps for each spar defined previously
+# Automatically adds spar caps for each spar previously defined
af.spar.add_spar_caps(SPAR_CAP_AREA)
af.spar.add_mass(SPAR_MASS)
af.spar.add_webs(SPAR_THICKNESS)
Copyright 2019--2024 Marius PETER