OpenFAST - UserYawCont - Failing to call subroutine


I’m looking for some help around implementing the user-defined yaw control strategy via the UserYawCont routine in “UserSubs.f90” in OpenFAST. The steps below are what I have done but when I run an updated example from the r-test scripts it seems to revert to running the Bladed Controllers for the ServoDyn Module instead:

  1. Updated the UserSubs.f90 script, un-commenting UserYawCont subroutine and making YawPosCom & YawRateCom to “0.0” for the time being. (Also, added a write to txt command to double check if subroutine has been called.)

  2. Then re-complied Usersubs.f90 by using ‘make servodyn-driver’ in the build folder (I’m using mac) – this looks to update the ./openfast/build/modules/servodyn/CMakeFiles/servodynlib.dir/src/UserSubs.f90.o file as expected.

  3. Changed YCMode to “3” in the ServoDyn.dat file

I’m new to Fortran and having to manually compile code, hoping to make sure I can execute the sub-routine before getting something more substantial together. Appreciate any guidance given.

Many Thanks,

Dear Richard,

You shouldn’t need to compile the standalone ServoDyn driver (unless you plan to run ServoDyn uncoupled from OpenFAST), but you will need to recompile OpenFAST with your UserSubs.f90 source file.

If you didn’t change the pitch or torque control settings, it could still be calling the Bladed controller for those.

Best regards,

Thanks Jason,

I managed to get the recompiled openFAST to call the UserYawCont sub-routine, however when I instruct some of the reg-test examples to call the UserYawCont, the simulation runs nominally but the .out time-series is empty?

I have UserYawCont declaring YawPosCom & YawRateCom to “0.0” as per the dummy example, not a great but I’ve tried different declarations correlating them as per the guidance and still fail to get an output? - I would expect to see an output even for YawPosCom & YawRateCom to “0.0”? although not a great one.

I’ve attached the .fst, ServoDyn.dat, UserSubs.f90 and .out for one of the examples I’ve tried and would greatly appreciate any guidance. (13.2 KB)

Many Thanks,

Dear Richard,

It appears that OpenFAST is getting through the initialization step, but not any farther. Are you getting an error message? What is written to the screen?

Best regards,

Hi Jason,

I’ve attached the terminal output, with YCMode set to “3”, below.

A few warnings but no fatal errors, this looks to be the same terminal output when I run YCMode set to “5”, the default for the example but successfully produces a time-series in the .out file.

Many Thanks,

[code] **************************************************************************************************

Copyright (C) 2021 National Renewable Energy Laboratory
Copyright (C) 2021 Envision Energy USA LTD

This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
See the “LICENSE” file distributed with this software for details.

Compile Info:

  • Compiler: GCC version 10.2.0
  • Architecture: 64 bit
  • Precision: double
  • Date: Jan 29 2021
  • Time: 20:20:49
    Execution Info:
  • Date: 01/30/2021
  • Time: 11:02:23+0000

OpenFAST input file heading:
FAST Certification Test #22: NREL 5.0 MW Baseline Wind Turbine with ITI Barge Configuration,
for use in offshore analysis

Running ElastoDyn.
Nodal outputs section of ElastoDyn input file not found or improperly formatted.
Running AeroDyn14.
Running InflowWind.

Reading a 31x31 grid (145 m wide, 17.5 m to 162.5 m above ground) with a characteristic wind
speed of 12 m/s. This full-field file was generated by TurbSim (v1.06.00, 21-Sep-2012) on
07-Jan-2014 at 12:50:45.

Processed 1442 time steps of 20-Hz full-field data (72.05 seconds).

Running ServoDyn.
Running HydroDyn.
WARNING: The random number generator in use differs from the original code provided by NREL.
This pRNG uses 8 seeds instead of the 2 in the input file.
Generating incident wave kinematics and current time history.
Reading in WAMIT output with root name
Computing radiation impulse response functions and wave diffraction forces.

Using SS_Radiation Module, with 30 of 30 radiation states

MAP++ environment properties (set externally)…
Gravity constant [m/s^2] : 9.81
Sea density [kg/m^3] : 1025.00
Water depth [m] : 150.00
Vessel reference position [m] : 0.00 , 0.00 , 0.00

FAST_InitializeAll:FAST_Init:FAST_ReadPrimaryFile:1/VTK_fps is not an integer multiple of DT.
FAST will output VTK information at 16 fps, the closest rate possible.
FAST_InitializeAll:HydroDyn_Init:Waves_Init:VariousWaves_Init: The random number generator in use
differs from the original code provided by NREL. This pRNG uses 8 seeds instead of the 2 in the
HydroDyn input file.

Time: 0 of 60 seconds.
Time: 30 of 60 seconds. Estimated final completion at 11:02:58.
FAST_Solution:FAST_AdvanceStates:ED_ABM4:ED_CalcContStateDeriv:SetCoordSy:Small angle assumption
violated in SUBROUTINE SmllRotTrans() due to a large blade deflection (ElastoDyn SetCoordSy). The
solution may be inaccurate. Simulation continuing, but future warnings from SmllRotTrans() will
be suppressed.
Additional debugging message from SUBROUTINE SmllRotTrans(): 32.4 s

Total Real Time: 34.211 seconds
Total CPU Time: 32.893 seconds
Simulation CPU Time: 32.23 seconds
Simulated Time: 60 seconds
Time Ratio (Sim/CPU): 1.8616

OpenFAST terminated normally.[/code]

Hi Richard,

I see that you’ve set OutFileFmt = 0, which should output both an uncompressed binary (.outb) and the text file (.out). Is the data being properly written to the uncompressed binary file? If all you want is text output, you can set OutFileFmt = 1. Do you get the output you expect then?

Best regards,

Hi Jason,

The *.outb file is being updated when OutFileFmt = 0, it looks to give the same values for NacYaw as if YCMode = 5 (the provided .dll for the example), they both seem to fluctuate around 0 with the same values.

When I change OutFileFmt = 1 it seems to have the same output - the *.out file printing the headings only and no values.

Ideally, I would preferably like to have access to the *.out as this is updated during runtime and was hoping to have access to some observations unlike the .outb file which looks to be updated at the end of the runtime.

Many Thanks,

Dear Richard,

OK, it is good to hear that the uncompressed binary output contains the results you expect. Just FYI, the binary files cannot be written until the simulation concludes because the data is normalized by the max-min range before being output (which is not known until the simulation ends).

I’m not sure why the header is being written to the *.out file, but not the data. I’ve not seen this problem before. I know that you are recompiling OpenFAST yourself. Do you see the same problem if you run your simulation (without yaw control) using the precompiled OpenFAST executable, or is this a problem only with the executable you compiled yourself? If the later, then I would guess this has something to do with your compile.

Best regards,