Skip to content

Wave inputs required for onshore DLC 1.2 #472

Description

@Rian-Bitencourt

While using WEIS for onshore OpenFAST simulations, I noticed that the DLC generation workflow still required several wave/metocean inputs, even when hydrodynamics were disabled. In particular, DLC 1.2 required fatigue-related wave fields such as wave_height_fatigue, wave_period_fatigue, and wave_direction_fatigue. This seemed weird for onshore cases, where no wave loading should be involved.

From what I understood, gc_LoadInputs.py passed metocean_conditions directly to DLCGenerator, without checking whether the case was onshore or whether HydroDyn/SeaState was active. Then, inside dlc_generator.py, DLC 1.2 explicitly checked for wave-related fatigue entries and raised an exception if they were missing. As a result, to run onshore DLC 1.2 cases, I was forced to use artificial wave inputs, even though these inputs were not physically relevant.

In the dlc_generator.py, DLC 1.2 required the following metocean fields:

 def generate_1p2(self, dlc_options):
    # Power production normal turbulence model - fatigue loads
    
    # Get default options
    dlc_options.update(self.default_options)   

    # Error catching
    entries = [
        'wave_height_fatigue',
        'wave_period_fatigue',
        'wind_direction_fatigue',
        'wave_direction_fatigue',
        'probability',
    ]

    # Check for required inputs
    for input in entries + ['wind_speed_fatigue']:
        if len(self.metocean[input]) == 0:
            raise Exception(f'DLC 1.2 is selected, but the input {input} is required and missing from modeling.DLC_Driver.metocean')

This means that wave-related fatigue data were mandatory for DLC 1.2, regardless of whether the model was offshore or onshore. Since I am currently working on a specific onshore turbine with DLC 1.2 case, and I am not fully sure what the ideal way to handle this situation in WEIS would be, I decided to implement a simple defensive workaround. The main goal was to avoid having to manually define meaningless wave inputs for onshore cases. To do that, I added a preprocessing step in gc_LoadInputs.py. The idea was to automatically populate dummy wave/metocean fields when HydroDyn is disabled.

if self.modeling_options["OpenFAST"]["hydro"].get("CompHydro", 1) == 0:
    n_ws = len(metocean["wind_speed"])

    metocean["wave_height_NSS"] = [0.0] * n_ws
    metocean["wave_period_NSS"] = [1.0] * n_ws
    metocean["wave_height_SSS"] = [0.0] * n_ws
    metocean["wave_period_SSS"] = [1.0] * n_ws

    metocean["wave_height_fatigue"] = [0.0] * n_ws
    metocean["wave_period_fatigue"] = [1.0] * n_ws
    metocean["wave_direction_fatigue"] = [0.0] * n_ws
    metocean["wind_direction_fatigue"] = [0.0] * n_ws

    metocean["wave_height50"] = 0.0
    metocean["wave_period50"] = 1.0
    metocean["wave_height1"] = 0.0
    metocean["wave_period1"] = 1.0

    metocean["probability"] = [1.0 / n_ws] * n_ws
    metocean["wind_speed_fatigue"] = list(metocean.get("wind_speed"))

Note: The dummy values were chosen to be neutral for onshore cases and the period was set to 1.0 instead of 0.0 to avoid possible zero-period numerical or validation issues.

I also added a second protection directly inside generate_1p2() to auto-fill missing fatigue fields before the original DLC 1.2 validation logic is reached:

  n_ws = len(self.metocean.get("wind_speed", []))
  
  self.metocean.setdefault(
      "wind_speed_fatigue",
      list(self.metocean.get("wind_speed", []))
  )
  
  self.metocean.setdefault("wave_height_fatigue", [0.0] * n_ws)
  self.metocean.setdefault("wave_period_fatigue", [1.0] * n_ws)
  self.metocean.setdefault("wind_direction_fatigue", [0.0] * n_ws)
  self.metocean.setdefault("wave_direction_fatigue", [0.0] * n_ws)
  self.metocean.setdefault("probability", [1.0 / n_ws] * n_ws)

This is mainly a local and defensive workaround, not necessarily what I would consider the ideal long-term solution. It is now working for my current onshore DLC 1.2 case, but I would appreciate any guidance on whether there is already an intended mechanism in WEIS to handle this situation more cleanly.

It is also possible that I misunderstood part of the DLC/metocean workflow. If this is indeed a relevant topic, I would be happy to share more details, including the input files and the specific code sections I modified.

Thank you in advance for any guidance on this. In any case, thanks for all the great work on WEIS, it is a very useful tool :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions