Skip to content

Commit

Permalink
fix units in write_DISCON
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Feb 5, 2021
1 parent ed019eb commit df28b09
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions ROSCO_toolbox/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def write_DISCON(turbine, controller, param_file='DISCON.IN', txt_filename='Cp_C
file.write('\n')
file.write('!------- FILTERS ----------------------------------------------------------\n')
file.write('{:<13.5f} ! F_LPFCornerFreq - Corner frequency (-3dB point) in the low-pass filters, [rad/s]\n'.format(turbine.bld_edgewise_freq * 1/4))
file.write('{:<13.5f} ! F_LPFDamping - Damping coefficient [used only when F_FilterType = 2]\n'.format(controller.F_LPFDamping))
file.write('{:<13.5f} ! F_LPFDamping - Damping coefficient {{used only when F_FilterType = 2}} [-]\n'.format(controller.F_LPFDamping))
file.write('{:<13.5f} ! F_NotchCornerFreq - Natural frequency of the notch filter, [rad/s]\n'.format(turbine.twr_freq))
file.write('{:<10.5f}{:<9.5f} ! F_NotchBetaNumDen - Two notch damping values (numerator and denominator, resp) - determines the width and depth of the notch, [-]\n'.format(0.0,0.25))
file.write('{:<014.5f} ! F_SSCornerFreq - Corner frequency (-3dB point) in the first order low pass filter for the setpoint smoother, [rad/s].\n'.format(controller.ss_cornerfreq))
Expand All @@ -89,9 +89,9 @@ def write_DISCON(turbine, controller, param_file='DISCON.IN', txt_filename='Cp_C
file.write('\n')
file.write('!------- BLADE PITCH CONTROL ----------------------------------------------\n')
file.write('{:<11d} ! PC_GS_n - Amount of gain-scheduling table entries\n'.format(len(controller.pitch_op_pc)))
file.write('{} ! PC_GS_angles - Gain-schedule table: pitch angles\n'.format(''.join('{:<4.6f} '.format(controller.pitch_op_pc[i]) for i in range(len(controller.pitch_op_pc)))))
file.write('{} ! PC_GS_KP - Gain-schedule table: pitch controller kp gains\n'.format(''.join('{:<4.6f} '.format(controller.pc_gain_schedule.Kp[i]) for i in range(len(controller.pc_gain_schedule.Kp)))))
file.write('{} ! PC_GS_KI - Gain-schedule table: pitch controller ki gains\n'.format(''.join('{:<4.6f} '.format(controller.pc_gain_schedule.Ki[i]) for i in range(len(controller.pc_gain_schedule.Ki)))))
file.write('{} ! PC_GS_angles - Gain-schedule table: pitch angles [rad].\n'.format(''.join('{:<4.6f} '.format(controller.pitch_op_pc[i]) for i in range(len(controller.pitch_op_pc)))))
file.write('{} ! PC_GS_KP - Gain-schedule table: pitch controller kp gains [s].\n'.format(''.join('{:<4.6f} '.format(controller.pc_gain_schedule.Kp[i]) for i in range(len(controller.pc_gain_schedule.Kp)))))
file.write('{} ! PC_GS_KI - Gain-schedule table: pitch controller ki gains [-].\n'.format(''.join('{:<4.6f} '.format(controller.pc_gain_schedule.Ki[i]) for i in range(len(controller.pc_gain_schedule.Ki)))))
file.write('{} ! PC_GS_KD - Gain-schedule table: pitch controller kd gains\n'.format(''.join('{:<1.1f} '.format(0.0) for i in range(len(controller.pc_gain_schedule.Ki)))))
file.write('{} ! PC_GS_TF - Gain-schedule table: pitch controller tf gains (derivative filter)\n'.format(''.join('{:<1.1f} '.format(0.0) for i in range(len(controller.pc_gain_schedule.Ki)))))
file.write('{:<014.5f} ! PC_MaxPit - Maximum physical pitch limit, [rad].\n'.format(controller.max_pitch))
Expand All @@ -115,13 +115,13 @@ def write_DISCON(turbine, controller, param_file='DISCON.IN', txt_filename='Cp_C
file.write('{:<014.5f} ! VS_MaxTq - Maximum generator torque in Region 3 (HSS side), [Nm].\n'.format(turbine.max_torque))
file.write('{:<014.5f} ! VS_MinTq - Minimum generator (HSS side), [Nm].\n'.format(0.0))
file.write('{:<014.5f} ! VS_MinOMSpd - Optimal mode minimum speed, cut-in speed towards optimal mode gain path, [rad/s]\n'.format(controller.vs_minspd))
file.write('{:<014.5f} ! VS_Rgn2K - Generator torque constant in Region 2 (HSS side), [N-m/(rad/s)^2]\n'.format(controller.vs_rgn2K))
file.write('{:<014.5f} ! VS_Rgn2K - Generator torque constant in Region 2 (HSS side), [Nm/(rad/s)^2]\n'.format(controller.vs_rgn2K))
file.write('{:<014.5f} ! VS_RtPwr - Wind turbine rated power [W]\n'.format(turbine.rated_power))
file.write('{:<014.5f} ! VS_RtTq - Rated torque, [Nm].\n'.format(turbine.rated_torque))
file.write('{:<014.5f} ! VS_RefSpd - Rated generator speed [rad/s]\n'.format(controller.vs_refspd))
file.write('{:<11d} ! VS_n - Number of generator PI torque controller gains\n'.format(1))
file.write('{:<014.5f} ! VS_KP - Proportional gain for generator PI torque controller [1/(rad/s) Nm]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)\n'.format(controller.vs_gain_schedule.Kp[-1]))
file.write('{:<014.5f} ! VS_KI - Integral gain for generator PI torque controller [1/rad Nm]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)\n'.format(controller.vs_gain_schedule.Ki[-1]))
file.write('{:<014.5f} ! VS_KP - Proportional gain for generator PI torque controller [-]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)\n'.format(controller.vs_gain_schedule.Kp[-1]))
file.write('{:<014.5f} ! VS_KI - Integral gain for generator PI torque controller [s]. (Only used in the transitional 2.5 region if VS_ControlMode =/ 2)\n'.format(controller.vs_gain_schedule.Ki[-1]))
file.write('{:<13.2f} ! VS_TSRopt - Power-maximizing region 2 tip-speed-ratio [rad].\n'.format(turbine.TSR_operational))
file.write('\n')
file.write('!------- SETPOINT SMOOTHER ---------------------------------------------\n')
Expand Down Expand Up @@ -151,8 +151,8 @@ def write_DISCON(turbine, controller, param_file='DISCON.IN', txt_filename='Cp_C
file.write('{:<13.1f} ! Y_IPC_omegaLP - Low-pass filter corner frequency for the Yaw-by-IPC controller to filtering the yaw alignment error, [rad/s].\n'.format(0.0))
file.write('{:<13.1f} ! Y_IPC_zetaLP - Low-pass filter damping factor for the Yaw-by-IPC controller to filtering the yaw alignment error, [-].\n'.format(0.0))
file.write('{:<13.1f} ! Y_MErrSet - Yaw alignment error, set point [rad]\n'.format(0.0))
file.write('{:<13.1f} ! Y_omegaLPFast - Corner frequency fast low pass filter, 1.0 [Hz]\n'.format(0.0))
file.write('{:<13.1f} ! Y_omegaLPSlow - Corner frequency slow low pass filter, 1/60 [Hz]\n'.format(0.0))
file.write('{:<13.1f} ! Y_omegaLPFast - Corner frequency fast low pass filter, 1.0 [rad/s]\n'.format(0.0))
file.write('{:<13.1f} ! Y_omegaLPSlow - Corner frequency slow low pass filter, 1/60 [rad/s]\n'.format(0.0))
file.write('{:<13.1f} ! Y_Rate - Yaw rate [rad/s]\n'.format(0.0))
file.write('\n')
file.write('!------- TOWER FORE-AFT DAMPING -------------------------------------------\n')
Expand All @@ -175,7 +175,7 @@ def write_DISCON(turbine, controller, param_file='DISCON.IN', txt_filename='Cp_C
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]\n'.format(controller.Ki_flap[-1]))
file.write('{:<014.8e} ! Flp_Ki - Flap displacement integral gain for flap control [-]\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()

Expand Down

0 comments on commit df28b09

Please sign in to comment.