Skip to content

Commit

Permalink
FOCAL Updates (#64)
Browse files Browse the repository at this point in the history
* Update headers

* fix bullets

* make uppercase

* Update turbine.py (#56)

* Update turbine.py

This add several lines for fixing the problem of repeated maximum values in the performance tables. This will cause the error (' the length of x and y is different.') of 'interpolate.interp1d.'

* Add comments and catch when there are multiple optimal pitch angles

Co-authored-by: dzalkind <dzalkind@nrel.gov>

* increment version

* Update for OpenFAST v3.0.0

* Update for OpenFAST v3.0.0

* Install OF3.0.0 for tests

* update for OF v3.0.0

* add publish to pypi on release

* Update to ROSCO v2.3.0

* Update Testing (#58)

* Update scripts to run on eagle

* Update IEA-15MW semi example: use peak shaving w/ ps_percen=0.8

* Add comparison plots to testing scripts

* Update submit script for testing

* Update for latest eagle runs

* Add future to install dependencies

* add TMax to self, define tmin in print_results

* run tests in CI

* generic ROSCO path

* default to overwrite

* fix path

* import platform

* separate run_testing

* cleanup, specify lite test

* don't run testing in after examples, oops.

Co-authored-by: nikhar-abbas <40865984+nikhar-abbas@users.noreply.github.com>
Co-authored-by: Nikhar Abbas <nikhar.abbas@colorado.edu>

* increment version

* Update for OpenFAST v3.0.0

* Install OF3.0.0 for tests

* update for OF v3.0.0

* add publish to pypi on release

* Update to ROSCO v2.3.0

* Increment Version, OF3.0 (#57)

* increment version

* Update for OpenFAST v3.0.0

* Install OF3.0.0 for tests

* update for OF v3.0.0

* add publish to pypi on release

* Update to ROSCO v2.3.0

* increment version

* Update for OpenFAST v3.0.0

* Install OF3.0.0 for tests

* update for OF v3.0.0

* add publish to pypi on release

* Update to ROSCO v2.3.0

* add ROSCO without submodule

* move ROSCO source to ROSCO folder

* Move cmake-related files to ROSCO

* Add back pesky ErrVar

* Remove parameters_files

* Merge ROSCO and _toolbox gitignore

* Fix .gitignore

* Remove Examples/DISCON.IN from git

* Fix and point example_01 to Tune_Cases/

* Update verbiage around using ofTools vs. weis

* Fix and point example_04 to Tune_Cases/

* Clean up example_06

* Clean up example_07

* Only check FlpCornerFreq if using Flp control, fixes example 05

* Make example_04 consistent with others

* Let example_05 run independently from 04

* Clean up example_05, wind files

* Add schema and update empty tuning yaml inputs, not connected yet

* Integrate schema into turbine, controller, and examples

* Only check Fl filter parameters if Fl_Mode > 0, fix example_05

* bump version to 2.3

* Compile ROSCO from ROSCO dir

* Rename to CI_rosco

* Add omega vs. windspeed functionality

* Fix tests: 5MW U_pc and 06 example dir

* Make _Toolbox vs_minspeed in rotor frame to match ROSCO

* Revert ServoDyn change

* change rotor speed constraint to be epsilon

* rename for clarity

* docs major refresh

* fix FA_AccF units in debug file

* docs that build locally

* Deallocate arrays in ROSCO, check in example_05

* Clean up comments

* remove gitmodules

* furo theme

* furo in requirements

* move readthedocs config file, remove furo import in conf.py

* add docs requirements file

* typo

* move index out of source folder

* trying to get furo to work

* import date

* fix versions and titles, cleanup readthedocs requirements

* typo fix, remove extras

* more cleanup

* bump version

* no furo extension, "hack" to load RT version

* proper toctree paths

* specify method

* add mock modules

* fix typos

* update python install requirements

* running locally

* move index to main docs dir again

* update to build locally

* error during warnings

* automated version

* cleanup

* remove old docs

* re-add docs

* simplify

* fix figure path

* try alabaster

* remove archived docs

* Add omega vs. windspeed functionality

* Fix tests: 5MW U_pc and 06 example dir

* more detailed sp.optimize settings

* run MBC3 in parallel

* restructure driver, run initialization doe for tuning

* Try new dlclose function

* Update example_05 to run simple simulation twice and check result

* Revert deallocation stuff

* Close discon library after every sim run

* Test examples on macOS and windows

* Run examples instead of testing on other platforms

* Skip examples in windows for now

* update paths and yaml load funciton

* Skip mac testing of examples

* provide default U_pc for single omega/zeta case

* allow for float or list-like pc tuning inputs

* Change name in setup.py

* WE_Vw unit fix

* Pass through kp_float, if desired

* Minor fixes: schema error and InputReader defaults

* cleeanup for improved stability

* check for doe_logs as string in load_DOE

* major restructure for rsched_driver class

* cleanup verbosity

* run serial by default

* load_parallel as linturb_option

* specific IEA15MW yaml for multi omega

* remove unused module imports

* fix error message types

* lin_file as input

* add comments on inputs to LinearTurbineModel init method

* remove relative file paths

* provide OpenFAST linearizations for IEA15MW UMaineSemi

* put plotting in specific function

* fix WE_lambda units

* add self in on a few necessary variables

* creaete example 12 for robust scheduling

* try a few mbc3 locations for import

* allow list-like or numpy arrays for omega_pc and zeta_pc schedules

* create and use recorder setup function

* Pass Through Kp_float (#57)

* Pass through kp_float, if desired

* Minor fixes: schema error and InputReader defaults

* fix setup_recorder to work for optimization driver too

* Allow pass through of Kp_float = 0

* cleanup om problems, update om0 calc

* doe levels as input

* negative k_float to account for OF conventions

* cleanup print statements

* variable name cleanup, use calculated k_float

* Add defaults to omega_,zeta_ pc and vs, allow to be numbers

* use standard tuning k_float as IC

* formatting update

* update problem setup methods

* cleanup add_dv, enable adding design variables after problem is setup

* change optimization step size

* more setup restructure

* update verbosity

* use sphinx-rtd-theme

* master doc and sphinx rtd theme

* index back to root folder

* only ignore install folders

* remove hidden toctree

* furo theme

* update paths

* convert rt version to string

* update sphinx settings

* move conf

* furo theme

* Mostly a docs update (#61)

* rename for clarity

* docs major refresh

* fix FA_AccF units in debug file

* docs that build locally

* remove gitmodules

* furo theme

* furo in requirements

* move readthedocs config file, remove furo import in conf.py

* add docs requirements file

* typo

* move index out of source folder

* trying to get furo to work

* import date

* fix versions and titles, cleanup readthedocs requirements

* typo fix, remove extras

* more cleanup

* bump version

* no furo extension, "hack" to load RT version

* proper toctree paths

* specify method

* add mock modules

* fix typos

* update python install requirements

* running locally

* move index to main docs dir again

* update to build locally

* error during warnings

* automated version

* cleanup

* remove old docs

* re-add docs

* simplify

* fix figure path

* try alabaster

* remove archived docs

* use sphinx-rtd-theme

* master doc and sphinx rtd theme

* index back to root folder

* only ignore install folders

* remove hidden toctree

* furo theme

* update paths

* convert rt version to string

* update sphinx settings

* move conf

* furo theme

* Pass through Kp_float = 0 (#59)

* Pass through kp_float, if desired

* Minor fixes: schema error and InputReader defaults

* Allow pass through of Kp_float = 0

* Add flp parameters to schema

* Change Fl_Mode default to 0

* Add defaults to omega_,zeta_ pc and vs, allow to be numbers

* Allow single pitch tuning values in code, default U_pc to 0

* use nac acceleration for floating feedback

* Fix TSR saturation for region 2.5operation

* Modify system for constant power operation

* Only modify pole for constant power above-rated

* Remove GenEff from K calc

* Update tuning, use constant power

* use load_rosco_yaml

* constant power

* Fix broken tests

* Include Fl_Mode=2 for nacelle pitching feedback

* Add FOCAL inputs
- hpf on floating feedback
- lpf on wind speed estimator
- associated schema updates

* Set notch and check frequencies when Fl_Mode = 1 (fixes bug)

* Skip filter step if there's an error

* Update IEA-15MW test case DISCON with focal inputs

* Allow Fl_Mode = 2 in ROSCO

* Pass through lpf frequency

* Add FOCAL tuning yaml

* Set Cp contour number of levels

* Add FOCAL params to various writers

* Update/tune focal yaml

* Add scripts for running FAST, tuning various parameters and cases

* Add notebook for FAST plotting

* Set up step case for testing

* Change doubles to C_doubles

* Define real and integer kinds, assign to all of ROSCO

* Add ADJUSTL to DISCON error message

* Fix Fl_Mode == 2

* Fix Fl_Mode == 2 again

* Call yaw, flap, and debug only if enabled in DISOCN.IN

* Make avrSWAP a ReKi and set constant kinds

* Add DISCONs for testing - revert this later

* Fix DISCON comparison, before DISCON's were overwritten by model

* Rename DEBUG2.dbg to RootName.dbg2

* Update TestCase DISCONs to new input file

* Add API change page in docs

* Add link to API change on main page

* Fix table headers

* Fix title underlines

* Fix tables again

* Fix tables again

* Fix version numbering in docs

* Simplify FAST_directory in run_FAST

* Versioning (#65)

* use sphinx-rtd-theme

* master doc and sphinx rtd theme

* index back to root folder

* only ignore install folders

* remove hidden toctree

* furo theme

* update paths

* convert rt version to string

* update sphinx settings

* move conf

* furo theme

* remove git versioning from cmake

* use hard coded rosco_version

* update intro write method

* set nowrap for intel compilers

* Add transfer of error message and clear message after each call

* update install instructions

* Catch nans in ROSCO at end of WSE

* fix conda install typo

* cleanup docs

* Rename DEBUG2.dbg to RootName.dbg2

* Fix Fl_Mode == 2

* Fix Fl_Mode == 2 again

* Allow Fl_Mode = 2 in ROSCO

* Set notch and check frequencies when Fl_Mode = 1 (fixes bug)

* Update FOCAL tuning yaml

* Update TSR

* Clean up and doc fix

* Remove publish to pypi

* Define all constant inputs to functions with kind typing

* Generate Test_Case/ inputs automatically

* Fix IEA15 DISCON path

* Fix example 11 paths

* Auto-generate tuning input yaml using schema

* Add toolbox_input to doc index

* Add toctree

* Re-name title of toolbox_input

Co-authored-by: Nikhar Abbas <nikhar.abbas@colorado.edu>
Co-authored-by: Xianping Du <38188001+Seager1989@users.noreply.github.com>
Co-authored-by: nikhar-abbas <40865984+nikhar-abbas@users.noreply.github.com>
  • Loading branch information
4 people authored Nov 19, 2021
1 parent de1a7f8 commit aa888a1
Show file tree
Hide file tree
Showing 51 changed files with 2,875 additions and 1,748 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/CI_rosco-pytools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
run: |
conda install compilers
# Install ROSCO toolbox
- name: Install ROSCO toolbox
run: |
Expand Down Expand Up @@ -160,4 +159,4 @@ jobs:
- name: Run testing
run: |
cd ROSCO_testing
python ROSCO_testing.py
python ROSCO_testing.py
27 changes: 0 additions & 27 deletions .github/workflows/publish_to_pypi.yml

This file was deleted.

12 changes: 8 additions & 4 deletions Examples/example_11.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@
controller = ROSCO_controller.Controller(controller_params)

# Load turbine data from OpenFAST and rotor performance text file
turbine.load_from_fast(path_params['FAST_InputFile'], \
os.path.join(this_dir,path_params['FAST_directory']), \
dev_branch=True,rot_source='txt',\
txt_filename=os.path.join(this_dir,path_params['FAST_directory'],path_params['rotor_performance_filename']))
tune_dir = os.path.join(this_dir,'../Tune_Cases')
turbine.load_from_fast(
path_params['FAST_InputFile'],
os.path.join(this_dir,path_params['FAST_directory']),
dev_branch=True,
rot_source='txt',
txt_filename=os.path.join(tune_dir,path_params['rotor_performance_filename'])
)

# Tune controller
controller.tune_controller(turbine)
Expand Down
5 changes: 2 additions & 3 deletions Examples/example_12.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from ROSCO_toolbox import turbine as ROSCO_turbine
from ROSCO_toolbox import controller as ROSCO_controller


def run_example():
# Shorthand directories
this_dir = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -114,10 +113,10 @@ def run_example():
ax[4].set_ylabel('Integral Gain')
ax[4].grid()

if True:

if False:
plt.show()
else:
plt.savefig(os.path.join(example_out_dir, '12_RobustSched.png'))

if __name__ == '__main__':
run_example()
22 changes: 15 additions & 7 deletions ROSCO/src/Constants.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@
! CONDITIONS OF ANY KIND, either express or implied. See the License for the
! specific language governing permissions and limitations under the License.



MODULE Constants
USE, INTRINSIC :: ISO_C_Binding

Character(*), PARAMETER :: rosco_version = 'v2.4.1' ! ROSCO version
REAL(8), PARAMETER :: RPS2RPM = 9.5492966 ! Factor to convert radians per second to revolutions per minute.
REAL(8), PARAMETER :: R2D = 57.295780 ! Factor to convert radians to degrees.
REAL(8), PARAMETER :: D2R = 0.0175 ! Factor to convert degrees to radians.
REAL(8), PARAMETER :: PI = 3.14159265359 ! Mathematical constant pi
INTEGER(4), PARAMETER :: NP_1 = 1 ! First rotational harmonic
INTEGER(4), PARAMETER :: NP_2 = 2 ! Second rotational harmonic
CHARACTER(*), PARAMETER :: NewLine = ACHAR(10) ! The delimiter for New Lines [ Windows is CHAR(13)//CHAR(10); MAC is CHAR(13); Unix is CHAR(10) {CHAR(13)=\r is a line feed, CHAR(10)=\n is a new line}]
INTEGER, PARAMETER :: DbKi = C_DOUBLE !< Default kind for double floating-point numbers
INTEGER, PARAMETER :: ReKi = C_FLOAT !< Default kind for single floating-point numbers
INTEGER, PARAMETER :: IntKi = C_INT !< Default kind for integer numbers

REAL(DbKi), PARAMETER :: RPS2RPM = 9.5492966 ! Factor to convert radians per second to revolutions per minute.
REAL(DbKi), PARAMETER :: R2D = 57.295780 ! Factor to convert radians to degrees.
REAL(DbKi), PARAMETER :: D2R = 0.0175 ! Factor to convert degrees to radians.
REAL(DbKi), PARAMETER :: PI = 3.14159265359 ! Mathematical constant pi
INTEGER(IntKi), PARAMETER :: NP_1 = 1 ! First rotational harmonic
INTEGER(IntKi), PARAMETER :: NP_2 = 2 ! Second rotational harmonic
CHARACTER(*), PARAMETER :: NewLine = ACHAR(10) ! The delimiter for New Lines [ Windows is CHAR(13)//CHAR(10); MAC is CHAR(13); Unix is CHAR(10) {CHAR(13)=\r is a line feed, CHAR(10)=\n is a new line}]
END MODULE Constants
75 changes: 36 additions & 39 deletions ROSCO/src/ControllerBlocks.f90
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ SUBROUTINE ComputeVariablesSetpoints(CntrPar, LocalVar, objInst)
TYPE(LocalVariables), INTENT(INOUT) :: LocalVar
TYPE(ObjectInstances), INTENT(INOUT) :: objInst

REAL(8) :: VS_RefSpd ! Referece speed for variable speed torque controller, [rad/s]
REAL(8) :: PC_RefSpd ! Referece speed for pitch controller, [rad/s]
REAL(8) :: Omega_op ! Optimal TSR-tracking generator speed, [rad/s]
REAL(DbKi) :: VS_RefSpd ! Referece speed for variable speed torque controller, [rad/s]
REAL(DbKi) :: PC_RefSpd ! Referece speed for pitch controller, [rad/s]
REAL(DbKi) :: Omega_op ! Optimal TSR-tracking generator speed, [rad/s]

! ----- Calculate yaw misalignment error -----
LocalVar%Y_MErr = LocalVar%Y_M + CntrPar%Y_MErrSet ! Yaw-alignment error
Expand Down Expand Up @@ -172,34 +172,34 @@ SUBROUTINE WindSpeedEstimator(LocalVar, CntrPar, objInst, PerfData, DebugVar, Er
TYPE(ErrorVariables), INTENT(INOUT) :: ErrVar

! Allocate Variables
REAL(8) :: F_WECornerFreq ! Corner frequency (-3dB point) for first order low pass filter for measured hub height wind speed [Hz]
REAL(DbKi) :: F_WECornerFreq ! Corner frequency (-3dB point) for first order low pass filter for measured hub height wind speed [Hz]

! Only used in EKF, if WE_Mode = 2
REAL(8), SAVE :: om_r ! Estimated rotor speed [rad/s]
REAL(8), SAVE :: v_t ! Estimated wind speed, turbulent component [m/s]
REAL(8), SAVE :: v_m ! Estimated wind speed, 10-minute averaged [m/s]
REAL(8), SAVE :: v_h ! Combined estimated wind speed [m/s]
REAL(8) :: L ! Turbulent length scale parameter [m]
REAL(8) :: Ti ! Turbulent intensity, [-]

REAL(DbKi), SAVE :: om_r ! Estimated rotor speed [rad/s]
REAL(DbKi), SAVE :: v_t ! Estimated wind speed, turbulent component [m/s]
REAL(DbKi), SAVE :: v_m ! Estimated wind speed, 10-minute averaged [m/s]
REAL(DbKi), SAVE :: v_h ! Combined estimated wind speed [m/s]
REAL(DbKi) :: L ! Turbulent length scale parameter [m]
REAL(DbKi) :: Ti ! Turbulent intensity, [-]
! REAL(DbKi), DIMENSION(3,3) :: I
! - operating conditions
REAL(8) :: A_op ! Estimated operational system pole [UNITS!]
REAL(8) :: Cp_op ! Estimated operational Cp [-]
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
REAL(DbKi) :: A_op ! Estimated operational system pole [UNITS!]
REAL(DbKi) :: Cp_op ! Estimated operational Cp [-]
REAL(DbKi) :: Tau_r ! Estimated rotor torque [Nm]
REAL(DbKi) :: a ! wind variance
REAL(DbKi) :: lambda ! tip-speed-ratio [rad]
REAL(DbKi) :: 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
REAL(8), DIMENSION(1,3) :: H ! Output equation jacobian
REAL(8), DIMENSION(3,1), SAVE :: xh ! Estimated state matrix
REAL(8), DIMENSION(3,1) :: dxh ! Estimated state matrix deviation from previous timestep
REAL(8), DIMENSION(3,3) :: Q ! Process noise covariance matrix
REAL(8), DIMENSION(1,1) :: S ! Innovation covariance
REAL(8), DIMENSION(3,1), SAVE :: K ! Kalman gain matrix
REAL(8) :: R_m ! Measurement noise covariance [(rad/s)^2]
REAL(DbKi), DIMENSION(3,3) :: F ! First order system jacobian
REAL(DbKi), DIMENSION(3,3), SAVE :: P ! Covariance estiamte
REAL(DbKi), DIMENSION(1,3) :: H ! Output equation jacobian
REAL(DbKi), DIMENSION(3,1), SAVE :: xh ! Estimated state matrix
REAL(DbKi), DIMENSION(3,1) :: dxh ! Estimated state matrix deviation from previous timestep
REAL(DbKi), DIMENSION(3,3) :: Q ! Process noise covariance matrix
REAL(DbKi), DIMENSION(1,1) :: S ! Innovation covariance
REAL(DbKi), DIMENSION(3,1), SAVE :: K ! Kalman gain matrix
REAL(DbKi) :: R_m ! Measurement noise covariance [(rad/s)^2]

CHARACTER(*), PARAMETER :: RoutineName = 'WindSpeedEstimator'

Expand Down Expand Up @@ -231,11 +231,11 @@ SUBROUTINE WindSpeedEstimator(LocalVar, CntrPar, objInst, PerfData, DebugVar, Er
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 = max(LocalVar%RotSpeedF, EPSILON(1.0))
om_r = max(LocalVar%RotSpeedF, EPSILON(1.0_DbKi))
v_t = 0.0
v_m = LocalVar%HorWindV
v_h = LocalVar%HorWindV
lambda = max(LocalVar%RotSpeed, EPSILON(1.0)) * CntrPar%WE_BladeRadius/v_h
lambda = max(LocalVar%RotSpeed, EPSILON(1.0_DbKi)) * 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 @@ -246,7 +246,7 @@ SUBROUTINE WindSpeedEstimator(LocalVar, CntrPar, objInst, PerfData, DebugVar, Er
A_op = interp1d(CntrPar%WE_FOPoles_v,CntrPar%WE_FOPoles,v_h,ErrVar)

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

Expand Down Expand Up @@ -280,7 +280,7 @@ SUBROUTINE WindSpeedEstimator(LocalVar, CntrPar, objInst, PerfData, DebugVar, Er


! Wind Speed Estimate
om_r = max(xh(1,1), EPSILON(1.0))
om_r = max(xh(1,1), EPSILON(1.0_DbKi))
v_t = xh(2,1)
v_m = xh(3,1)
v_h = v_t + v_m
Expand All @@ -301,11 +301,8 @@ SUBROUTINE WindSpeedEstimator(LocalVar, CntrPar, objInst, PerfData, DebugVar, Er
DebugVar%WE_Vt = v_t
DebugVar%WE_lambda = lambda
ELSE
! Define Variables
F_WECornerFreq = 0.20944 ! Fix to 30 second time constant for now

! Filter wind speed at hub height as directly passed from OpenFAST
LocalVar%WE_Vw = LPFilter(LocalVar%HorWindV, LocalVar%DT, F_WECornerFreq, LocalVar%iStatus, .FALSE., objInst%instLPF)
LocalVar%WE_Vw = LPFilter(LocalVar%HorWindV, LocalVar%DT, CntrPar%F_WECornerFreq, LocalVar%iStatus, .FALSE., objInst%instLPF)
ENDIF

! Add RoutineName to error message
Expand All @@ -327,7 +324,7 @@ SUBROUTINE SetpointSmoother(LocalVar, CntrPar, objInst)
TYPE(LocalVariables), INTENT(INOUT) :: LocalVar
TYPE(ObjectInstances), INTENT(INOUT) :: objInst
! Allocate Variables
REAL(8) :: DelOmega ! Reference generator speed shift, rad/s.
REAL(DbKi) :: DelOmega ! Reference generator speed shift, rad/s.

! ------ Setpoint Smoothing ------
IF ( CntrPar%SS_Mode == 1) THEN
Expand All @@ -342,7 +339,7 @@ SUBROUTINE SetpointSmoother(LocalVar, CntrPar, objInst)

END SUBROUTINE SetpointSmoother
!-------------------------------------------------------------------------------------------------------------------------------
REAL FUNCTION PitchSaturation(LocalVar, CntrPar, objInst, DebugVar, ErrVar)
REAL(DbKi) FUNCTION PitchSaturation(LocalVar, CntrPar, objInst, DebugVar, ErrVar)
! PitchSaturation defines a minimum blade pitch angle based on a lookup table provided by DISCON.IN
! SS_Mode = 0, No setpoint smoothing
! SS_Mode = 1, Implement pitch saturation
Expand All @@ -367,7 +364,7 @@ REAL FUNCTION PitchSaturation(LocalVar, CntrPar, objInst, DebugVar, ErrVar)

END FUNCTION PitchSaturation
!-------------------------------------------------------------------------------------------------------------------------------
REAL FUNCTION Shutdown(LocalVar, CntrPar, objInst)
REAL(DbKi) FUNCTION Shutdown(LocalVar, CntrPar, objInst)
! 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
Expand All @@ -379,7 +376,7 @@ REAL FUNCTION Shutdown(LocalVar, CntrPar, objInst)
TYPE(ObjectInstances), INTENT(INOUT) :: objInst

! Local Variables
REAL(8) :: SD_BlPitchF
REAL(DbKi) :: SD_BlPitchF
! Initialize Shutdown Varible
IF (LocalVar%iStatus == 0) THEN
LocalVar%SD = .FALSE.
Expand All @@ -401,7 +398,7 @@ REAL FUNCTION Shutdown(LocalVar, CntrPar, objInst)
! Pitch Blades to 90 degrees at max pitch rate if in shutdown mode
IF (LocalVar%SD) THEN
Shutdown = LocalVar%BlPitch(1) + CntrPar%PC_MaxRat*LocalVar%DT
IF (MODULO(LocalVar%Time, 10.0) == 0) THEN
IF (MODULO(LocalVar%Time, 10.0_DbKi) == 0) THEN
print *, ' ** SHUTDOWN MODE **'
ENDIF
ELSE
Expand Down
Loading

0 comments on commit aa888a1

Please sign in to comment.