From fbd0797826f305f5ec48c00051804800800f255f Mon Sep 17 00:00:00 2001 From: Kiefer Date: Fri, 7 Jul 2023 09:51:42 -0600 Subject: [PATCH] Add sources to test files, Update floating cost to match ORBIT Technical report and update to test file --- hopp/offshore/floating_platform.py | 2 +- tests/hopp/test_offshore/test_offshore.py | 8 +++++++- .../hopp/test_offshore/test_offshore_floating.py | 15 ++++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/hopp/offshore/floating_platform.py b/hopp/offshore/floating_platform.py index b7beaaf84..e4a6af385 100644 --- a/hopp/offshore/floating_platform.py +++ b/hopp/offshore/floating_platform.py @@ -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 diff --git a/tests/hopp/test_offshore/test_offshore.py b/tests/hopp/test_offshore/test_offshore.py index e90322ca5..f6dda63cb 100644 --- a/tests/hopp/test_offshore/test_offshore.py +++ b/tests/hopp/test_offshore/test_offshore.py @@ -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" @@ -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 @@ -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 @@ -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 diff --git a/tests/hopp/test_offshore/test_offshore_floating.py b/tests/hopp/test_offshore/test_offshore_floating.py index 8c7633913..661a1ba1d 100644 --- a/tests/hopp/test_offshore/test_offshore_floating.py +++ b/tests/hopp/test_offshore/test_offshore_floating.py @@ -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" @@ -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 @@ -33,7 +38,7 @@ 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 @@ -41,13 +46,13 @@ def test_calc_substructure_cost(config): 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