Skip to content
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

Develop #50

Merged
merged 2 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.6)
project(ROSCO VERSION 2.2.0 LANGUAGES Fortran)
project(ROSCO VERSION 2.3.0 LANGUAGES Fortran)

set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/ftnmods")

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ If you want to use the controller with DNV GL Bladed v4.5 or earlier (which stil
If ROSCO played a role in your research, please cite it. This software can be
cited as:

ROSCO. Version 2.2.0 (2021). Available at https://github.com/nrel/rosco.
ROSCO. Version 2.3.0 (2021). Available at https://github.com/nrel/rosco.

For LaTeX users:

```
@misc{ROSCO_2021,
author = {NREL},
title = {{ROSCO. Version 2.2.0}},
title = {{ROSCO. Version 2.3.0}},
year = {2021},
publisher = {GitHub},
journal = {GitHub repository},
Expand Down
8 changes: 5 additions & 3 deletions src/ControllerBlocks.f90
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ SUBROUTINE WindSpeedEstimator(LocalVar, CntrPar, objInst, PerfData, DebugVar)
REAL(8) :: Tau_r ! Estimated rotor torque [Nm]
REAL(8) :: a ! wind variance
REAL(8) :: lambda ! tip-speed-ratio [rad]
REAL(8) :: RotSpeed ! Rotor Speed [rad], locally

! - Covariance matrices
REAL(8), DIMENSION(3,3) :: F ! First order system jacobian
REAL(8), DIMENSION(3,3), SAVE :: P ! Covariance estiamte
Expand Down Expand Up @@ -168,11 +170,11 @@ SUBROUTINE WindSpeedEstimator(LocalVar, CntrPar, objInst, PerfData, DebugVar)
Q = RESHAPE((/0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/),(/3,3/))
IF (LocalVar%iStatus == 0) THEN
! Initialize recurring values
om_r = LocalVar%RotSpeedF
om_r = max(LocalVar%RotSpeedF, CntrPar%VS_MinOMSpd)
v_t = 0.0
v_m = LocalVar%HorWindV
v_h = LocalVar%HorWindV
lambda = LocalVar%RotSpeed * CntrPar%WE_BladeRadius/v_h
lambda = max(LocalVar%RotSpeed, CntrPar%VS_MinOMSpd) * CntrPar%WE_BladeRadius/v_h
xh = RESHAPE((/om_r, v_t, v_m/),(/3,1/))
P = RESHAPE((/0.01, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 1.0/),(/3,3/))
K = RESHAPE((/0.0,0.0,0.0/),(/3,1/))
Expand All @@ -183,7 +185,7 @@ SUBROUTINE WindSpeedEstimator(LocalVar, CntrPar, objInst, PerfData, DebugVar)
A_op = interp1d(CntrPar%WE_FOPoles_v,CntrPar%WE_FOPoles,v_h)

! TEST INTERP2D
lambda = LocalVar%RotSpeed * CntrPar%WE_BladeRadius/v_h
lambda = max(LocalVar%RotSpeed, CntrPar%VS_MinOMSpd) * CntrPar%WE_BladeRadius/v_h
Cp_op = interp2d(PerfData%Beta_vec,PerfData%TSR_vec,PerfData%Cp_mat, LocalVar%BlPitch(1)*R2D, lambda )
Cp_op = max(0.0,Cp_op)

Expand Down
6 changes: 3 additions & 3 deletions src/Functions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ REAL FUNCTION interp2d(xData, yData, zData, xq, yq)
! 4| a b c
! 5| d e f
! 6| g H i

USE ieee_arithmetic
IMPLICIT NONE
! Inputs
REAL(8), DIMENSION(:), INTENT(IN) :: xData ! Provided x data (vector), to find query point (should be monotonically increasing)
Expand All @@ -215,7 +215,7 @@ REAL FUNCTION interp2d(xData, yData, zData, xq, yq)

! ---- Find corner indices surrounding desired interpolation point -----
! x-direction
IF (xq <= MINVAL(xData)) THEN ! On lower x-bound, just need to find zData(yq)
IF (xq <= MINVAL(xData) .OR. (ieee_is_nan(xq))) THEN ! On lower x-bound, just need to find zData(yq)
j = 1
jj = 1
interp2d = interp1d(yData,zData(:,j),yq)
Expand All @@ -241,7 +241,7 @@ REAL FUNCTION interp2d(xData, yData, zData, xq, yq)
ENDIF
j = j-1 ! Move j back one
! y-direction
IF (yq <= MINVAL(yData)) THEN ! On lower y-bound, just need to find zData(xq)
IF (yq <= MINVAL(yData) .OR. (ieee_is_nan(yq))) THEN ! On lower y-bound, just need to find zData(xq)
i = 1
ii = 1
interp2d = interp1d(xData,zData(i,:),xq)
Expand Down