-
Notifications
You must be signed in to change notification settings - Fork 457
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 a super-controller library target to CMake #889
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this small bug. See my related e-mail for comments regarding an r-test.
@hamidMech - I see the issue you opened (#909) and the changes here are what you need. In order to compile this on your Linux machine, you can either copy the lines I've changed here into your close of OpenFAST or clone my fork with cmake ..
make sclib And you'll find the output in the usual spot: Please report back here with the results after trying this. Thanks! |
Dear Rafael,
Please find the terminal output 2 below for this error message. Could you please guide me how to solve it? 1- Terminal output for generating libsclib.so
2- Terminal output for running Fast.Farm with Supercontroller
|
Dear @hamidMech, Are you using the newest FAST.Farm source code from the main or dev branches of OpenFAST? Is your DISCON controller formatted properly? There should be three super-controller arguments to DISCON, including Best regards, |
Dear Jason,
with the heading of
In addition, in "DISCON_SC.f90", which of the following items must be includedt?
Best regards, |
@rafmudaf : These warning lines make me wonder if the build of the supercontroller DLL is missing the preprocessor definition
|
Dear @hamidMech, Your DISCON arguments look correct. But have you built the DISCON_SC.f90 source file into an *.so file and is that the *.so file you are using? If you are trying to use the sample super controller that prescribes yaw motion from the forum (https://wind.nrel.gov/forum/wind/viewtopic.php?f=13&t=2117&p=18310), you should use:
, not commented out. Also, try upgrading to the dev branch of OpenFAST. Perhaps the PR submitted in May will fix your problem: #749. Best regards, |
Dear Jason, I have followed the instruction by Rafael (please see the first post above). Here are the steps I have done. add_library(sclib SHARED Then I have executed "cmake .." and then "make sclib" commands while inside the "/OpenFAST/build" directory. Then I made a copy of the generated "libsclib.so" and put into the simulation folder i.e., /me/test_ffm/OpenFAST/reg_tests/r-test/glue-codes/fast-farm/myTSinflow. Below is the results in the terminal: me@tfd:~/test_ffm/OpenFAST/build$ cmake .. -- Enabling Fortran 2008 features me@tfd:~/test_ffm/OpenFAST/build$ make sclib Scanning dependencies of target sclib subroutine sc_init ( nTurbines, nInpGlobal, NumCtrl2SC, NumParamGlobal, NumParamTurbine, & Warning: ‘dllexport’ attribute directive ignored [-Wattributes] subroutine sc_getInitData(nTurbines, NumParamGlobal, NumParamTurbine, ParamGlobal, ParamTurbine, & Warning: ‘dllexport’ attribute directive ignored [-Wattributes] subroutine sc_calcOutputs ( t, nTurbines, nParamGlobal, paramGlobal, nParamTurbine, paramTurbine, nInpGlobal, to_SCglob, NumCtrl2SC, to_SC, & Warning: ‘dllexport’ attribute directive ignored [-Wattributes] subroutine sc_updateStates ( t, nTurbines, nParamGlobal, paramGlobal, nParamTurbine, paramTurbine, nInpGlobal, to_SCglob, NumCtrl2SC, to_SC, & Warning: ‘dllexport’ attribute directive ignored [-Wattributes] subroutine sc_end ( errStat, errMsg ) bind (C, NAME='sc_end') Warning: ‘dllexport’ attribute directive ignored [-Wattributes] |
@hamidMech , make sure that you have also updated the individual turbine controllers that are defined in ServoDyn. These controllers have a different format when using the supercontroller, so they will need to be updated as well. @rafmudaf 's instructions are for building the supercontroller library only, not the individual turbine controller libraries. |
@bjonkman , Could you please give an instruction how the individual turbine controllers (defined in ServoDyn) can be updated? In my simulation, I use "DISCON_WT1.so", "DISCON_WT2.so" and "DISCON_WT3.so" where for instance "DISCON_WT1.so" is located at and they work when supercontroller flag is False in the FAST.Farm input file. |
@jjonkman , Would you mean "avrSWAP(48) = from_SC(1)" or avrSWAP(58) = from_SC(1)? |
Dear @hamidMech, Oops, I meant:
(sorry for the typo, which I've now fixed in my post above), which should be the same for all wind turbines. The versions of the SC_DLL.f90 and DISCON_SC.f90 source files I provided in my post dated Mar 18, 2021 (updated May 10, 2021) in the FAST.Farm topic on the forum: https://wind.nrel.gov/forum/wind/viewtopic.php?f=13&t=2117 should work without modification. I've now also provided step-by-step instructions to run this working FAST.Farm example with the super controller in my post dated today (Nov 04, 2021) in that same forum topic. Best regards, |
Dear Jason, yaw_WT_1(t)= (pi/3)sin((2pi/90)*t For this purpose, I have changed the values in "sc_dll.f90" in the below lines and re-compile it: Line 110: do j = 1, nTurbines Line 167: do j = 1, nTurbines However, when I see the results in Paraview, I cannot see any yawed motion for the turbines. it seems that the super-controller does not change the turbines' nacelle yaw according to the super-controller. Here are the setting parameters that I have not changed it : Best regards, |
Dear @hamidMech, A couple comments:
Best regards, |
In fact it was! |
Feature or improvement description
This pull request adds a CMake target to compile the super-controller library via CMake.
Related issue, if one exists
No open GitHub issue but this was discussed in this forum post: https://wind.nrel.gov/forum/wind/viewtopic.php?p=18191#p18191
Impacted areas of the software
Super-controller library CMake config
Additional supporting information
This has not been tested for validity in a simulation and it should be.