From 82daa5fa9db99a5f0f0c94e3bd78d84b259dbaa9 Mon Sep 17 00:00:00 2001 From: Nikhar Abbas Date: Fri, 27 Sep 2019 15:40:14 -0600 Subject: [PATCH] Move peak shaving to ControllerBlocks --- Source/ControllerBlocks.f90 | 16 ++++++++++++++++ Source/Functions.f90 | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Source/ControllerBlocks.f90 b/Source/ControllerBlocks.f90 index 4a37d490..9ef694a6 100644 --- a/Source/ControllerBlocks.f90 +++ b/Source/ControllerBlocks.f90 @@ -253,5 +253,21 @@ SUBROUTINE SetpointSmoother(LocalVar, CntrPar, objInst) END SUBROUTINE SetpointSmoother !------------------------------------------------------------------------------------------------------------------------------- + REAL FUNCTION PeakShaving(LocalVar, CntrPar) + ! PeakShaving defines a minimum blade pitch angle based on a lookup table provided by DISON.IN + ! SS_Mode = 0, No setpoint smoothing + ! SS_Mode = 1, Implement setpoint smoothing + USE DRC_Types, ONLY : LocalVariables, ControlParameters + IMPLICIT NONE + ! Inputs + TYPE(ControlParameters), INTENT(IN) :: CntrPar + TYPE(LocalVariables), INTENT(INOUT) :: LocalVar + ! Allocate Variables + + ! Define minimum blade pitch angle as a function of estimated wind speed + PeakShaving = interp1d(CntrPar%PS_WindSpeeds, CntrPar%PS_BldPitchMin,LocalVar%WE_Vw) + + END FUNCTION PEAKSHAVING +!------------------------------------------------------------------------------------------------------------------------------- END MODULE ControllerBlocks diff --git a/Source/Functions.f90 b/Source/Functions.f90 index 0fc637b5..b97bbcb9 100644 --- a/Source/Functions.f90 +++ b/Source/Functions.f90 @@ -461,21 +461,5 @@ SUBROUTINE Debug(LocalVar, CntrPar, avrSWAP, RootName, size_avcOUTNAME) END IF END SUBROUTINE Debug !------------------------------------------------------------------------------------------------------------------------------- - REAL FUNCTION PeakShaving(LocalVar, CntrPar) - ! PeakShaving defines a minimum blade pitch angle based on a lookup table provided by DISON.IN - ! SS_Mode = 0, No setpoint smoothing - ! SS_Mode = 1, Implement setpoint smoothing - USE DRC_Types, ONLY : LocalVariables, ControlParameters - IMPLICIT NONE - ! Inputs - TYPE(ControlParameters), INTENT(IN) :: CntrPar - TYPE(LocalVariables), INTENT(INOUT) :: LocalVar - ! Allocate Variables - - ! Define minimum blade pitch angle as a function of estimated wind speed - PeakShaving = interp1d(CntrPar%PS_WindSpeeds, CntrPar%PS_BldPitchMin,LocalVar%WE_Vw) - - END FUNCTION PEAKSHAVING - !------------------------------------------------------------------------------------------------------------------------------- END MODULE Functions