Skip to content

Commit

Permalink
Merge 0d42675 into fa44234
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter committed Dec 28, 2022
2 parents fa44234 + 0d42675 commit 94a2425
Show file tree
Hide file tree
Showing 49 changed files with 424 additions and 335 deletions.
1 change: 1 addition & 0 deletions environment.yml
Expand Up @@ -17,6 +17,7 @@ dependencies:
- openpyxl
- pandas
- pip
- pydoe2
- pyoptsparse
- pyside2
- pytest
Expand Down
3 changes: 2 additions & 1 deletion examples/01_nrel_csm/costs.py
@@ -1,12 +1,13 @@
# 0 ---------- (marker for docs)
import openmdao.api as om

from wisdem.nrelcsm.nrel_csm_cost_2015 import Turbine_CostsSE_2015

# 0 ---------- (marker for docs)

# 1 ---------- (marker for docs)
# OpenMDAO Problem instance
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = Turbine_CostsSE_2015(verbosity=True)
prob.setup()
# 1 ---------- (marker for docs)
Expand Down
3 changes: 2 additions & 1 deletion examples/01_nrel_csm/mass.py
@@ -1,12 +1,13 @@
# 0 ---------- (marker for docs)
import openmdao.api as om

from wisdem.nrelcsm.nrel_csm_mass_2015 import nrel_csm_mass_2015

# 0 ---------- (marker for docs)

# 1 ---------- (marker for docs)
# OpenMDAO Problem instance
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = nrel_csm_mass_2015()
prob.setup()
# 1 ---------- (marker for docs)
Expand Down
3 changes: 2 additions & 1 deletion examples/01_nrel_csm/mass_and_cost.py
@@ -1,12 +1,13 @@
# 0 ---------- (marker for docs)
import openmdao.api as om

from wisdem.nrelcsm.nrel_csm_mass_2015 import nrel_csm_2015

# 0 ---------- (marker for docs)

# 1 ---------- (marker for docs)
# OpenMDAO Problem instance
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = nrel_csm_2015()
prob.setup()
# 1 ---------- (marker for docs)
Expand Down
5 changes: 3 additions & 2 deletions examples/01_nrel_csm/parametric.py
@@ -1,14 +1,15 @@
# 0 ---------- (marker for docs)
import numpy as np
import openmdao.api as om
from wisdem.nrelcsm.nrel_csm_mass_2015 import nrel_csm_2015

from wisdem.nrelcsm.nrel_csm_orig import aep_csm
from wisdem.nrelcsm.nrel_csm_mass_2015 import nrel_csm_2015

# 0 ---------- (marker for docs)

# 1 ---------- (marker for docs)
# OpenMDAO Problem instance
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = nrel_csm_2015()
prob.setup()

Expand Down
2 changes: 1 addition & 1 deletion examples/05_tower_monopile/monopile_direct.py
Expand Up @@ -72,7 +72,7 @@
# ---

# Instantiate OpenMDAO problem and create a model using the FixedBottomSE group
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = MonopileSE(modeling_options=modeling_options)
# ---

Expand Down
2 changes: 1 addition & 1 deletion examples/05_tower_monopile/tower_direct.py
Expand Up @@ -58,7 +58,7 @@
# ---

# Instantiate OpenMDAO problem and create a model using the TowerSE group
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = TowerSE(modeling_options=modeling_options)
# ---

Expand Down
2 changes: 1 addition & 1 deletion examples/06_drivetrain/drivetrain_direct.py
Expand Up @@ -30,7 +30,7 @@
# ---

# Initialize OpenMDAO problem
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = DrivetrainSE(modeling_options=opt)
# ---

Expand Down
2 changes: 1 addition & 1 deletion examples/06_drivetrain/drivetrain_geared.py
Expand Up @@ -30,7 +30,7 @@
# ---

# Initialize OpenMDAO problem
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = DrivetrainSE(modeling_options=opt)
# ---

