Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
d88ee46
Add interface for Hercules in LongSim mode.
misi9170 Apr 23, 2025
5428209
Reorganize Hercules interfaces library
misi9170 Apr 29, 2025
e3e3930
Add ramp rate option. Not yet tested.
misi9170 May 5, 2025
70dcf3a
Merge changes from develop
misi9170 Jun 9, 2025
495885c
Rename as v1 and v2 in anticipation of upcoming Hercules release
misi9170 Jul 1, 2025
0ed29b7
Reorganize Hercules interface tests and add v2 Hercules tests.
misi9170 Jul 1, 2025
bcea874
Building out hybrid interface and test
misi9170 Jul 1, 2025
a2d59ab
Fix import ordering
misi9170 Jul 1, 2025
54a5d28
Update hybrids interface and add tests/
misi9170 Jul 2, 2025
d2e3183
Merge develop and resolve conflicts.
misi9170 Jul 2, 2025
e85b061
Update imports in examples
misi9170 Jul 2, 2025
c439dc1
Explicit naming for wind-only interface
misi9170 Jul 4, 2025
f7b4d59
Create base Hercules interface and save controller and plant paramete…
misi9170 Jul 4, 2025
d64a23c
Ruff formatting
misi9170 Jul 4, 2025
18f5b11
Add in outline of controller; not yet tested
misi9170 Jul 4, 2025
9eef950
Rename to respect conventions
misi9170 Jul 4, 2025
c599f21
Merge branch 'feature/long-run-interface' into feature/split-hybrid-c…
misi9170 Jul 4, 2025
35c3ba4
Add to controllers import
misi9170 Jul 4, 2025
c251bc2
Pull in most changes to v2 interfaces from paulf81 branch
misi9170 Jul 18, 2025
3be2fef
Pull in changes from paulf81 branch
misi9170 Jul 18, 2025
a8abf3a
Comments added to note possible issues
misi9170 Jul 24, 2025
d623f8f
Can safely remove yaw_angles since HerculesADInterface will set these…
misi9170 Jul 25, 2025
4958404
dt as a variable on interface
misi9170 Jul 25, 2025
d456c47
Reignore input csvs that are generated at runtime
misi9170 Jul 25, 2025
a4a42e3
Update tests and implement fixes
misi9170 Jul 25, 2025
c07eb17
Temp update controller to work with LongRun
misi9170 Jul 28, 2025
e61cc4e
Get component capacities from plant_parameters and size mismatch erro…
misi9170 Jul 28, 2025
49500e3
num_turbines -> n_turbines, power_setpoints -> wind_power_setpoints
misi9170 Jul 29, 2025
3bfb2b7
Fix tests where appropriate
misi9170 Jul 29, 2025
8be9dc8
power_references update (not complete, likely breaks examples and tests)
misi9170 Jul 29, 2025
8f5e6a2
remove Hercules-specific code and switch to using plant_parameters
misi9170 Jul 30, 2025
9a68d7b
Line length fix
misi9170 Jul 30, 2025
efbdab1
Add plant_parameters to HerculesADInterface; make minor fixes through…
misi9170 Jul 30, 2025
ea61f4d
Update power setpoints key to match hercules
misi9170 Aug 7, 2025
927b3eb
Update tests to reflect herc v2 update
misi9170 Aug 7, 2025
3af9f1d
Add support for batteries to v2 hybrid controller (#73)
paulf81 Aug 19, 2025
240cbc1
allow battery only hybrid control
paulf81 Sep 16, 2025
e8b16eb
Add tests
misi9170 Oct 1, 2025
3161916
Set up with passing subdicts, but this has some issues.
misi9170 Oct 8, 2025
1c3e414
Move to everyone-gets-everything measurements model
misi9170 Oct 8, 2025
c69a4ca
Refactor hybrid controllers with shared base
misi9170 Oct 8, 2025
045990a
Start FFInterface
abhineet-gupta Aug 18, 2025
6b23a54
Saving Progress
abhineet-gupta Aug 25, 2025
d00286d
Adding FAST Farm files
abhineet-gupta Aug 25, 2025
c1e5e07
Save progress
abhineet-gupta Aug 26, 2025
c503e3b
save progress
abhineet-gupta Aug 29, 2025
1e39115
Making file smatch with v2
abhineet-gupta Oct 6, 2025
698d4de
Saving progress
abhineet-gupta Oct 12, 2025
0bfaa3e
Saving progress
abhineet-gupta Oct 21, 2025
54607b4
Merge remote-tracking branch 'upstream/main' into FFInterface
abhineet-gupta Feb 20, 2026
220e654
Saving progress
abhineet-gupta Feb 20, 2026
894592e
Saving progress
abhineet-gupta Feb 25, 2026
5bf04ef
Modify FF example
abhineet-gupta Feb 26, 2026
478f5d6
Add interface and emulator
abhineet-gupta Feb 26, 2026
f46b631
Merge remote-tracking branch 'upstream/develop' into FFInterface
abhineet-gupta Feb 27, 2026
bd53d8f
Revert unwanted changes
abhineet-gupta Feb 27, 2026
b4af2fd
Cleaning up
abhineet-gupta Feb 27, 2026
1a55281
Cleaning up tests directory
abhineet-gupta Feb 27, 2026
6f8981f
Cleaning up some file
abhineet-gupta Feb 27, 2026
9b1b5d9
Remove unwanted files
abhineet-gupta Feb 27, 2026
3b87cd2
Satisfy Ruff requirements
abhineet-gupta Feb 27, 2026
499a6ec
Format files using ruff
abhineet-gupta Feb 27, 2026
fb2b6f2
Add rosco as dependency
abhineet-gupta Feb 27, 2026
f55e403
Remove generation of summary files from fast.farm
abhineet-gupta Mar 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ examples/lookup-based_wake_steering_florisstandin/inputs/amr_standin_data.csv
# Documentation build
docs/_build/

# FAST.Farm output files
*.out
29 changes: 29 additions & 0 deletions examples/FAST.Farm_interface/FF_runscript.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import os

import pandas as pd
from hercules.utilities import load_yaml
from hycon.controllers import LookupBasedWakeSteeringController
from hycon.design_tools.wake_steering_design import compute_hysteresis_zones
from hycon.interfaces.rosco_zmq_interface import ROSCO_Emulator, ROSCO_ZMQInterface

input_dict = load_yaml(os.path.join("inputs", "hercules_input.yaml"))

use_hysteresis = False

# Load the optimal yaw angle lookup table for controller use.
df_opt = pd.read_pickle(os.path.join("inputs", "yaw_offsets.pkl"))

# Optionally, add hysteresis
if use_hysteresis:
hysteresis_dict = compute_hysteresis_zones(df_opt, min_zone_width=8.0, verbose=True)
else:
hysteresis_dict = None

interface = ROSCO_ZMQInterface(input_dict)
controller = LookupBasedWakeSteeringController(
interface, input_dict, df_yaw=df_opt, hysteresis_dict=hysteresis_dict, verbose=True
)
# interface.addcontroller(controller)

emulator = ROSCO_Emulator(interface, controller)
emulator.startserverandsim()
57 changes: 57 additions & 0 deletions examples/FAST.Farm_interface/construct_yaw_offsets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import argparse
import os

import numpy as np
import pandas as pd
import yaml
from floris import FlorisModel
from hycon.design_tools.wake_steering_design import build_simple_wake_steering_lookup_table

with open(os.path.join("inputs", "gch_whoc_example.yaml"), "r") as f:
floris_dict = yaml.safe_load(f)

if __name__ == "__main__":
# Handle inputs
parser = argparse.ArgumentParser()
parser.add_argument("--yaw_offset_filename", default="yaw_offsets.pkl")
parser.add_argument("--input_wind_filename", default="amr_standin_data.csv")

args = parser.parse_args()

fmodel = FlorisModel(floris_dict)

df_opt = build_simple_wake_steering_lookup_table(
fmodel,
wd_resolution=3.0,
ws_resolution=1.0,
ws_min=2.0,
ws_max=17.0,
minimum_yaw_angle=-25.0,
maximum_yaw_angle=25.0,
)

print("Optimization results:")
print(df_opt)

df_opt.to_pickle(args.yaw_offset_filename)

# Also, build an example external data file
total_time = 100 # seconds
dt = 0.5
np.random.seed(0)
wind_directions = np.concatenate(
(
260 * np.ones(60),
np.linspace(260.0, 270.0, 80),
270.0 + 5.0 * np.random.randn(round(total_time / dt) - 60 - 80),
)
)
df_data = pd.DataFrame(
data={
"time": np.arange(0, total_time, dt),
"amr_wind_speed": 8.0 * np.ones_like(wind_directions),
"amr_wind_direction": wind_directions,
}
)

df_data.to_csv(args.input_wind_filename, index=False)
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
------- OpenFAST EXAMPLE INPUT FILE -------------------------------------------
FAST Certification - Test #18: NREL 5.0 MW Baseline Wind Turbine (Onshore)
---------------------- SIMULATION CONTROL --------------------------------------
False Echo - Echo input data to <RootName>.ech (flag)
"FATAL" AbortLevel - Error level when simulation should abort (string) {"WARNING", "SEVERE", "FATAL"}
600 TMax - Total run time (s)
0.00625 DT - Recommended module time step (s)
2 InterpOrder - Interpolation order for input/output time history (-) {1=linear, 2=quadratic}
0 NumCrctn - Number of correction iterations (-) {0=explicit calculation, i.e., no corrections}
99999 DT_UJac - Time between calls to get Jacobians (s)
1000000.0 UJacSclFact - Scaling factor used in Jacobians (-)
---------------------- FEATURE SWITCHES AND FLAGS ------------------------------
1 CompElast - Compute structural dynamics (switch) {1=ElastoDyn; 2=ElastoDyn + BeamDyn for blades}
1 CompInflow - Compute inflow wind velocities (switch) {0=still air; 1=InflowWind; 2=external from OpenFOAM}
2 CompAero - Compute aerodynamic loads (switch) {0=None; 1=AeroDyn v14; 2=AeroDyn v15}
1 CompServo - Compute control and electrical-drive dynamics (switch) {0=None; 1=ServoDyn}
0 CompSeaSt - Compute sea state information (switch) {0=None; 1=SeaState}
0 CompHydro - Compute hydrodynamic loads (switch) {0=None; 1=HydroDyn}
0 CompSub - Compute sub-structural dynamics (switch) {0=None; 1=SubDyn; 2=External Platform MCKF}
0 CompMooring - Compute mooring system (switch) {0=None; 1=MAP++; 2=FEAMooring; 3=MoorDyn; 4=OrcaFlex}
0 CompIce - Compute ice loads (switch) {0=None; 1=IceFloe; 2=IceDyn}
0 MHK - MHK turbine type (switch) {0=Not an MHK turbine; 1=Fixed MHK turbine; 2=Floating MHK turbine}
---------------------- ENVIRONMENTAL CONDITIONS --------------------------------
9.80665 Gravity - Gravitational acceleration (m/s^2)
1.225 AirDens - Air density (kg/m^3)
0 WtrDens - Water density (kg/m^3)
1.464e-05 KinVisc - Kinematic viscosity of working fluid (m^2/s)
335 SpdSound - Speed of sound in working fluid (m/s)
103500 Patm - Atmospheric pressure (Pa) [used only for an MHK turbine cavitation check]
1700 Pvap - Vapour pressure of working fluid (Pa) [used only for an MHK turbine cavitation check]
0 WtrDpth - Water depth (m)
0 MSL2SWL - Offset between still-water level and mean sea level (m) [positive upward]
---------------------- INPUT FILES ---------------------------------------------
"./NRELOffshrBsline5MW_Onshore_ElastoDyn.T1_mod.dat" EDFile - Name of file containing ElastoDyn input parameters (quoted string)
"unused" BDBldFile(1) - Name of file containing BeamDyn input parameters for blade 1 (quoted string)
"unused" BDBldFile(2) - Name of file containing BeamDyn input parameters for blade 2 (quoted string)
"unused" BDBldFile(3) - Name of file containing BeamDyn input parameters for blade 3 (quoted string)
"./NRELOffshrBsline5MW_InflowWind_Steady8mps.dat" InflowFile - Name of file containing inflow wind input parameters (quoted string)
"./NRELOffshrBsline5MW_Onshore_AeroDyn15.dat" AeroFile - Name of file containing aerodynamic input parameters (quoted string)
"./NRELOffshrBsline5MW_Onshore_ServoDyn.T1_mod.dat" ServoFile - Name of file containing control and electrical-drive input parameters (quoted string)
"unused" SeaStFile - Name of file containing sea state input parameters (quoted string)
"./unused" HydroFile - Name of file containing hydrodynamic input parameters (quoted string)
"unused" SubFile - Name of file containing sub-structural input parameters (quoted string)
"unused" MooringFile - Name of file containing mooring system input parameters (quoted string)
"unused" IceFile - Name of file containing ice input parameters (quoted string)
---------------------- OUTPUT --------------------------------------------------
False SumPrint - Print summary data to "<RootName>.sum" (flag)
5 SttsTime - Amount of time between screen status messages (s)
99999 ChkptTime - Amount of time between creating checkpoint files for potential restart (s)
"default" DT_Out - Time step for tabular output (s) (or "default")
0 TStart - Time to begin tabular output (s)
0 OutFileFmt - Format for tabular (time-marching) output file (switch) {0: uncompressed binary [<RootName>.outb], 1: text file [<RootName>.out], 2: binary file [<RootName>.outb], 3: both 1 and 2}
True TabDelim - Use tab delimiters in text tabular output file? (flag) {uses spaces if false}
"ES10.3E2" OutFmt - Format used for text tabular output, excluding the time channel. Resulting field should be 10 characters. (quoted string)
---------------------- LINEARIZATION -------------------------------------------
False Linearize - Linearization analysis (flag)
False CalcSteady - Calculate a steady-state periodic operating point before linearization? [unused if Linearize=False] (flag)
3 TrimCase - Controller parameter to be trimmed {1:yaw; 2:torque; 3:pitch} [used only if CalcSteady=True] (-)
0.001 TrimTol - Tolerance for the rotational speed convergence [used only if CalcSteady=True] (-)
0.01 TrimGain - Proportional gain for the rotational speed error (>0) [used only if CalcSteady=True] (rad/(rad/s) for yaw or pitch; Nm/(rad/s) for torque)
0 Twr_Kdmp - Damping factor for the tower [used only if CalcSteady=True] (N/(m/s))
0 Bld_Kdmp - Damping factor for the blades [used only if CalcSteady=True] (N/(m/s))
2 NLinTimes - Number of times to linearize (-) [>=1] [unused if Linearize=False]
30, 60 LinTimes - List of times at which to linearize (s) [1 to NLinTimes] [used only when Linearize=True and CalcSteady=False]
1 LinInputs - Inputs included in linearization (switch) {0=none; 1=standard; 2=all module inputs (debug)} [unused if Linearize=False]
1 LinOutputs - Outputs included in linearization (switch) {0=none; 1=from OutList(s); 2=all module outputs (debug)} [unused if Linearize=False]
False LinOutJac - Include full Jacobians in linearization output (for debug) (flag) [unused if Linearize=False; used only if LinInputs=LinOutputs=2]
False LinOutMod - Write module-level linearization output files in addition to output for full system? (flag) [unused if Linearize=False]
---------------------- VISUALIZATION ------------------------------------------
0 WrVTK - VTK visualization data output: (switch) {0=none; 1=initialization data only; 2=animation; 3=mode shapes}
1 VTK_type - Type of VTK visualization data: (switch) {1=surfaces; 2=basic meshes (lines/points); 3=all meshes (debug)} [unused if WrVTK=0]
True VTK_fields - Write mesh fields to VTK data files? (flag) {true/false} [unused if WrVTK=0]
15 VTK_fps - Frame rate for VTK output (frames per second){will use closest integer multiple of DT} [used only if WrVTK=2 or WrVTK=3]
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
------- OpenFAST EXAMPLE INPUT FILE -------------------------------------------
FAST Certification - Test #18: NREL 5.0 MW Baseline Wind Turbine (Onshore)
---------------------- SIMULATION CONTROL --------------------------------------
False Echo - Echo input data to <RootName>.ech (flag)
"FATAL" AbortLevel - Error level when simulation should abort (string) {"WARNING", "SEVERE", "FATAL"}
600 TMax - Total run time (s)
0.00625 DT - Recommended module time step (s)
2 InterpOrder - Interpolation order for input/output time history (-) {1=linear, 2=quadratic}
0 NumCrctn - Number of correction iterations (-) {0=explicit calculation, i.e., no corrections}
99999 DT_UJac - Time between calls to get Jacobians (s)
1000000.0 UJacSclFact - Scaling factor used in Jacobians (-)
---------------------- FEATURE SWITCHES AND FLAGS ------------------------------
1 CompElast - Compute structural dynamics (switch) {1=ElastoDyn; 2=ElastoDyn + BeamDyn for blades}
1 CompInflow - Compute inflow wind velocities (switch) {0=still air; 1=InflowWind; 2=external from OpenFOAM}
2 CompAero - Compute aerodynamic loads (switch) {0=None; 1=AeroDyn v14; 2=AeroDyn v15}
1 CompServo - Compute control and electrical-drive dynamics (switch) {0=None; 1=ServoDyn}
0 CompSeaSt - Compute sea state information (switch) {0=None; 1=SeaState}
0 CompHydro - Compute hydrodynamic loads (switch) {0=None; 1=HydroDyn}
0 CompSub - Compute sub-structural dynamics (switch) {0=None; 1=SubDyn; 2=External Platform MCKF}
0 CompMooring - Compute mooring system (switch) {0=None; 1=MAP++; 2=FEAMooring; 3=MoorDyn; 4=OrcaFlex}
0 CompIce - Compute ice loads (switch) {0=None; 1=IceFloe; 2=IceDyn}
0 MHK - MHK turbine type (switch) {0=Not an MHK turbine; 1=Fixed MHK turbine; 2=Floating MHK turbine}
---------------------- ENVIRONMENTAL CONDITIONS --------------------------------
9.80665 Gravity - Gravitational acceleration (m/s^2)
1.225 AirDens - Air density (kg/m^3)
0 WtrDens - Water density (kg/m^3)
1.464e-05 KinVisc - Kinematic viscosity of working fluid (m^2/s)
335 SpdSound - Speed of sound in working fluid (m/s)
103500 Patm - Atmospheric pressure (Pa) [used only for an MHK turbine cavitation check]
1700 Pvap - Vapour pressure of working fluid (Pa) [used only for an MHK turbine cavitation check]
0 WtrDpth - Water depth (m)
0 MSL2SWL - Offset between still-water level and mean sea level (m) [positive upward]
---------------------- INPUT FILES ---------------------------------------------
"./NRELOffshrBsline5MW_Onshore_ElastoDyn.T2_mod.dat" EDFile - Name of file containing ElastoDyn input parameters (quoted string)
"unused" BDBldFile(1) - Name of file containing BeamDyn input parameters for blade 1 (quoted string)
"unused" BDBldFile(2) - Name of file containing BeamDyn input parameters for blade 2 (quoted string)
"unused" BDBldFile(3) - Name of file containing BeamDyn input parameters for blade 3 (quoted string)
"./NRELOffshrBsline5MW_InflowWind_Steady8mps.dat" InflowFile - Name of file containing inflow wind input parameters (quoted string)
"./NRELOffshrBsline5MW_Onshore_AeroDyn15.dat" AeroFile - Name of file containing aerodynamic input parameters (quoted string)
"./NRELOffshrBsline5MW_Onshore_ServoDyn.T2_mod.dat" ServoFile - Name of file containing control and electrical-drive input parameters (quoted string)
"unused" SeaStFile - Name of file containing sea state input parameters (quoted string)
"./unused" HydroFile - Name of file containing hydrodynamic input parameters (quoted string)
"unused" SubFile - Name of file containing sub-structural input parameters (quoted string)
"unused" MooringFile - Name of file containing mooring system input parameters (quoted string)
"unused" IceFile - Name of file containing ice input parameters (quoted string)
---------------------- OUTPUT --------------------------------------------------
False SumPrint - Print summary data to "<RootName>.sum" (flag)
5 SttsTime - Amount of time between screen status messages (s)
99999 ChkptTime - Amount of time between creating checkpoint files for potential restart (s)
"default" DT_Out - Time step for tabular output (s) (or "default")
0 TStart - Time to begin tabular output (s)
0 OutFileFmt - Format for tabular (time-marching) output file (switch) {0: uncompressed binary [<RootName>.outb], 1: text file [<RootName>.out], 2: binary file [<RootName>.outb], 3: both 1 and 2}
True TabDelim - Use tab delimiters in text tabular output file? (flag) {uses spaces if false}
"ES10.3E2" OutFmt - Format used for text tabular output, excluding the time channel. Resulting field should be 10 characters. (quoted string)
---------------------- LINEARIZATION -------------------------------------------
False Linearize - Linearization analysis (flag)
False CalcSteady - Calculate a steady-state periodic operating point before linearization? [unused if Linearize=False] (flag)
3 TrimCase - Controller parameter to be trimmed {1:yaw; 2:torque; 3:pitch} [used only if CalcSteady=True] (-)
0.001 TrimTol - Tolerance for the rotational speed convergence [used only if CalcSteady=True] (-)
0.01 TrimGain - Proportional gain for the rotational speed error (>0) [used only if CalcSteady=True] (rad/(rad/s) for yaw or pitch; Nm/(rad/s) for torque)
0 Twr_Kdmp - Damping factor for the tower [used only if CalcSteady=True] (N/(m/s))
0 Bld_Kdmp - Damping factor for the blades [used only if CalcSteady=True] (N/(m/s))
2 NLinTimes - Number of times to linearize (-) [>=1] [unused if Linearize=False]
30, 60 LinTimes - List of times at which to linearize (s) [1 to NLinTimes] [used only when Linearize=True and CalcSteady=False]
1 LinInputs - Inputs included in linearization (switch) {0=none; 1=standard; 2=all module inputs (debug)} [unused if Linearize=False]
1 LinOutputs - Outputs included in linearization (switch) {0=none; 1=from OutList(s); 2=all module outputs (debug)} [unused if Linearize=False]
False LinOutJac - Include full Jacobians in linearization output (for debug) (flag) [unused if Linearize=False; used only if LinInputs=LinOutputs=2]
False LinOutMod - Write module-level linearization output files in addition to output for full system? (flag) [unused if Linearize=False]
---------------------- VISUALIZATION ------------------------------------------
0 WrVTK - VTK visualization data output: (switch) {0=none; 1=initialization data only; 2=animation; 3=mode shapes}
1 VTK_type - Type of VTK visualization data: (switch) {1=surfaces; 2=basic meshes (lines/points); 3=all meshes (debug)} [unused if WrVTK=0]
True VTK_fields - Write mesh fields to VTK data files? (flag) {true/false} [unused if WrVTK=0]
15 VTK_fps - Frame rate for VTK output (frames per second){will use closest integer multiple of DT} [used only if WrVTK=2 or WrVTK=3]
Loading