Skip to content

Commit

Permalink
Add sources to test files, Update floating cost to match ORBIT Techni…
Browse files Browse the repository at this point in the history
…cal report and update to test file
  • Loading branch information
Kiefer committed Jul 7, 2023
1 parent f26ee0d commit fbd0797
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hopp/offshore/floating_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def calc_substructure_mass_and_cost(mass, area, depth, fab_cost_rate=14500., des
mooring_mass = (line_mass + anchor_mass)*num_lines #kg

'''Total Platform capex = capex Topside + capex substructure'''
total_capex = (topside_cost + substructure_cost + mooring_cost)
total_capex = 2*(topside_cost + substructure_cost + mooring_cost)
platform_capex = total_capex # USD
platform_mass = substructure_total_mass + topside_mass + mooring_mass/1000 # t
#mass of equipment and floating substructure for substation
Expand Down
8 changes: 7 additions & 1 deletion tests/hopp/test_offshore/test_offshore.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
from ORBIT import load_config
from hopp.offshore.fixed_platform import install_platform, calc_platform_opex, calc_substructure_mass_and_cost

'''https://www.nrel.gov/docs/fy17osti/66874.pdf'''
'''Sources:
- [1] 2017 ORBIT Technical Report: https://www.nrel.gov/docs/fy17osti/66874.pdf
'''

@pytest.fixture
def config():
offshore_path = Path(__file__).parents[3] / "hopp" / "offshore"
Expand All @@ -15,6 +18,7 @@ def config():
def test_install_platform(config):
'''
Test the code that calculates the platform installation cost
[1]: equations (91),(113),(98)
'''
distance = 24
mass = 2100
Expand All @@ -27,6 +31,7 @@ def test_install_platform(config):
def test_calc_substructure_cost(config):
'''
Test the code that calculates the CapEx from fixed_platform.py
[1]: equations (81),(83),(84)
'''
topmass = 200
toparea = 1000
Expand All @@ -39,6 +44,7 @@ def test_calc_substructure_cost(config):
def test_calc_substructure_mass(config):
'''
Test the code that calculates the CapEx from fixed_platform.py
[1]: equations (81),(83),(84)
'''
topmass = 200
toparea = 1000
Expand Down
15 changes: 10 additions & 5 deletions tests/hopp/test_offshore/test_offshore_floating.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
from ORBIT.core.library import initialize_library
from ORBIT.phases.design import DesignPhase
from ORBIT.phases.install import InstallPhase
#from hopp.offshore.floating_platform import FloatingPlatformDesign
'''Values for these asserts were used using the equations from https://www.nrel.gov/docs/fy17osti/66874.pdf'''


'''Sources:
- [1] 2017 ORBIT Technical Report: https://www.nrel.gov/docs/fy17osti/66874.pdf
'''

@pytest.fixture
def config():
offshore_path = Path(__file__).parents[3] / "hopp" / "offshore"
Expand All @@ -21,6 +25,7 @@ def config():
def test_install_platform(config):
'''
Test the code that calculates the platform installation cost
[1]: equations (91),(113),(98)
'''
distance = 24
mass = 2100
Expand All @@ -33,21 +38,21 @@ def test_install_platform(config):
def test_calc_substructure_cost(config):
'''
Test the code that calculates the CapEx from floating_platform.py
[1]: equations (81),(83),(84)
'''
topmass = 200
toparea = 1000
depth = 500

cost,_ = calc_substructure_mass_and_cost(topmass, toparea, depth,fab_cost_rate=14500, design_cost=4500000, sub_cost_rate=3000, line_cost=850000, anchor_cost=120000, anchor_mass=20, line_mass=100000, num_lines=4)

assert pytest.approx(cost) == 11520000
assert pytest.approx(cost) == 23040000


def test_calc_substructure_mass(config):
'''
Test the code that calculates the CapEx from floating_platform.py
[1]: equations (81),(83),(84)
'''
topmass = 200
toparea = 1000
Expand Down

0 comments on commit fbd0797

Please sign in to comment.