Expand Down
3 changes: 2 additions & 1 deletion examples/07_generator/dfig.py
@@ -1,13 +1,14 @@
import numpy as np
import openmdao.api as om

import wisdem.commonse.fileIO as fio
from wisdem.drivetrainse.generator import Generator

opt_flag = False
n_pc = 20

# Example optimization of a generator for costs on a 5 MW reference turbine
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = Generator(design="dfig", n_pc=n_pc)

if opt_flag:
Expand Down
3 changes: 2 additions & 1 deletion examples/07_generator/eesg.py
@@ -1,13 +1,14 @@
import numpy as np
import openmdao.api as om

import wisdem.commonse.fileIO as fio
from wisdem.drivetrainse.generator import Generator

opt_flag = False
n_pc = 20

# Example optimization of a generator for costs on a 5 MW reference turbine
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = Generator(design="eesg", n_pc=n_pc)

if opt_flag:
Expand Down
3 changes: 2 additions & 1 deletion examples/07_generator/pmsg_arms.py
@@ -1,13 +1,14 @@
import numpy as np
import openmdao.api as om

import wisdem.commonse.fileIO as fio
from wisdem.drivetrainse.generator import Generator

opt_flag = False
n_pc = 20

# Example optimization of a generator for costs on a 5 MW reference turbine
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = Generator(design="pmsg_arms", n_pc=n_pc)

if opt_flag:
Expand Down
3 changes: 2 additions & 1 deletion examples/07_generator/pmsg_disc.py
@@ -1,13 +1,14 @@
import numpy as np
import openmdao.api as om

import wisdem.commonse.fileIO as fio
from wisdem.drivetrainse.generator import Generator

opt_flag = False
n_pc = 20

# Example optimization of a generator for costs on a 5 MW reference turbine
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = Generator(design="pmsg_disc", n_pc=n_pc)

if opt_flag:
Expand Down
3 changes: 2 additions & 1 deletion examples/07_generator/pmsg_outer.py
@@ -1,6 +1,7 @@
# Import the modules
import numpy as np
import openmdao.api as om

import wisdem.commonse.fileIO as fio
from wisdem.drivetrainse.generator import Generator

Expand All @@ -15,7 +16,7 @@
n_pc = 20

# Initialize problem instance
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = Generator(design="pmsg_outer", n_pc=n_pc)
# ---

Expand Down
3 changes: 2 additions & 1 deletion examples/07_generator/scig.py
@@ -1,13 +1,14 @@
import numpy as np
import openmdao.api as om

import wisdem.commonse.fileIO as fio
from wisdem.drivetrainse.generator import Generator

opt_flag = False
n_pc = 20

# Example optimization of a generator for costs on a 5 MW reference turbine
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = Generator(design="scig", n_pc=n_pc)

if opt_flag:
Expand Down
3 changes: 2 additions & 1 deletion examples/08_plant_finance/example.py
Expand Up @@ -2,10 +2,11 @@

# Import the libraries
import openmdao.api as om

from wisdem.plant_financese.plant_finance import PlantFinance

# Initialize the OpenMDAO instance
prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = PlantFinance()
prob.setup()

Expand Down
5 changes: 3 additions & 2 deletions examples/09_floating/tlp_example.py
Expand Up @@ -2,6 +2,7 @@

import numpy as np
import openmdao.api as om

from wisdem.commonse import fileIO
from wisdem.floatingse import FloatingSE

Expand Down Expand Up @@ -48,7 +49,7 @@
opt["materials"] = {}
opt["materials"]["n_mat"] = 2

prob = om.Problem()
prob = om.Problem(reports=False)
prob.model = FloatingSE(modeling_options=opt)
prob.setup()

