Skip to content

Commit

Permalink
correct merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredthomas68 committed Aug 1, 2023
2 parents 677fd38 + 2f16f70 commit 1d2ec16
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 25 deletions.
1 change: 0 additions & 1 deletion hopp/eco/electrolyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def run_electrolyzer_physics(

adjusted_installed_cost = hybrid_plant.grid._financial_model.Outputs.adjusted_installed_cost
#NB: adjusted_installed_cost does NOT include the electrolyzer cost
print("ADJ. INST. COST ", adjusted_installed_cost)
# system_rating = electrolyzer_size
system_rating = wind_size_mw + solar_size_mw
H2_Results, H2A_Results = run_h2_PEM(energy_to_electrolyzer_kw, electrolyzer_size_mw,
Expand Down
54 changes: 37 additions & 17 deletions hopp/eco/hydrogen_mgmt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import numpy as np
import pandas as pd

from ORBIT import ProjectManager, load_config
from ORBIT.core import Vessel
from ORBIT.core.library import initialize_library
from ORBIT.phases.design import DesignPhase
from ORBIT.phases.install import InstallPhase

from hopp.simulation.technologies.hydrogen.h2_transport.h2_compression import Compressor
from hopp.simulation.technologies.hydrogen.h2_storage.pressure_vessel.compressed_gas_storage_model_20221021.Compressed_all import PressureVessel
from hopp.simulation.technologies.hydrogen.h2_storage.pipe_storage import (
Expand All @@ -9,15 +15,15 @@
from hopp.simulation.technologies.hydrogen.h2_storage.on_turbine.on_turbine_hydrogen_storage import (
PressurizedTower,
)

from hopp.simulation.technologies.hydrogen.h2_transport.h2_export_pipe import run_pipe_analysis
from hopp.simulation.technologies.hydrogen.h2_transport.h2_pipe_array import run_pipe_array_const_diam
from hopp.simulation.technologies.offshore.fixed_platform import (
install_platform,
calc_platform_opex,
calc_substructure_mass_and_cost,
FixedPlatformDesign,
FixedPlatformInstallation,
calc_platform_opex
)


def run_h2_pipe_array(
plant_config, orbit_project, electrolyzer_physics_results, design_scenario, verbose
):
Expand Down Expand Up @@ -435,32 +441,46 @@ def run_equipment_platform(
) # from kg to tonnes
toparea += h2_storage_results["tank_footprint_m2"]

distance = plant_config["site"]["distance_to_landfall"]
#### initialize
if not ProjectManager.find_key_match("FixedPlatformDesign"):
ProjectManager.register_design_phase(FixedPlatformDesign)
if not ProjectManager.find_key_match("FixedPlatformInstallation"):
ProjectManager.register_install_phase(FixedPlatformInstallation)

installation_cost = install_platform(
topmass,
toparea,
distance,
install_duration=plant_config["platform"]["installation_days"],
)
platform_config = plant_config["platform"]

depth = plant_config["site"]["depth"] # depth of pipe [m]
# assign site parameters
if platform_config["site"]["depth"] == -1:
platform_config["site"]["depth"] = plant_config["site"]["depth"]
if platform_config["site"]["distance"] == -1:
platform_config["site"]["distance"] = plant_config["site"]["distance"]
# assign equipment values

if platform_config["equipment"]["tech_combined_mass"] == -1:
platform_config["equipment"]["tech_combined_mass"] = topmass
if platform_config["equipment"]["tech_required_area"] == -1:
platform_config["equipment"]["tech_required_area"] == toparea
platform = ProjectManager(platform_config)
platform.run()

capex, platform_mass = calc_substructure_mass_and_cost(topmass, toparea, depth)
design_capex = platform.design_results['platform_design']['total_cost']
install_capex = platform.installation_capex
total_capex = design_capex + install_capex

opex_rate = plant_config["platform"]["opex_rate"]
total_opex = calc_platform_opex(capex, opex_rate)
total_opex = calc_platform_opex(total_capex, platform_config["opex_rate"])

total_capex = capex + installation_cost
platform_mass = platform.design_results['platform_design']['mass']
platform_area = platform.design_results['platform_design']['area']

else:
platform_mass = 0.0
platform_area = 0.0
total_capex = 0.0
total_opex = 0.0

platform_results = {
"topmass_kg": topmass,
"toparea_m2": toparea,
"toparea_m2": platform_area,
"platform_mass_tonnes": platform_mass,
"capex": total_capex,
"opex": total_opex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ def mass(rating_mw):

mass_kg = _electrolyzer_mass_fit(rating_mw, m, b)

print("m, b :", m, " ", b)

return mass_kg

if __name__ == "__main__":
Expand Down
9 changes: 4 additions & 5 deletions hopp/simulation/technologies/offshore/fixed_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def run(self):

_platform = self.config.get('equipment',{})

self.mass = _platform.get('tech_comnined_mass',999) # t
self.mass = _platform.get('tech_combined_mass',999) # t
self.area = _platform.get('tech_required_area', 1000) # m**2

design_cost = _platform.get('topside_design_cost', 4.5e6) # USD
Expand All @@ -107,7 +107,7 @@ def run(self):
total_cost, total_mass = calc_substructure_mass_and_cost(self.mass, self.area,
self.depth, fab_cost, design_cost, steel_cost
)

# Create an ouput dict
self._outputs['fixed_platform'] = {
"mass" : total_mass,
Expand Down Expand Up @@ -200,9 +200,9 @@ def setup_simulation(self, **kwargs):
self.depth, fab_cost, design_cost, steel_cost
)

total_mass = substructure_mass # t
self.total_mass = substructure_mass # t
# Call the install_platform function
self.install_capex = install_platform(total_mass, self.area, self.distance, \
self.install_capex = install_platform(self.total_mass, self.area, self.distance, \
install_duration, self.install_vessel)

# An install object needs to have attribute system_capex, installation_capex, and detailed output
Expand Down Expand Up @@ -331,7 +331,6 @@ def calc_platform_opex(capex, opex_rate=0.011):
config_path = os.path.abspath(__file__)
config_fname = load_config(os.path.join(config_path, os.pardir, "example_fixed_project.yaml"))


ProjectManager.register_design_phase(FixedPlatformDesign)

ProjectManager.register_install_phase(FixedPlatformInstallation)
Expand Down

0 comments on commit 1d2ec16

Please sign in to comment.