Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user-defined OpenFAST mapping and groups through modeling options #331

Merged
merged 13 commits into from
Jan 10, 2025
Merged
52 changes: 49 additions & 3 deletions docs/dlc_generator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,55 @@ The azimuth position at time of occurrence of the fault is randomly selected.



.. ------------------------
.. User-defined DLC Example
.. ------------------------
-------------------------------------------------------
User-defined mapping and groups in the modeling options
-------------------------------------------------------

WEIS uses generic input names to define DLCs, which are mapped to OpenFAST inputs with the ``openfast_input_map`` in the ``DLC_Generator`` class.
Many inputs are hard-coded, but users can add to the mapping in the modeling options, as in the following example::
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a better way of saying this could be:
"Many commonly used inputs are included by default, but users can add...."


openfast_input_map:
final_pitch_angle:
- [ServoDyn,BlPitchF(1)]
- [ServoDyn,BlPitchF(2)]
- [ServoDyn,BlPitchF(3)]
mean_sea_level: [Fst,MSL2SWL]
wave_dir: [HydroDyn,WaveDir]
current_model: [HydroDyn,CurrMod]
current_speed: [HydroDyn,CurrDIV]

Users can map generic inputs, like ``mean_sea_level`` to a specific OpenFAST input specified by the ``[module,input]``.
Users can also map generic inputs to multiple OpenFAST inputs, like ``final_pitch_angle`` which is mapped to ``BlPitchF(1)``, ``BlPitchF(2)``, and ``BlPitchF(3)`` in ServoDyn.

This mapping is helpful for users to define additional groups that will alter individual DLCs or sweep additional parameters.
Let's consider the following example::

DLCs:
- DLC: "1.6"
wind_speed: [8,15]
n_seeds: 2
analysis_time: 1.
transient_time: 0.0
user_group:
- mean_sea_level: [1.0, 2.0]
current_speed: [.25, .5]
- current_model: 1
- DLC: "5.1"
wind_speed: [12]
n_seeds: 1
n_azimuth: 1
analysis_time: 20.
shutdown_time: 10.
transient_time: 0.0
user_group:
final_blade_pitch: [70,80,90]

In DLC 5.1, the user is sweeping the ``final_blade_pitch`` (defined earlier) over 3 different angles.

In DLC 1.6, the users has defined multiple groups over which to alter only that load case.
For each DLC 1.6 simulation, a simulation will be generated with a ``mean_sea_level`` of 1.0 and 2.0 m.
The ``current_speed`` will change along with the ``mean_sea_level`` because it is in the same group.
The ``current_model``, because it is a single value, will alter all of the simulations in DLC 1.6 to hold the value of 1.


------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/inputs/geometry_schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Significant effort has been invested to develop an _ontology_ for wind turbines
Full documentation of the WISDEM geometry input file can be found at the `WindIO documentation <https://windio.readthedocs.io/en/latest/source/turbine.html>`_


.. .. jsonschema:: geometry_schema.json
.. :hide_key_if_empty: /**/default
.. jsonschema:: geometry_schema.json
:hide_key_if_empty: /**/default

16 changes: 16 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Requirements list for WEIS

# simulation
matplotlib
numpy
scipy
openmdao>=3.2
simpy
marmot-agents

# docs
sphinx>2.0
numpydoc
sphinxcontrib-bibtex<2.0.0
sphinx-rtd-theme
# sphinx-autoapi
23 changes: 19 additions & 4 deletions examples/02_run_openfast_cases/modeling_options_loads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,32 @@ DLC_driver:
wave_period1: 11.2
wave_height50: 9.7
wave_period50: 13.6
openfast_input_map:
final_blade_pitch12:
- [ServoDyn,BlPitchF(1)]
- [ServoDyn,BlPitchF(2)]
mean_sea_level: [Fst,MSL2SWL]
wave_dir: [HydroDyn,WaveDir]
current_model: [HydroDyn,CurrMod]
current_speed: [HydroDyn,CurrDIV]

DLCs:
- DLC: "1.6"
wind_speed: [8,15]
n_seeds: 2
analysis_time: 10.
analysis_time: 1.
transient_time: 0.0
user_group:
- mean_sea_level: [1.0, 2.0]
current_speed: [.25, .5]
- current_model: 1
- DLC: "5.1"
wind_speed: [12]
n_seeds: 1
n_azimuth: 3
analysis_time: 20.
shutdown_time: 10.
n_azimuth: 1
analysis_time: 10.
shutdown_time: 5.
transient_time: 0.0
user_group:
final_blade_pitch12: [70,80,90]

1 change: 1 addition & 0 deletions weis/aeroelasticse/openmdao_openfast.py
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,7 @@ def run_FAST(self, inputs, discrete_inputs, fst_vt):
fix_wind_seeds,
fix_wave_seeds,
metocean,
modopt['DLC_driver'],
initial_condition_table,
)
# Generate cases from user inputs
Expand Down
Loading
Loading