Skip to content

Commit

Permalink
Merge pull request #353 from RHammond2/enhancement/upgrade_orbit
Browse files Browse the repository at this point in the history
Enhancement: Upgrade ORBIT to v1.1
  • Loading branch information
RHammond2 authored Oct 15, 2024
2 parents db2e65a + efa424b commit d651ce0
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10" ]
python-version: [ "3.9", "3.10" ]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.9"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ design_phases:
- SemiSubmersibleDesign # from ORBIT/examples/configs/example_floating_project.yaml
- ElectricalDesign # new addition from Sophie Bradenkamp combined ExportSystemDesign and OffshoreSubstationDesign phases
# - CustomArraySystemDesign
- SemiTautMooringSystemDesign # MooringSystemDesign old system design could use for very deep water but out of date design
- MooringSystemDesign
- OffshoreFloatingSubstationDesign
install_phases:
# Define some dependent start times, ie, Array Cables start when Monopile are 100% complete
Expand Down
22 changes: 12 additions & 10 deletions greenheart/simulation/technologies/offshore/floating_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
Sources:
- [1] ORBIT: https://github.com/WISDEM/ORBIT electrical_refactor branch & SemiTaut_mooring branch
- [1] ORBIT: https://github.com/WISDEM/ORBIT v1.1
Args:
- tech_required_area: (float): area needed for combination of all tech (m^2), not including buffer or working space
- tech_combined_mass: (float): mass of all tech being placed on the platform (kg or tonnes)year
- depth: (float): bathometry at the platform location (m) ##Site depths for floating projects need to be at depths 500 m to 1500 m because of Orbit SemiTaut branch limitations (7/31)
- depth: (float): bathometry at the platform location (m) ##Site depths for floating projects need to be at depths 500 m to 1500 m because of Orbit Semitaut limitations (7/31)
- distance_to_port: (float): distance ships must travel from port to site location (km)
Future arguments: (Not used at this time)
Expand Down Expand Up @@ -43,7 +43,7 @@
from ORBIT.core.library import initialize_library
from ORBIT.phases.design import DesignPhase
from ORBIT.phases.install import InstallPhase
from ORBIT.phases.design import SemiTaut_mooring_system_design
from ORBIT.phases.design import MooringSystemDesign

from scipy.interpolate import interp1d
import numpy as np
Expand Down Expand Up @@ -104,10 +104,11 @@ def run(self):
# Add individual calcs/functions in the run() method
'''Calls in SemiTaut Costs and Variables for Substructure mass and cost'''
self.anchor_type = "Drag Embedment"
self.mooring_type = "Semitaut"
self.num_lines = 4
SemiTaut_mooring_system_design.SemiTautMooringSystemDesign.calculate_line_length_mass(self)
SemiTaut_mooring_system_design.SemiTautMooringSystemDesign.calculate_anchor_mass_cost(self)
SemiTaut_mooring_system_design.SemiTautMooringSystemDesign.determine_mooring_line_cost(self)
MooringSystemDesign.MooringSystemDesign.calculate_line_length_mass(self)
MooringSystemDesign.MooringSystemDesign.calculate_anchor_mass_cost(self)
MooringSystemDesign.MooringSystemDesign.determine_mooring_line_cost(self)
total_cost, total_mass = calc_substructure_mass_and_cost(self.mass, self.area,
self.depth, fab_cost_rate, design_cost, steel_cost,
self.line_cost, self.anchor_cost, self.anchor_mass, self.line_mass, self.num_lines)
Expand Down Expand Up @@ -201,10 +202,11 @@ def setup_simulation(self, **kwargs):

'''Calls in SemiTaut Costs and Variables'''
self.anchor_type = "Drag Embedment"
self.mooring_type = "Semitaut"
self.num_lines = 4
SemiTaut_mooring_system_design.SemiTautMooringSystemDesign.calculate_line_length_mass(self)
SemiTaut_mooring_system_design.SemiTautMooringSystemDesign.calculate_anchor_mass_cost(self)
SemiTaut_mooring_system_design.SemiTautMooringSystemDesign.determine_mooring_line_cost(self)
MooringSystemDesign.MooringSystemDesign.calculate_line_length_mass(self)
MooringSystemDesign.MooringSystemDesign.calculate_anchor_mass_cost(self)
MooringSystemDesign.MooringSystemDesign.determine_mooring_line_cost(self)

_, substructure_mass = calc_substructure_mass_and_cost(self.mass, self.area,
self.depth, fab_cost_rate, design_cost, steel_cost,
Expand Down Expand Up @@ -268,7 +270,7 @@ def calc_substructure_mass_and_cost(mass, area, depth, fab_cost_rate=14500., des
substructure_total_mass = substructure_mass # t

'''Total Mooring cost and mass for the substructure
Line_cost, anchor_cost, line_mass, anchor_mass are grabbed from SemiTaut_mooring_system_design in ORBIT's SemiTaut branch
Line_cost, anchor_cost, line_mass, anchor_mass are grabbed from MooringSystemDesign in ORBIT
Mooring_mass is returned in kilograms and will need to '''
mooring_cost = (line_cost + anchor_cost)*num_lines #USD
mooring_mass = (line_mass + anchor_mass)*num_lines #kg
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ openpyxl
CoolProp
attrs
utm
orbit-nrel @ git+https://github.com/WISDEM/ORBIT.git@3baed36052d7503de6ea6f2db0b40945d637ea35
orbit-nrel>=1.1
electrolyzer @ git+https://github.com/jaredthomas68/electrolyzer.git@smoothing
ProFAST @ git+https://github.com/NREL/ProFAST.git
openmdao[all]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
URL = "https://github.com/NREL/HOPP"
EMAIL = "[email protected]"
AUTHOR = "NREL"
REQUIRES_PYTHON = ">=3.8.0"
REQUIRES_PYTHON = ">=3.9.0"

ROOT = Path(__file__).parent
with open(ROOT / "hopp" / "version.py") as version_file:
Expand Down
16 changes: 8 additions & 8 deletions tests/greenheart/test_greenheart_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ def test_simulation_wind(subtests):

with subtests.test("lcoh"):
assert lcoh == approx(
7.248875250895419
7.509261597149882
) # TODO base this test value on something

with subtests.test("lcoe"):
assert lcoe == approx(
0.10813733018947481
0.11273307417999466
) # TODO base this test value on something

with subtests.test("energy sources"):
Expand Down Expand Up @@ -129,11 +129,11 @@ def test_simulation_wind_wave(subtests):

# TODO base this test value on something
with subtests.test("lcoh"):
assert lcoh == approx(8.228321816022078, rel=rtol)
assert lcoh == approx(8.450558037665157, rel=rtol)

# prior to 20240207 value was approx(0.11051228251811765) # TODO base this test value on something
with subtests.test("lcoe"):
assert lcoe == approx(0.12885017943224733, rel=rtol)
assert lcoe == approx(0.1327684184657075, rel=rtol)


def test_simulation_wind_wave_solar(subtests):
Expand All @@ -159,12 +159,12 @@ def test_simulation_wind_wave_solar(subtests):
# prior to 20240207 value was approx(10.823798551850347)
# TODO base this test value on something. Currently just based on output at writing.
with subtests.test("lcoh"):
assert lcoh == approx(12.719884986359553, rel=rtol)
assert lcoh == approx(12.946208023181846, rel=rtol)

# prior to 20240207 value was approx(0.11035426429749774)
# TODO base this test value on something. Currently just based on output at writing.
with subtests.test("lcoe"):
assert lcoe == approx(0.12865548678206473, rel=rtol)
assert lcoe == approx(0.1325651191367888, rel=rtol)


def test_simulation_wind_wave_solar_battery(subtests):
Expand All @@ -189,12 +189,12 @@ def test_simulation_wind_wave_solar_battery(subtests):

with subtests.test("lcoh"):
# TODO base this test value on something. Currently just based on output at writing.
assert results.lcoh == approx(17.088961197626638, rel=rtol)
assert results.lcoh == approx(17.315152646007785, rel=rtol)

# TODO base this test value on something. Currently just based on output at writing.
with subtests.test("lcoe"):
# TODO base this test value on something. Currently just based on output at writing.
assert results.lcoe == approx(0.1288450595098765, rel=rtol)
assert results.lcoe == approx(0.13275466291379373, rel=rtol)

with subtests.test("no conflict in om cost does not raise warning"):
with warnings.catch_warnings():
Expand Down

0 comments on commit d651ce0

Please sign in to comment.