Parameter access in user subroutines

Provide feedback, request enhancements, and get help with wind-turbine computer-aided engineering tools.

Moderators: Bonnie.Jonkman, Jason.Jonkman

Matthias.Schmid
Posts: 7
Joined: Mon May 13, 2019 2:40 am
Organization: Institute of Turbomaschinery and Fluid Dynamics
Location: Germany

Parameter access in user subroutines

Postby Matthias.Schmid » Tue Jun 11, 2019 7:57 am

Hello,

I have a question regarding the parameter access in user subroutines like UserVSCont or UserYawCont. The user guide states that it is possible to access the current value of any output parameter from FAST but I don't know how. Is there a specific module which has to be loaded or can I just use specific variable names?

Are there any examples available where a user subroutine uses this feature, or could someone give some example code maybe how the rotor speed is used in the UserYawCont subroutine?

Thank you very much.

Best regards,

Matthias

Jason.Jonkman
Posts: 4111
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Parameter access in user subroutines

Postby Jason.Jonkman » Tue Jun 11, 2019 2:28 pm

Dear Matthias,

Are you using FAST v7 or FAST v8 / OpenFAST? The source code implementation is quite different between these forms of FAST.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Matthias.Schmid
Posts: 7
Joined: Mon May 13, 2019 2:40 am
Organization: Institute of Turbomaschinery and Fluid Dynamics
Location: Germany

Re: Parameter access in user subroutines

Postby Matthias.Schmid » Wed Jun 12, 2019 12:02 am

Dear Jason,

I'm using OpenFAST.

Best regrads,

Matthias

Jason.Jonkman
Posts: 4111
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Parameter access in user subroutines

Postby Jason.Jonkman » Wed Jun 12, 2019 12:52 am

Dear Matthias,

That comment was added for an older version of FAST, when all data was global and accessible from any routine. The FAST modularization framework used in FAST v8 and OpenFAST supports data encapsulation, so that specific data is not available to a given routine unless that data is made accessible to that routine, e.g. by passing it as an argument.

Is the rotor speed what you want in SUBROUTINE UserVSCont()? This is already passed into UserVSCont() as the second argument, named LSS_Spd, in rad/s. Otherwise, please clarify what you want to do.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Matthias.Schmid
Posts: 7
Joined: Mon May 13, 2019 2:40 am
Organization: Institute of Turbomaschinery and Fluid Dynamics
Location: Germany

Re: Parameter access in user subroutines

Postby Matthias.Schmid » Wed Jun 12, 2019 9:49 am

Dear Jason,

for my current problem I need to know the rotor speed in the UserYawCont() as I want to yaw the turbine out of the wind when a certain rotational speed is reached.

Best regards,

Matthias

Jason.Jonkman
Posts: 4111
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Parameter access in user subroutines

Postby Jason.Jonkman » Wed Jun 12, 2019 10:46 am

Dear Matthias,

I would simply add LSS_Spd as an input argument to routine UserYawCont(). Routine CalculateStandardYaw, which calls routine UserYawCont(), already has access to the current value of the LSS_Spd in the input data structure, so, all you need do is add u%LSS_Spd to the argument list of UserYawCont().

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Matthias.Schmid
Posts: 7
Joined: Mon May 13, 2019 2:40 am
Organization: Institute of Turbomaschinery and Fluid Dynamics
Location: Germany

Re: Parameter access in user subroutines

Postby Matthias.Schmid » Tue Jun 18, 2019 8:00 am

Dear Jason,

thank you very much for your help. I think I have successfully implemented my user subroutine.

Now I have a follow-up question regarding the necessary DOF settings. The v7 user guide states that the UserYawCont() subroutine can be used either with the YawDOF enabled or disabled. When the YawDOF is enabled the YawPosCom output is used as the new neutral yaw position, otherwise it is used directly as new yaw position.

With my test setup I only see an effect in the NacYawP output variable if the YawDOF is enabled (and YawSpr is set). Should it be also possible in OpenFAST to directly prescribe the yaw position with the YawDOF disabled?

Thank you very much.
Best regards,

Matthias

Jason.Jonkman
Posts: 4111
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Parameter access in user subroutines

Postby Jason.Jonkman » Tue Jun 18, 2019 12:23 pm

Dear Matthias,

It was possible in FAST v7 to directly control the yaw angle without enabling the YawDOF. However, this capability was removed from FAST v8 and OpenFAST. Yaw control is only possible in FAST v8 and OpenFAST when YawDOF is enabled.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov


Return to “Computer-Aided Engineering Software Tools”

Who is online

Users browsing this forum: No registered users and 1 guest