Skip to content

Commit d1bff2d

Browse files
timryanbeytanadler
andauthored
Adding MPhys Interface (#401)
* first implementation of mphys builder for aero solver * Adding compressible states to mphys builder * Formatting changes * adding tests * Fixing promotion bug in mphys AeroFuncsGroup * Adding mphys install to github workflow * minor black reformat * adding mphys module to setup.py package * adding catch for missing mphys package * adding tecplot files to gitignore * changing surface_contour file extension to .plt * Adding mphys aero example * minor flake fix for mphys example * Adding first mphys test * Adding compressible mphys test * Adding capability to run aero mphys builder in parallel * Updating mphys aero inputs to match mphys naming convention * Adding mphys optimization examples * minor edit * updating mphys import procedure * minor black reformat * Update mphys_chord_opt.py * Adding missing vsp file for mphys opt examples * minor black reformat * renming examples * Adding descriptions to mphys optimization examples * Adding descriptions to docstrings to mphys wrapper * Minor docstring edit * Updating pygeo mphys examples to match new pygeo API * Updating `generate_vsp_surfaces` to use `VSPVehicle` class * Updating OpenMDAO upper version requirement to 3.24 * Adding total lift/drag component to mphys wrapper * black fixes * black/flake fixes * fixing missing mphys module in CI * Another black fix * Adding mphys docs * Updating min mphys req in setup.py * Adding missing vsp model to mphys docs * Adding dimensional lift and drag to total performance * Breaking up mphys wrapper into smaller files * Adding more mphys unit tests * Adding one more mphys unit test * adding default units to mphys `yaw` variable * Setting mphys default for `mach` var * update mphys test * black fixes * fixing problem with setting default mach for incompresssible cases in mphys * fixing viscous nan in test_aero_funcs_group.py * Addressing review comments * Adding lift distribution writer component to mphys * flake fix --------- Co-authored-by: Eytan Adler <eytana@umich.edu>
1 parent de09342 commit d1bff2d

58 files changed

Lines changed: 5243 additions & 112 deletions

Some content is hidden

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

.github/workflows/oas.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ jobs:
2727
PYTHON_VERSION_LATEST: ['3.11']
2828
NUMPY_VERSION_OLDEST: ['1.20'] # latest is most recent on PyPI
2929
SCIPY_VERSION_OLDEST: ['1.6.0'] # latest is most recent on PyPI
30-
OPENMDAO_VERSION_OLDEST: ['3.10'] # latest is most recent on PyPI
30+
OPENMDAO_VERSION_OLDEST: ['3.15'] # latest is most recent on PyPI
31+
MPHYS_VERSION_OLDEST: ['1.0.0'] # latest is most recent on PyPI
3132
PYGEO_VERSION_OLDEST: ['1.6.0'] # latest is pulled from main branch, for some reason anything after 1.12.2 seg faults on the old build
3233
VSP_VERSION: ['3.27.1'] # used for both builds
3334

@@ -89,13 +90,13 @@ jobs:
8990
if: ${{ matrix.dep-versions == 'oldest' }}
9091
run: |
9192
python -m pip install --upgrade pip wheel
92-
pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }}
93+
pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }} mphys==${{ matrix.MPHYS_VERSION_OLDEST }}
9394
pip install -e .[test]
9495
- name: Install OAS and its dependencies (latest versions)
9596
if: ${{ matrix.dep-versions == 'latest' }}
9697
run: |
9798
python -m pip install --upgrade pip wheel
98-
pip install -e .[test]
99+
pip install -e .[test,mphys]
99100
100101
# We need pySpline/pyGeo to run FFD tests.
101102
- name: Install pySpline

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ src/adjoint/tempReverse/
2121
src/adjoint/tempForward/
2222
openaerostruct.egg-info/
2323
.vscode
24+
*.plt

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,15 @@ Version Information
7878
-------------------
7979
The oldest and latest versions of the dependencies that we test regularly are the following (other versions may work, but no guarantees):
8080

81-
| Dependency | oldest | latest |
82-
| ---------- | ------ | ------ |
83-
| Python | 3.8 | 3.11 |
84-
| NumPy | 1.20 | latest |
85-
| SciPy | 1.6.0 | latest |
86-
| OpenMDAO | 3.10 | latest |
87-
| Matplotlib | latest | latest |
88-
| pyGeo (optional) | 1.6.0 | latest |
81+
| Dependency | oldest | latest |
82+
|--------------------|--------| ------ |
83+
| Python | 3.8 | 3.11 |
84+
| NumPy | 1.20 | latest |
85+
| SciPy | 1.6.0 | latest |
86+
| OpenMDAO | 3.15 | latest |
87+
| MPhys | 1.0.0 | latest |
88+
| Matplotlib | latest | latest |
89+
| pyGeo (optional) | 1.6.0 | latest |
8990
| OpenVSP (optional) | 3.27.1 | 3.27.1 |
9091

