def bury_array_cables(vessel, sections, breakpoints, **kwargs): """ Simulation for the burial of array cables if configured. Parameters ---------- vessel : Vessel Performing vessel. sections : list List of cable sections that need to be buried at site. breakpoints : list TODO List of string breakpoints. """ installed = 0 total_length = sum(sections) for length in sections: yield position_onsite(vessel, site_position_time=2) yield bury_cable(vessel, length, **kwargs) installed += length breakpoints = check_for_completed_string( vessel, installed, total_length, breakpoints ) vessel.submit_debug_log(message="Array cable burial process completed!")
def install_mooring_systems(vessel, port, distance, depth, systems, **kwargs): """ Logic for the Mooring System Installation Vessel. Parameters ---------- vessel : Vessel Mooring System Installation Vessel port : Port distance : int | float Distance between port and site (km). systems : int Total systems to install. """ n = 0 while n < systems: if vessel.at_port: try: # Get mooring systems from port. yield get_list_of_items_from_port(vessel, port, ["MooringSystem"], **kwargs) except ItemNotFound: # If no items are at port and vessel.storage.items is empty, # the job is done if not vessel.storage.items: vessel.submit_debug_log( message="Item not found. Shutting down.") break # Transit to site vessel.update_trip_data() vessel.at_port = False yield vessel.transit(distance) vessel.at_site = True if vessel.at_site: if vessel.storage.items: system = yield vessel.get_item_from_storage( "MooringSystem", **kwargs) for _ in range(system.num_lines): yield position_onsite(vessel, **kwargs) yield perform_mooring_site_survey(vessel, **kwargs) yield install_mooring_anchor(vessel, depth, system.anchor_type, **kwargs) yield install_mooring_line(vessel, depth, **kwargs) n += 1 else: # Transit to port vessel.at_site = False yield vessel.transit(distance) vessel.at_port = True vessel.submit_debug_log(message="Mooring systems installation complete!")
def dig_array_cables_trench(vessel, distance, **kwargs): """ Simulation for digging a trench for the array cables (if configured). Parameters ---------- vessel : Vessel Performing vessel. distance : int | float Distance between turbines to dig trench for array cable """ yield position_onsite(vessel, site_position_time=2) yield dig_trench(vessel, distance, **kwargs)
def splice_process(vessel, **kwargs): """ A list of tasks representing the entire cable splicing process. Parameters ---------- vessel : Vessel Performing vessel. Requires configured `operational_limits`. """ yield position_onsite(vessel) yield raise_cable(vessel, **kwargs) yield splice_cable(vessel, **kwargs) yield lower_cable(vessel, **kwargs)
def dig_export_cables_trench(vessel, distance, **kwargs): """ Simulation for digging a trench for the export cables (if configured). Parameters ---------- vessel : Vessel Performing vessel. distance : int | float Distance along export cable route to dig trench for cable """ yield position_onsite(vessel, site_position_time=2) yield dig_trench(vessel, distance, **kwargs) vessel.submit_debug_log( message="Export cable trench digging process completed!")
def install_array_cables( vessel, distance, cable_data, num_strings, burial_vessel=None, trench_vessel=None, free_cable_length=None, **kwargs, ): """ Simulation of the installation of array cables. Parameters ---------- vessel : Vessel Cable installation vessel. cable_data : list List of tuples containing `Cable` instances and sections. num_strings : int Number of array system strings. Used for partial generation assumptions for the post-processed cash flow model. burial_vessel : Vessel Optional configuration for burial vessel. If configured, the installation vessel only lays the cable on the seafloor and this vessel will bury them at the end of the simulation. trench_vessel: Vessel Optional configuration for trenching vessel. If configured, the trenching vessel travels along the cable route prior to arrival of the cable lay vessel and digs a trench. """ breakpoints = list(np.linspace(1 / num_strings, 1, num_strings)) trench_sections = [] total_cable_length = 0 installed = 0 for cable, sections in cable_data: for s in sections: l, num_i, *_ = s total_cable_length += l * num_i _trench_length = max(0, l - 2 * free_cable_length) if _trench_length: trench_sections.extend([_trench_length] * num_i) ## Trenching Process # Conduct trenching along cable routes before laying cable if trench_vessel is None: pass else: # Conduct trenching operations while True: if trench_vessel.at_port: trench_vessel.at_port = False yield trench_vessel.transit(distance, **kwargs) trench_vessel.at_site = True elif trench_vessel.at_site: try: # Dig trench along each cable section distance trench_distance = trench_sections.pop(0) yield dig_array_cables_trench( trench_vessel, trench_distance, **kwargs ) except IndexError: trench_vessel.at_site = False yield trench_vessel.transit(distance, **kwargs) trench_vessel.at_port = True break vessel.submit_debug_log( message="Array cable trench digging process completed!" ) ## Cable Lay Process to_bury = [] for cable, sections in cable_data: vessel.cable_storage.reset() while True: if vessel.at_port: yield load_cable_on_vessel(vessel, cable, **kwargs) vessel.at_port = False yield vessel.transit(distance, **kwargs) vessel.at_site = True elif vessel.at_site: try: length, num_sections, *extra = sections.pop(0) if extra: speed = extra[0] if burial_vessel is None: specs = {**kwargs, "cable_lay_bury_speed": speed} else: specs = {**kwargs, "cable_lay_speed": speed} else: specs = deepcopy(kwargs) except IndexError: vessel.at_site = False yield vessel.transit(distance, **kwargs) vessel.at_port = True break for _ in range(num_sections): try: section = vessel.cable_storage.get_cable(length) except InsufficientCable: yield vessel.transit(distance, **kwargs) yield load_cable_on_vessel(vessel, cable, **kwargs) yield vessel.transit(distance, **kwargs) section = vessel.cable_storage.get_cable(length) # Prep for cable laying procedure (at substructure 1) yield position_onsite(vessel, **kwargs) yield prep_cable(vessel, **kwargs) yield pull_in_cable(vessel, **kwargs) yield terminate_cable(vessel, **kwargs) yield lower_cable(vessel, **kwargs) # Cable laying procedure if burial_vessel is None: yield lay_bury_cable(vessel, section, **specs) installed += section else: yield lay_cable(vessel, section, **specs) _bury = max(0, (section - 2 * free_cable_length)) if _bury: to_bury.append(_bury) # Post cable laying procedure (at substructure 2) yield prep_cable(vessel, **kwargs) yield pull_in_cable(vessel, **kwargs) yield terminate_cable(vessel, **kwargs) if burial_vessel is None: breakpoints = check_for_completed_string( vessel, installed, total_cable_length, breakpoints ) # Transit back to port vessel.at_site = False yield vessel.transit(distance, **kwargs) vessel.at_port = True ## Burial Process if burial_vessel is None: vessel.submit_debug_log( message="Array cable lay/burial process completed!" ) else: vessel.submit_debug_log(message="Array cable lay process completed!") bury_array_cables(burial_vessel, to_bury, breakpoints, **kwargs)
def install_export_cables( vessel, sections, cable, number, distances, burial_vessel=None, trench_vessel=None, free_cable_length=None, **kwargs, ): """ Simulation of the installation of export cables. Parameters ---------- vessel : Vessel Cable installation vessel. sections : float Section lengths of the export cable. cable : SimpleCable | Cable Cable type to use. number : int Number of export cables. distances : dict Distances required for export cable installation simulation: site : int | float Distance between from the offshore substation and port. For simplicity, the cable landfall point is assumed to be at port. trench : int | float Trench length at landfall. Determines time required to tow the plow and pull-in cable (km). burial_vessel : Vessel Optional configuration for burial vessel. If configured, the installation vessel only lays the cable on the seafloor and this vessel will bury them at the end of the simulation. trench_vessel: Vessel Optional configuration for trenching vessel. If configured, the trenching vessel travels along the cable route prior to arrival of the cable lay vessel and digs a trench. """ ground_distance = -free_cable_length for s in sections: try: length, speed = s except TypeError: length = s ground_distance += length # Conduct trenching operations if trench_vessel is None: pass else: for _ in range(number): # Trenching vessel can dig a trench during inbound or outbound journey if trench_vessel.at_port: trench_vessel.at_port = False yield dig_export_cables_trench(trench_vessel, ground_distance, **kwargs) trench_vessel.at_site = True elif trench_vessel.at_site: trench_vessel.at_site = False yield dig_export_cables_trench(trench_vessel, ground_distance, **kwargs) trench_vessel.at_port = True # If the vessel finishes trenching at site, return to shore # TODO: replace with demobilization method if trench_vessel.at_site: trench_vessel.at_site = False yield trench_vessel.transit(ground_distance, **kwargs) trench_vessel.at_port = True for _ in range(number): vessel.cable_storage.reset() yield load_cable_on_vessel(vessel, cable, **kwargs) # At Landfall yield landfall_tasks(vessel, distances["trench"], **kwargs) for s in sections: splice_required = False try: length, speed = s if burial_vessel is None: specs = {**kwargs, "cable_lay_bury_speed": speed} else: specs = {**kwargs, "cable_lay_speed": speed} except TypeError: length = s specs = deepcopy(kwargs) remaining = length while remaining > 0: if splice_required: yield splice_process(vessel, **kwargs) try: section = vessel.cable_storage.get_cable(remaining) except InsufficientCable as e: section = vessel.cable_storage.get_cable(e.current) if burial_vessel is None: yield lay_bury_cable(vessel, section, **specs) else: yield lay_cable(vessel, section, **specs) remaining -= ceil(section) if remaining > 0: splice_required = True yield vessel.transit(distances["site"]) vessel.cable_storage.reset() yield load_cable_on_vessel(vessel, cable, **kwargs) yield vessel.transit(distances["site"]) # At Site yield position_onsite(vessel, **kwargs) yield pull_in_cable(vessel, **kwargs) yield terminate_cable(vessel, **kwargs) # Transit back to port yield vessel.transit(distances["site"]) if burial_vessel is None: vessel.submit_debug_log( message="Export cable lay/burial process completed!", progress="Export System", ) else: vessel.submit_debug_log(message="Export cable lay process completed!") bury_export_cables(burial_vessel, ground_distance, number, **kwargs)