From 5874acb4603a4e122bf4b8c8371be3370850b8c7 Mon Sep 17 00:00:00 2001 From: Nikhar Abbas Date: Thu, 13 Feb 2020 23:25:03 -0700 Subject: [PATCH] Add flap max pitch as parameter --- ROSCO_toolbox/controller.py | 8 ++++++++ ROSCO_toolbox/utilities.py | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ROSCO_toolbox/controller.py b/ROSCO_toolbox/controller.py index 1e7bae00c..d5561fed6 100644 --- a/ROSCO_toolbox/controller.py +++ b/ROSCO_toolbox/controller.py @@ -127,6 +127,14 @@ def __init__(self, controller_params): else: self.sd_maxpit = None + if controller_params['flp_maxpit']: + self.flp_maxpit = controller_params['flp_maxpit'] + else: + if controller_params['Flp_Mode'] > 0: + self.flp_maxpit = 10.0 * deg2rad + else: + self.flp_maxpit = 0.0 + def tune_controller(self, turbine): """ Given a turbine model, tune a controller based on the NREL generic controller tuning process diff --git a/ROSCO_toolbox/utilities.py b/ROSCO_toolbox/utilities.py index 379a2e1c3..e3b630abc 100644 --- a/ROSCO_toolbox/utilities.py +++ b/ROSCO_toolbox/utilities.py @@ -572,7 +572,8 @@ def write_param_file(self, turbine, controller, param_file='DISCON.IN', txt_file file.write('!------- FLAP ACTUATION -----------------------------------------------------\n') file.write('{:<014.5f} ! Flp_Angle - Initial or steady state flap angle [rad]\n'.format(controller.flp_angle)) file.write('{:<014.8e} ! Flp_Kp - Blade root bending moment proportional gain for flap control [s]\n'.format(controller.Kp_flap[-1])) - file.write('{:<014.8e} ! Flp_Ki - Flap displacement integral gain for flap control [s]'.format(controller.Ki_flap[-1])) + file.write('{:<014.8e} ! Flp_Ki - Flap displacement integral gain for flap control [s]\n'.format(controller.Ki_flap[-1])) + file.write('{:<014.5f} ! Flp_MaxPit - Maximum (and minimum) flap pitch angle [rad]'.format(controller.flp_maxpit)) file.close() def write_rotor_performance(self,turbine,txt_filename='Cp_Ct_Cq.txt'):