Skip to content

Commit e6cb69e

Browse files
authored
Merge pull request #93 from dzalkind/omdao_update
Update OpenMDAO wrapper for WEIS 2.0
2 parents d2c59cd + 71acfaa commit e6cb69e

File tree

8 files changed

+47
-14449
lines changed

8 files changed

+47
-14449
lines changed

.github/workflows/CI_RAFT.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
fail-fast: false #true
1717
matrix:
1818
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
19-
python-version: ["3.11", "3.12"]
19+
python-version: ["3.11", "3.12", "3.13"]
2020

2121

2222
steps:
2323
- name: checkout repository
24-
uses: actions/checkout@v4
24+
uses: actions/checkout@v5
2525

2626
- uses: conda-incubator/setup-miniconda@v3
2727
# https://github.com/marketplace/actions/setup-miniconda

.github/workflows/Publish_RAFT.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
if: github.event_name == 'release' && github.event.action == 'published'
2222
steps:
2323
- name: checkout repository
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v5
2525

2626
- name: Set up Python
27-
uses: actions/setup-python@v4
27+
uses: actions/setup-python@v6
2828
id: cp
2929
with:
30-
python-version: "3.11"
30+
python-version: "3.12"
3131
update-environment: true
3232

3333
- name: Install pypa/build

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "OpenRAFT"
7-
version = "2.0.0"
7+
version = "2.0.2"
88
description = "RAFT: Response Amplitudes of Floating Turbines"
99
readme = "README.md"
1010
requires-python = ">=3.9"
@@ -40,6 +40,8 @@ classifiers = [ # Optional
4040
"Programming Language :: Python :: 3.10",
4141
"Programming Language :: Python :: 3.11",
4242
"Programming Language :: Python :: 3.12",
43+
"Programming Language :: Python :: 3.13",
44+
"Programming Language :: Python :: 3.14",
4345
"Programming Language :: Python :: 3 :: Only",
4446

4547
"Operating System :: OS Independent",

raft/omdao_raft.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def setup(self):
3838
n_span = turbine_opt['n_span']
3939
n_aoa = turbine_opt['n_aoa']
4040
n_Re = turbine_opt['n_Re']
41-
n_tab = turbine_opt['n_tab']
4241
n_pc = turbine_opt['n_pc']
4342
n_af = turbine_opt['n_af']
4443
af_used_names = turbine_opt['af_used_names']
@@ -128,13 +127,12 @@ def setup(self):
128127
self.add_input('blade_presweep', val=np.zeros(n_span), units='m', desc='location of blade pitch axis in y-direction of :ref:`blade coordinate system <azimuth_blade_coord>`')
129128
self.add_input('blade_presweepTip', val=0.0, units='m', desc='location of blade pitch axis in y-direction at the tip (analogous to Rtip)')
130129
# Airfoils
131-
self.add_discrete_input("airfoils_name", val=n_af * [""], desc="1D array of names of airfoils.")
132130
self.add_input("airfoils_position", val=np.zeros(n_af_span), desc="1D array of the non dimensional positions of the airfoils af_used defined along blade span.")
133131
self.add_input("airfoils_r_thick", val=np.zeros(n_af), desc="1D array of the relative thicknesses of each airfoil.")
134-
self.add_input("airfoils_aoa", val=np.zeros(n_aoa), units="rad", desc="1D array of the angles of attack used to define the polars of the airfoils. All airfoils defined in openmdao share this grid.")
135-
self.add_input("airfoils_cl", val=np.zeros((n_af, n_aoa, n_Re, n_tab)), desc="4D array with the lift coefficients of the airfoils. Dimension 0 is along the different airfoils defined in the yaml, dimension 1 is along the angles of attack, dimension 2 is along the Reynolds number, dimension 3 is along the number of tabs, which may describe multiple sets at the same station, for example in presence of a flap.")
136-
self.add_input("airfoils_cd", val=np.zeros((n_af, n_aoa, n_Re, n_tab)), desc="4D array with the drag coefficients of the airfoils. Dimension 0 is along the different airfoils defined in the yaml, dimension 1 is along the angles of attack, dimension 2 is along the Reynolds number, dimension 3 is along the number of tabs, which may describe multiple sets at the same station, for example in presence of a flap.")
137-
self.add_input("airfoils_cm", val=np.zeros((n_af, n_aoa, n_Re, n_tab)), desc="4D array with the moment coefficients of the airfoils. Dimension 0 is along the different airfoils defined in the yaml, dimension 1 is along the angles of attack, dimension 2 is along the Reynolds number, dimension 3 is along the number of tabs, which may describe multiple sets at the same station, for example in presence of a flap.")
132+
self.add_input("airfoils_aoa", val=np.zeros(n_aoa), units="deg", desc="1D array of the angles of attack used to define the polars of the airfoils. All airfoils defined in openmdao share this grid.")
133+
self.add_input("airfoils_cl", val=np.zeros((n_af, n_aoa, n_Re)), desc="4D array with the lift coefficients of the airfoils. Dimension 0 is along the different airfoils defined in the yaml, dimension 1 is along the angles of attack, dimension 2 is along the Reynolds number, dimension 3 is along the number of tabs, which may describe multiple sets at the same station, for example in presence of a flap.")
134+
self.add_input("airfoils_cd", val=np.zeros((n_af, n_aoa, n_Re)), desc="4D array with the drag coefficients of the airfoils. Dimension 0 is along the different airfoils defined in the yaml, dimension 1 is along the angles of attack, dimension 2 is along the Reynolds number, dimension 3 is along the number of tabs, which may describe multiple sets at the same station, for example in presence of a flap.")
135+
self.add_input("airfoils_cm", val=np.zeros((n_af, n_aoa, n_Re)), desc="4D array with the moment coefficients of the airfoils. Dimension 0 is along the different airfoils defined in the yaml, dimension 1 is along the angles of attack, dimension 2 is along the Reynolds number, dimension 3 is along the number of tabs, which may describe multiple sets at the same station, for example in presence of a flap.")
138136
self.add_input("rotor_powercurve_v", val=np.zeros(n_pc), units="m/s", desc="wind vector")
139137
self.add_input("rotor_powercurve_omega_rpm", val=np.zeros(n_pc), units="rpm", desc="rotor rotational speed")
140138
self.add_input("rotor_powercurve_pitch", val=np.zeros(n_pc), units="deg", desc="rotor pitch schedule")
@@ -484,12 +482,12 @@ def compute(self, inputs, outputs, discrete_inputs, discrete_outputs):
484482
n_af = turbine_opt['n_af']
485483
design['turbine']['airfoils'] = [dict() for m in range(n_af)] #Note: doesn't work [{}]*n_af
486484
for i in range(n_af):
487-
design['turbine']['airfoils'][i]['name'] = discrete_inputs['airfoils_name'][i]
485+
design['turbine']['airfoils'][i]['name'] = turbine_opt['af_used_names'][i]
488486
design['turbine']['airfoils'][i]['relative_thickness'] = float(inputs['airfoils_r_thick'][i])
489-
design['turbine']['airfoils'][i]['data'] = np.c_[inputs['airfoils_aoa'] * raft.helpers.rad2deg(1),
490-
inputs['airfoils_cl'][i,:,0,0],
491-
inputs['airfoils_cd'][i,:,0,0],
492-
inputs['airfoils_cm'][i,:,0,0]]
487+
design['turbine']['airfoils'][i]['data'] = np.c_[inputs['airfoils_aoa'],
488+
inputs['airfoils_cl'][i,:,0],
489+
inputs['airfoils_cd'][i,:,0],
490+
inputs['airfoils_cm'][i,:,0]]
493491

494492
# Control
495493
design['turbine']['pitch_control'] = {}

0 commit comments

Comments
 (0)