9192
If you are looking to use the previous version of OpenAeroStruct which uses OpenMDAO 1.7.4, use OpenAeroStruct 1.0 from [here](https://github.com/mdolab/OpenAeroStruct/releases).

openaerostruct/aerodynamics/coeffs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ class Coeffs(om.ExplicitComponent):
2626
"""
2727

2828
def setup(self):
29-
self.add_input("S_ref", val=1.0, units="m**2")
29+
self.add_input("S_ref", val=1.0, units="m**2", tags=["mphys_coupling"])
3030
self.add_input("L", val=1.0, units="N")
3131
self.add_input("D", val=1.0, units="N")
32-
self.add_input("v", val=1.0, units="m/s")
33-
self.add_input("rho", val=1.0, units="kg/m**3")
32+
self.add_input("v", val=1.0, units="m/s", tags=["mphys_input"])
33+
self.add_input("rho", val=1.0, units="kg/m**3", tags=["mphys_input"])
3434

3535
self.add_output("CL1", val=0.0)
3636
self.add_output("CDi", val=0.0)

openaerostruct/aerodynamics/collocation_points.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def setup(self):
7272

7373
# Take in a deformed mesh for each surface.
7474
mesh_name = name + "_def_mesh"
75-
self.add_input(mesh_name, shape=(nx, ny, 3), units="m")
75+
self.add_input(mesh_name, shape=(nx, ny, 3), units="m", tags=["mphys_coupling"])
7676

7777
mesh_indices = np.arange(nx * ny * 3).reshape((nx, ny, 3))
7878

openaerostruct/aerodynamics/convert_velocity.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def setup(self):
5555

5656
self.system_size = system_size
5757

58-
self.add_input("alpha", val=0.0, units="deg")
59-
self.add_input("beta", val=0.0, units="deg")
60-
self.add_input("v", val=1.0, units="m/s")
58+
self.add_input("alpha", val=0.0, units="deg", tags=["mphys_input"])
59+
self.add_input("beta", val=0.0, units="deg", tags=["mphys_input"])
60+
self.add_input("v", val=1.0, units="m/s", tags=["mphys_input"])
6161

6262
if rotational:
6363
self.add_input("rotational_velocities", shape=(system_size, 3), units="m/s")

openaerostruct/aerodynamics/eval_mtx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def setup(self):
163163
eval_name = self.options["eval_name"]
164164
num_eval_points = self.options["num_eval_points"]
165165

166-
self.add_input("alpha", val=1.0, units="deg")
166+
self.add_input("alpha", val=1.0, units="deg", tags=["mphys_input"])
167167

168168
self.surface_indices_repeated = dict()
169169

openaerostruct/aerodynamics/eval_velocities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def setup(self):
5656
self.system_size = system_size
5757

5858
self.add_input("freestream_velocities", shape=(system_size, 3), units="m/s")
59-
self.add_input("circulations", shape=system_size, units="m**2/s")
59+
self.add_input("circulations", shape=system_size, units="m**2/s", tags=["mphys_coupling"])
6060

6161
# Get the correct output name; the velocities output depends on which
6262
# set of evaluation points we use, either collocation or force.

openaerostruct/aerodynamics/geometry.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ def setup(self):
4848
ny = self.ny = mesh.shape[1]
4949

5050
# All of these computations only need the deformed mesh
51-
self.add_input("def_mesh", val=np.zeros((nx, ny, 3)), units="m")
51+
self.add_input("def_mesh", val=np.zeros((nx, ny, 3)), units="m", tags=["mphys_coupling"])
5252

5353
rng = np.random.default_rng(314)
54-
self.add_output("b_pts", val=rng.random((nx - 1, ny, 3)), units="m")
55-
self.add_output("widths", val=np.ones((ny - 1)), units="m")
56-
self.add_output("lengths_spanwise", val=np.ones((ny - 1)), units="m")
57-
self.add_output("lengths", val=np.zeros((ny)), units="m")
58-
self.add_output("chords", val=np.zeros((ny)), units="m")
59-
self.add_output("normals", val=np.zeros((nx - 1, ny - 1, 3)))
60-
self.add_output("S_ref", val=1.0, units="m**2")
54+
self.add_output("b_pts", val=rng.random((nx - 1, ny, 3)), units="m", tags=["mphys_coupling"])
55+
self.add_output("widths", val=np.ones((ny - 1)), units="m", tags=["mphys_coupling"])
56+
self.add_output("lengths_spanwise", val=np.ones((ny - 1)), units="m", tags=["mphys_coupling"])
57+
self.add_output("lengths", val=np.zeros((ny)), units="m", tags=["mphys_coupling"])
58+
self.add_output("chords", val=np.zeros((ny)), units="m", tags=["mphys_coupling"])
59+
self.add_output("normals", val=np.zeros((nx - 1, ny - 1, 3)), tags=["mphys_coupling"])
60+
self.add_output("S_ref", val=1.0, units="m**2", tags=["mphys_coupling"])
6161

6262
# Next up we have a lot of rows and cols settings for the sparse
6363
# Jacobians. Each set of partials needs a different rows/cols setup

openaerostruct/aerodynamics/horseshoe_circulations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def setup(self):
4545

4646
self.system_size = system_size
4747

48-
self.add_input("circulations", shape=system_size, units="m**2/s")
48+
self.add_input("circulations", shape=system_size, units="m**2/s", tags=["mphys_coupling"])
4949
self.add_output("horseshoe_circulations", shape=system_size, units="m**2/s")
5050

5151
# To convert between the two circulations, we simply need to set up a

0 commit comments

Comments
 (0)