ROSCO as a controller for a new BEM implementation

Hello,

I am a research student using the python toolbox for ROSCO. I am trying to use ROSCO as a controller in conjunction with my own BEM implementation (in python). I have two questions regarding this, and would greatly appreciate any help!

  1. When I try to run a ROSCO simulation with ROSCO_sim.Sim(turbine, controller_int) and the rosco_sim, turbine, controller_int all initialized as done in the ROSCO examples there seems to be a small chance that I get the following error: “Fortran runtime error: File already opened in another unit” (shown below)

Because of this if I try to run a ROSCO simulation multiple times at least one run will fail due to this error. I’m not sure if there is something I have done in configuring ROSCO on my computer that is causing this error, but any advice you might have would be appreciated.

  1. As I am trying to run ROSCO with my own BEM implementation, I have set it up so ROSCO simulates the entire time interval of the simulation, and then I plug in the rotor speed, pitch into my BEM calculation. However, I would ideally like ROSCO to respond to the torque computed by my BEM model between each simulation time step. ie: BEM model computes torque and inputs to ROSCO, ROSCO computes control output and change in pitch or generator torque, BEM model takes these updates and recalculates torque, then process repeats. If this is possible and you have any advice on how to implement this type of system it would be greatly appreciated.

Thank you again for all of your help!

Hi Jackson,

You may be able to work around this issue by using LoggingLevel of 0 in the DISCON input. The error seems to original from the opening of a debug output file.

Newer versions of ROSCO attempt to do a better job of closing these files. The latest version is v2.9.0.

I would try substituting your BEM implementation for the ROSCO sim module here: ROSCO/rosco/toolbox/sim.py at a4a6a271eb4c422b1d2b3c4a8f68fbc80b52fc46 · NREL/ROSCO · GitHub.

This example should be a good starting point: ROSCO/Examples/04_simple_sim.py at main · NREL/ROSCO · GitHub

I hope this helps.

Best, Dan