Skip to content

Commit efaf675

Browse files
authored
Refactoring and bug fixes for geometry and meshing (#455)
* Fix taper derivative and computation. Add comments for geometry transformations * Optimize taper routines * Add comments to chord and sweep transformation * Comments to xshear and stretch: * Add comments to ShearY and Dihedral * Finish geometric transformation comments * Add ref_axis_pos as input for geom transformations in utils. defaults to quarter chord as before * Fixed and expanded the ability to bunch panels at both root and tip for rectangular meshes * Reorganize all meshing tools into new meshing directory. Maintains backward compatibility with deprecation warnings * revert accidental change to plot_wing * Update test and docs to use new imports * Updates for multi section mesh generator * Added support for generation single section meshes using the surface dict itself in the standard geometry group * Fixes to make the section mesh generator work properly for standard geometry group * Fixes for section mesh generator * More fixes for section mesh generator * Start mesh gen rework * Fixes and rework of multi section mesh generator * Last few mesh generator fixes * Move multi section functions to utils. Merge ones unique to a class into the class. Update docs and examples * Fix tests and correct issue with setting span * Moved multisection tests to geometry to be more inline with how others are organized * fix legacy imports and create a new test to make sure they work * Replaced write_tecplot with working function * black fixes * more black fixes * flake8 fixes * Flake8 fixes * Docs update and add back missing test * Update setup.py * Add taper=1 test * Revised legacy imports and tests to use OM Deprecation warning instead of python one * Add test for mesh generator * Fix test for mesh * Added test for regeneration of mesh points * Fix black and flake8
1 parent f275858 commit efaf675

105 files changed

Lines changed: 2135 additions & 1141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

openaerostruct/docs/advanced_features/geometry_manipulation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Only two components need to have information from all lifting surfaces -- `Assem
129129

130130
Utility Scripts
131131
---------------
132-
A few useful scripts can be found in geometry/utils.py, such as
133-
:py:meth:`writing the mesh to a Tecplot file <openaerostruct.geometry.utils.writeMesh>`
132+
A few useful scripts can be found in geometry/utils.py and meshing/utils.py, such as
133+
:py:meth:`writing the mesh to a Tecplot file <openaerostruct.meshing.utils.write_tecplot>`
134134
and
135-
:py:meth:`mirroring half-meshes to obtain the full mesh <openaerostruct.geometry.utils.getFullMesh>`.
135+
:py:meth:`mirroring half-meshes to obtain the full mesh <openaerostruct.meshing.utils.getFullMesh>`.

openaerostruct/docs/advanced_features/scripts/basic_2_sec.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import openmdao.api as om
77
from openaerostruct.geometry.geometry_group import MultiSecGeometry
88
from openaerostruct.aerodynamics.aero_groups import AeroPoint
9-
from openaerostruct.geometry.geometry_group import build_sections
10-
from openaerostruct.geometry.geometry_unification import unify_mesh
9+
from openaerostruct.geometry.utils import build_section_dicts
10+
from openaerostruct.geometry.utils import unify_mesh
1111
import matplotlib.pyplot as plt
1212

1313

@@ -133,10 +133,10 @@
133133
prob.model.add_subsystem(surface["name"], multi_geom_group)
134134

135135

136-
# In this next part, we will setup the aerodynamics group. First we use a utility function called build_sections which takes our multi-section surface dictionary and outputs a
136+
# In this next part, we will setup the aerodynamics group. First we use a utility function called build_section_dicts which takes our multi-section surface dictionary and outputs a
137137
# surface dictionary for each individual section. We then inputs these dictionaries into the mesh unification function unify_mesh to produce a single mesh array for the the entire surface.
138138
# We then add this mesh to the multi-section surface dictionary
139-
section_surfaces = build_sections(surface)
139+
section_surfaces = build_section_dicts(surface)
140140
uniMesh = unify_mesh(section_surfaces)
141141
surface["mesh"] = uniMesh
142142

openaerostruct/docs/advanced_features/scripts/basic_2_sec_construction.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
import openmdao.api as om
77
from openaerostruct.geometry.geometry_group import MultiSecGeometry
88
from openaerostruct.aerodynamics.aero_groups import AeroPoint
9-
from openaerostruct.geometry.geometry_group import build_sections
10-
from openaerostruct.geometry.geometry_unification import unify_mesh
11-
from openaerostruct.geometry.multi_unified_bspline_utils import build_multi_spline, connect_multi_spline
9+
from openaerostruct.geometry.utils import build_section_dicts, unify_mesh, build_multi_spline, connect_multi_spline
1210
import matplotlib.pyplot as plt
1311

1412
# docs checkpoint 1
@@ -57,7 +55,7 @@
5755
"S_ref_type": "wetted", # how we compute the wing area, can be 'wetted' or 'projected'
5856
# Geometry Parameters
5957
"taper": [1.0, 1.0], # Wing taper for each section. The list length must match the specified number of sections.
60-
"span": [2.0, 2.0], # Wing span for each section. The list length must match the specified number of sections.
58+
"span": [1.0, 1.0], # Span length of each section. The list length must match the specified number of sections.
6159
"sweep": [0.0, 0.0], # Wing sweep for each section. The list length must match the specified number of sections.
6260
"chord_cp": sec_chord_cp, # The chord B-spline parameterization for each section. The list length must match the specified number of sections.
6361
"twist_cp": [
@@ -112,9 +110,9 @@
112110
# In order to construct this global B-spline control vector we first need to generate the unified surface mesh.
113111
# The unified surface mesh is simply all the individual section surface meshes combine into a single unified OAS mesh array.
114112

115-
# First we will call the utility function build_sections which takes the surface dictionary and outputs a list of surface dictionaries corresponding to
113+
# First we will call the utility function build_section_dicts which takes the surface dictionary and outputs a list of surface dictionaries corresponding to
116114
# each section.
117-
section_surfaces = build_sections(surface)
115+
section_surfaces = build_section_dicts(surface)
118116

119117
# We can then call unify_mesh which outputs the unified mesh of all of the sections.
120118
uniMesh = unify_mesh(section_surfaces)

openaerostruct/docs/advanced_features/scripts/basic_2_sec_visc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
from openaerostruct.geometry.geometry_group import MultiSecGeometry
1010
from openaerostruct.aerodynamics.aero_groups import AeroPoint
11-
from openaerostruct.geometry.geometry_group import build_sections
12-
from openaerostruct.geometry.geometry_unification import unify_mesh
13-
from openaerostruct.geometry.multi_unified_bspline_utils import build_multi_spline, connect_multi_spline
11+
from openaerostruct.geometry.utils import build_section_dicts
12+
from openaerostruct.geometry.utils import unify_mesh
13+
from openaerostruct.geometry.utils import build_multi_spline, connect_multi_spline
1414
import matplotlib.pyplot as plt
1515

1616

@@ -86,7 +86,7 @@
8686
prob.model.add_subsystem("prob_vars", indep_var_comp, promotes=["*"])
8787

8888
# Generate the sections and unified mesh here. It's needed to join the sections by construction.
89-
section_surfaces = build_sections(surface)
89+
section_surfaces = build_section_dicts(surface)
9090
uniMesh = unify_mesh(section_surfaces)
9191
surface["mesh"] = uniMesh
9292

openaerostruct/docs/aero_walkthrough/generate_n2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import openmdao.api as om
44

5-
from openaerostruct.geometry.utils import generate_mesh
5+
from openaerostruct.meshing.mesh_generator import generate_mesh
66
from openaerostruct.geometry.geometry_group import Geometry
77
from openaerostruct.aerodynamics.aero_groups import AeroPoint
88

openaerostruct/docs/aero_walkthrough/part_1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import openmdao.api as om
44

5-
from openaerostruct.geometry.utils import generate_mesh
5+
from openaerostruct.meshing.mesh_generator import generate_mesh
66
from openaerostruct.geometry.geometry_group import Geometry
77
from openaerostruct.aerodynamics.aero_groups import AeroPoint
88

openaerostruct/docs/user_reference/mesh_surface_dict.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ The surface dict will be provided to Groups, including ``Geometry``, ``AeroPoint
8484
-
8585
- How we compute the wing reference area.
8686
* - mesh
87-
- 3D ndarray
87+
- 3D ndarray or "gen-mesh"
8888
- m
89-
- ``x, y, z`` coordinates of the mesh vertices, can be created by ``generate_mesh``.
89+
- ``x, y, z`` coordinates of the mesh vertices, can be created by ``generate_mesh``. Can also specify "gen-mesh" to generate a mesh based on taper, sweep, and span variables given in the surface dictionary.
9090
* - span
9191
- 10.0
9292
- m

openaerostruct/docs/wingbox_mpt_opt_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# docs checkpoint 0
33

44
import numpy as np
5-
from openaerostruct.geometry.utils import generate_mesh
5+
from openaerostruct.meshing.mesh_generator import generate_mesh
66
from openaerostruct.integration.aerostruct_groups import AerostructGeometry, AerostructPoint
77
from openaerostruct.structures.wingbox_fuel_vol_delta import WingboxFuelVolDelta
88
import openmdao.api as om

openaerostruct/examples/black_box_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import numpy as np
1212

13-
from openaerostruct.geometry.utils import generate_mesh
13+
from openaerostruct.meshing.mesh_generator import generate_mesh
1414

1515
from openaerostruct.integration.aerostruct_groups import AerostructGeometry, AerostructPoint
1616

openaerostruct/examples/drag_polar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import matplotlib.pylab as plt
33

44
import openmdao.api as om
5-
from openaerostruct.geometry.utils import generate_mesh
5+
from openaerostruct.meshing.mesh_generator import generate_mesh
66
from openaerostruct.geometry.geometry_group import Geometry
77
from openaerostruct.aerodynamics.aero_groups import AeroPoint
88

0 commit comments

Comments
 (0)