diff --git a/Source/Functions.f90 b/Source/Functions.f90 index 0fc637b5..99539c1e 100644 --- a/Source/Functions.f90 +++ b/Source/Functions.f90 @@ -397,6 +397,22 @@ REAL FUNCTION AeroDynTorque(LocalVar, CntrPar, PerfData) END FUNCTION AeroDynTorque !------------------------------------------------------------------------------------------------------------------------------- + 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 + !------------------------------------------------------------------------------------------------------------------------------- SUBROUTINE Debug(LocalVar, CntrPar, avrSWAP, RootName, size_avcOUTNAME) USE, INTRINSIC :: ISO_C_Binding USE DRC_Types, ONLY : LocalVariables, ControlParameters @@ -461,21 +477,4 @@ 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