Expand All @@ -72,7 +73,7 @@
prob["member0.outfitting_factor_in"] = 1.05 # Fraction of additional outfitting mass for each column
prob["member0.grid_axial_joints"] = []
prob["member0.ballast_grid"] = np.array([[0, 0.25], [0, 0.5]])
prob["member0.ballast_volume"] = [np.pi * 7 ** 2 * 5, 0.0]
prob["member0.ballast_volume"] = [np.pi * 7**2 * 5, 0.0]
prob["member0.s_in"] = np.cumsum(np.r_[0, h]) / h.sum()
prob["member0.outer_diameter_in"] = 14 * np.ones(npts)
prob["member0.layer_thickness"] = 0.05 * np.ones((1, npts))
Expand Down
11 changes: 6 additions & 5 deletions examples/18_rotor_tower_monopile/create_conv_plots.py
@@ -1,12 +1,13 @@
import openmdao.api as om
from wisdem.glue_code.gc_RunTools import PlotRecorder
import wisdem.inputs as sch
import os

import openmdao.api as om

import wisdem.inputs as sch
from wisdem.glue_code.gc_RunTools import PlotRecorder

mydir = os.path.dirname(os.path.realpath(__file__)) # get path to this file
fname_analysis_options = mydir + os.sep + "analysis_options.yaml"
analysis_options = sch.load_analysis_yaml(fname_analysis_options)
wt_opt = om.Problem(model=PlotRecorder(opt_options=analysis_options))
wt_opt = om.Problem(reports=False, model=PlotRecorder(opt_options=analysis_options))
wt_opt.setup(derivatives=False)
wt_opt.run_model()
wt_opt.run_model()
13 changes: 7 additions & 6 deletions wisdem/commonse/wind_wave_drag.py
Expand Up @@ -2,6 +2,7 @@

import numpy as np
import openmdao.api as om

from wisdem.commonse.akima import Akima
from wisdem.commonse.csystem import DirectionVector
from wisdem.commonse.utilities import cosd, sind # , linspace_with_deriv, interp_with_deriv, hstack, vstack
Expand Down Expand Up @@ -275,7 +276,7 @@ def compute(self, inputs, outputs):
beta = inputs["beta_wind"]

# dynamic pressure
q = 0.5 * rho * U ** 2
q = 0.5 * rho * U**2

# Reynolds number and drag
if float(inputs["cd_usr"]) < 0.0:
Expand Down Expand Up @@ -310,7 +311,7 @@ def compute_partials(self, inputs, J):
beta = inputs["beta_wind"]

# dynamic pressure
q = 0.5 * rho * U ** 2
q = 0.5 * rho * U**2

# Reynolds number and drag
if float(inputs["cd_usr"]) < 0.0:
Expand Down Expand Up @@ -457,7 +458,7 @@ def compute(self, inputs, outputs):
dcd_dRe = 0.0

# inertial and drag forces
Fi = rho * inputs["cm"] * math.pi / 4.0 * d ** 2 * inputs["A"] # Morrison's equation
Fi = rho * inputs["cm"] * math.pi / 4.0 * d**2 * inputs["A"] # Morrison's equation
Fd = q * cd * d
Fp = Fi + Fd

Expand Down Expand Up @@ -515,7 +516,7 @@ def compute_partials(self, inputs, J):
# beta0 = inputs['beta0']

# dynamic pressure
q = 0.5 * rho * U ** 2
q = 0.5 * rho * U**2
# q0= 0.5*rho*U0**2

# Reynolds number and drag
Expand All @@ -537,7 +538,7 @@ def compute_partials(self, inputs, J):
dPx_dd = const * cosd(beta)
dPy_dd = const * sind(beta)

const = rho * inputs["cm"] * math.pi / 4.0 * d ** 2
const = rho * inputs["cm"] * math.pi / 4.0 * d**2
dPx_dA = const * cosd(beta)
dPy_dA = const * sind(beta)

Expand Down Expand Up @@ -655,7 +656,7 @@ def main():

nPoints = len(z)

prob = om.Problem()
prob = om.Problem(reports=False)

root = prob.model = om.Group()

Expand Down

0 comments on commit 94a2425

Please sign in to comment.