Skip to content

Commit

Permalink
Code Reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Sep 26, 2019
1 parent 26d3117 commit 3f4b5e0
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions Source/Functions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 3f4b5e0

Please sign in to comment.