OpenFAST / openfast

Main repository for the NREL-supported OpenFAST whole-turbine and FAST.Farm wind farm simulation codes.
http://openfast.readthedocs.io
Apache License 2.0
690 stars 457 forks source link

Linearization of 5MW in FAST V8 #478

Closed caroledaniel closed 3 years ago

caroledaniel commented 4 years ago

Hello, I'm trying to linearize the model 5MW offshore turbine in region 2, i dont know which steps i need to do or numbers i need to change.

caroledaniel commented 4 years ago

@jjonkman @NRELAdmin

jjonkman commented 4 years ago

Dear @caroledaniel,

The linearization capability for offshore wind turbines was not available in FAST v8. This was added recently in OpenFAST--see: https://github.com/OpenFAST/openfast/pull/350.

There have been many discussions regarding how to perform a linearization analysis on our forum--search for similar questions here: https://wind.nrel.gov/forum/wind/.

Best regards,

caroledaniel commented 4 years ago

Dear @jjonkman , sorry but i meant the onshore 5MW , Test 26

jjonkman commented 4 years ago

Dear @caroledaniel,

Test26 is a model of the NREL 5-MW turbine with a BeamDyn representation of the blade structural dynamics. Linearization with BeamDyn was not available in FAST v8, but introduced in OpenFAST a while ago. You said you are using FAST v8, but are you actually using some version of OpenFAST?

Best regards,

caroledaniel commented 4 years ago

No, i'm using only v8. i was capable of linearizing the model in region 3 but it failed in region2

caroledaniel commented 4 years ago

i'm using 2 DOF : DrTrDOF GenDOF. my target is to have torque controller in region 2 for a variable speed wind turbine

jjonkman commented 4 years ago

So, you have not enabled BeamDyn? What do you mean by "failed"?

caroledaniel commented 4 years ago

this is my input file for test 26

------- FAST v8.16.* INPUT FILE ------------------------------------------------ FAST Certification Test #26: NREL 5.0 MW Baseline Wind Turbine (Onshore) ---------------------- SIMULATION CONTROL -------------------------------------- False Echo - Echo input data to .ech (flag) "FATAL" AbortLevel - Error level when simulation should abort (string) {"WARNING", "SEVERE", "FATAL"} 100 TMax - Total run time (s) 0.01 DT - Recommended module time step (s) 2 InterpOrder - Interpolation order for input/output time history (-) {1=linear, 2=quadratic} 0 NumCrctn - Number of correction iterations (-) {0=explicit calculation, i.e., no corrections} 99999 DT_UJac - Time between calls to get Jacobians (s) 1E+06 UJacSclFact - Scaling factor used in Jacobians (-) ---------------------- FEATURE SWITCHES AND FLAGS ------------------------------ 1 CompElast - Compute structural dynamics (switch) {1=ElastoDyn; 2=ElastoDyn + BeamDyn for blades} 1 CompInflow - Compute inflow wind velocities (switch) {0=still air; 1=InflowWind; 2=external from OpenFOAM} 2 CompAero - Compute aerodynamic loads (switch) {0=None; 1=AeroDyn v14; 2=AeroDyn v15} 1 CompServo - Compute control and electrical-drive dynamics (switch) {0=None; 1=ServoDyn} 0 CompHydro - Compute hydrodynamic loads (switch) {0=None; 1=HydroDyn} 0 CompSub - Compute sub-structural dynamics (switch) {0=None; 1=SubDyn} 0 CompMooring - Compute mooring system (switch) {0=None; 1=MAP++; 2=FEAMooring; 3=MoorDyn; 4=OrcaFlex} 0 CompIce - Compute ice loads (switch) {0=None; 1=IceFloe; 2=IceDyn} ---------------------- INPUT FILES --------------------------------------------- "5MW_Baseline/NRELOffshrBsline5MW_Onshore_ElastoDyn_BDoutputs.dat" EDFile - Name of file containing ElastoDyn input parameters (quoted string) "5MW_Baseline/NRELOffshrBsline5MW_BeamDyn.dat" BDBldFile(1) - Name of file containing BeamDyn input parameters for blade 1 (quoted string) "5MW_Baseline/NRELOffshrBsline5MW_BeamDyn.dat" BDBldFile(2) - Name of file containing BeamDyn input parameters for blade 2 (quoted string) "5MW_Baseline/NRELOffshrBsline5MW_BeamDyn.dat" BDBldFile(3) - Name of file containing BeamDyn input parameters for blade 3 (quoted string) "5MW_Baseline/NRELOffshrBsline5MW_InflowWind_12mps.dat" InflowFile - Name of file containing inflow wind input parameters (quoted string) "5MW_Baseline/NRELOffshrBsline5MW_Onshore_AeroDyn15.dat" AeroFile - Name of file containing aerodynamic input parameters (quoted string) "5MW_Baseline/NRELOffshrBsline5MW_Onshore_ServoDyn.dat" ServoFile - Name of file containing control and electrical-drive input parameters (quoted string) "unused" HydroFile - Name of file containing hydrodynamic input parameters (quoted string) "unused" SubFile - Name of file containing sub-structural input parameters (quoted string) "unused" MooringFile - Name of file containing mooring system input parameters (quoted string) "unused" IceFile - Name of file containing ice input parameters (quoted string) ---------------------- OUTPUT -------------------------------------------------- True SumPrint - Print summary data to ".sum" (flag) 1 SttsTime - Amount of time between screen status messages (s) 99999 ChkptTime - Amount of time between creating checkpoint files for potential restart (s) "default" DT_Out - Time step for tabular output (s) (or "default") 0 TStart - Time to begin tabular output (s) 2 OutFileFmt - Format for tabular (time-marching) output file (switch) {1: text file [.out], 2: binary file [.outb], 3: both} True TabDelim - Use tab delimiters in text tabular output file? (flag) {uses spaces if false} "ES10.3E2" OutFmt - Format used for text tabular output, excluding the time channel. Resulting field should be 10 characters. (quoted string) ---------------------- LINEARIZATION ------------------------------------------- True Linearize - Linearization analysis (flag) 36 NLinTimes - Number of times to linearize (-) [>=1] [unused if Linearize=False] 50,50.13774,50.27548,50.41322,50.55096,50.6887,50.82644,50.96418,51.10192,51.23966,51.3774,51.51514, 51.65288,51.79062,51.92836,52.0661,52.20384,52.34158,52.47932,52.61706,52.7548,52.89254,53.03028,53.16802, 53.30576,53.4435,53.58124,53.71898,53.85672,53.99446,54.1322,54.26994,54.40768,54.54542,54.68316,54.8209 LinTimes - List of times at which to linearize (s) [1 to NLinTimes] [unused if Linearize=False] 1 LinInputs - Inputs included in linearization (switch) {0=none; 1=standard; 2=all module inputs (debug)} [unused if Linearize=False] 1 LinOutputs - Outputs included in linearization (switch) {0=none; 1=from OutList(s); 2=all module outputs (debug)} [unused if Linearize=False] False LinOutJac - Include full Jacobians in linearization output (for debug) (flag) [unused if Linearize=False; used only if LinInputs=LinOutputs=2] False LinOutMod - Write module-level linearization output files in addition to output for full system? (flag) [unused if Linearize=False] ---------------------- VISUALIZATION ------------------------------------------ 0 WrVTK - VTK visualization data output: (switch) {0=none; 1=initialization data only; 2=animation} 2 VTK_type - Type of VTK visualization data: (switch) {1=surfaces; 2=basic meshes (lines/points); 3=all meshes (debug)} [unused if WrVTK=0] False VTK_fields - Write mesh fields to VTK data files? (flag) {true/false} [unused if WrVTK=0] 15 VTK_fps - Frame rate for VTK output (frames per second){will use closest integer multiple of DT} [used only if WrVTK=2]

caroledaniel commented 4 years ago

This is ServoDyn:

------- SERVODYN v1.05.* INPUT FILE -------------------------------------------- NREL 5.0 MW Baseline Wind Turbine for Use in Offshore Analysis. Properties from Dutch Offshore Wind Energy Converter (DOWEC) 6MW Pre-Design (10046_009.pdf) and REpower

5M 5MW (5m_uk.pdf) ---------------------- SIMULATION CONTROL -------------------------------------- False Echo - Echo input data to .ech (flag) "default" DT - Communication interval for controllers (s) (or "default") ---------------------- PITCH CONTROL ------------------------------------------- 0 PCMode - Pitch control mode {0: none, 3: user-defined from routine PitchCntrl, 4: user-defined from Simulink/Labview, 5: user-defined from Bladed-

style DLL} (switch) 0 TPCOn - Time to enable active pitch control (s) [unused when PCMode=0] 9999.9 TPitManS(1) - Time to start override pitch maneuver for blade 1 and end standard pitch control (s) 9999.9 TPitManS(2) - Time to start override pitch maneuver for blade 2 and end standard pitch control (s) 9999.9 TPitManS(3) - Time to start override pitch maneuver for blade 3 and end standard pitch control (s) [unused for 2 blades] 2 PitManRat(1) - Pitch rate at which override pitch maneuver heads toward final pitch angle for blade 1 (deg/s) 2 PitManRat(2) - Pitch rate at which override pitch maneuver heads toward final pitch angle for blade 2 (deg/s) 2 PitManRat(3) - Pitch rate at which override pitch maneuver heads toward final pitch angle for blade 3 (deg/s) [unused for 2 blades] 0 BlPitchF(1) - Blade 1 final pitch for pitch maneuvers (degrees) 0 BlPitchF(2) - Blade 2 final pitch for pitch maneuvers (degrees) 0 BlPitchF(3) - Blade 3 final pitch for pitch maneuvers (degrees) [unused for 2 blades] ---------------------- GENERATOR AND TORQUE CONTROL ---------------------------- 1 VSContrl - Variable-speed control mode {0: none, 1: simple VS, 3: user-defined from routine UserVSCont, 4: user-defined from Simulink/Labview, 5: user-

defined from Bladed-style DLL} (switch) 1 GenModel - Generator model {1: simple, 2: Thevenin, 3: user-defined from routine UserGen} (switch) [used only when VSContrl=0] 94.4 GenEff - Generator efficiency [ignored by the Thevenin and user-defined generator models] (%) True GenTiStr - Method to start the generator {T: timed using TimGenOn, F: generator speed using SpdGenOn} (flag) True GenTiStp - Method to stop the generator {T: timed using TimGenOf, F: when generator power = 0} (flag) 9999.9 SpdGenOn - Generator speed to turn on the generator for a startup (HSS speed) (rpm) [used only when GenTiStr=False] 0 TimGenOn - Time to turn on the generator for a startup (s) [used only when GenTiStr=True] 9999.9 TimGenOf - Time to turn off the generator (s) [used only when GenTiStp=True] ---------------------- SIMPLE VARIABLE-SPEED TORQUE CONTROL -------------------- 9999.9 VS_RtGnSp - Rated generator speed for simple variable-speed generator control (HSS side) (rpm) [used only when VSContrl=1] 9999.9 VS_RtTq - Rated generator torque/constant generator torque in Region 3 for simple variable-speed generator control (HSS side) (N-m) [used only when

VSContrl=1] 9999.9 VS_Rgn2K - Generator torque constant in Region 2 for simple variable-speed generator control (HSS side) (N-m/rpm^2) [used only when VSContrl=1] 9999.9 VS_SlPc - Rated generator slip percentage in Region 2 1/2 for simple variable-speed generator control (%) [used only when VSContrl=1] ---------------------- SIMPLE INDUCTION GENERATOR ------------------------------ 9999.9 SIG_SlPc - Rated generator slip percentage (%) [used only when VSContrl=0 and GenModel=1] 9999.9 SIG_SySp - Synchronous (zero-torque) generator speed (rpm) [used only when VSContrl=0 and GenModel=1] 9999.9 SIG_RtTq - Rated torque (N-m) [used only when VSContrl=0 and GenModel=1] 9999.9 SIG_PORt - Pull-out ratio (Tpullout/Trated) (-) [used only when VSContrl=0 and GenModel=1] ---------------------- THEVENIN-EQUIVALENT INDUCTION GENERATOR ----------------- 9999.9 TEC_Freq - Line frequency [50 or 60] (Hz) [used only when VSContrl=0 and GenModel=2] 9998 TEC_NPol - Number of poles [even integer > 0] (-) [used only when VSContrl=0 and GenModel=2] 9999.9 TEC_SRes - Stator resistance (ohms) [used only when VSContrl=0 and GenModel=2] 9999.9 TEC_RRes - Rotor resistance (ohms) [used only when VSContrl=0 and GenModel=2] 9999.9 TEC_VLL - Line-to-line RMS voltage (volts) [used only when VSContrl=0 and GenModel=2] 9999.9 TEC_SLR - Stator leakage reactance (ohms) [used only when VSContrl=0 and GenModel=2] 9999.9 TEC_RLR - Rotor leakage reactance (ohms) [used only when VSContrl=0 and GenModel=2] 9999.9 TEC_MR - Magnetizing reactance (ohms) [used only when VSContrl=0 and GenModel=2] ---------------------- HIGH-SPEED SHAFT BRAKE ---------------------------------- 0 HSSBrMode - HSS brake model {0: none, 1: simple, 3: user-defined from routine UserHSSBr, 4: user-defined from Simulink/Labview, 5: user-defined from

Bladed-style DLL} (switch) 9999.9 THSSBrDp - Time to initiate deployment of the HSS brake (s) 0.6 HSSBrDT - Time for HSS-brake to reach full deployment once initiated (sec) [used only when HSSBrMode=1] 28116.2 HSSBrTqF - Fully deployed HSS-brake torque (N-m) ---------------------- NACELLE-YAW CONTROL ------------------------------------- 0 YCMode - Yaw control mode {0: none, 3: user-defined from routine UserYawCont, 4: user-defined from Simulink/Labview, 5: user-defined from Bladed-

style DLL} (switch) 9999.9 TYCOn - Time to enable act

caroledaniel commented 4 years ago

When i Run my openloop i get an error saying that VS_Rgn2K*VS_RtGnSp ^2 must not be greater than VS_RtTq

caroledaniel commented 4 years ago

@jjonkman @bjonkman

jjonkman commented 4 years ago

This error results from using VSContrl = 1, but not setting appropriate values for VS_RtGnSp, VS_RtTq, VS_Rgn2K, and VS_SlPc.

Normally it is recommend to use a constant generator torque during the linearization process, as described in the "Linearization" section of the old FAST User's Guide. To summarize, to set constant torque in ServoDyn, it is easiest to set VSContrl = 1, VS_RtTq = the constant torque you want in Nm (e.g., 43093.55 Nm is the rated generator torque of the NREL 5-MW turbine) and VS_RtGnSp = VS_Rgn2K = VS_SlPc = some small number greater than zero, e.g., 0.001.

caroledaniel commented 4 years ago

i did as you said and it got me another error: i set the set VSContrl = 1, VS_RtTq = the constant torque you want in Nm =43093.55 Nm ind VS_RtGnSp = VS_Rgn2K = VS_SlPc = 0.001.

FAST_Solution:CalcOutputs_And_SolveForInputs:SolveOption2:SrvD_CalcOutput:CalculateTorque:u%HSS_Spd is negative. Simple variable-speed control model is not valid for motoring situations.

caroledaniel commented 4 years ago

@jjonkman @bjonkman

caroledaniel commented 4 years ago

are those numbers valid for region2? as i'm trying to linearize at 8m/s

jjonkman commented 4 years ago

43093.55 Nm is the rated torque of the NREL 5-MW baseline turbine, so, not suitable for region 2. My guess is this generator torque is higher than the aerodynamic torque, which is slowing down the rotor and triggering the error.

To obtain a steady-state solution suitable for linearization, you should set the torque appropriate to the mean wind speed you are simulating. Expected steady-state values for the NREL 5-MW baseline turbine are documented in Figure 9-1 of its specifications report: https://www.nrel.gov/docs/fy09osti/38060.pdf.

caroledaniel commented 4 years ago

So if i’ll linearize at 8m/s, my goal is to reach its rated torque(2000 Nm) right?

jjonkman commented 4 years ago

The torques are plotted in kNm in that figure, not Nm. And you want the generator torque, not rotor torque. The expected generator torque at 8 m/s is around 20000 Nm.

caroledaniel commented 4 years ago

Thank you, i have another question. Im trying to implement a torque controller using mpc in region 2. As i said my 2 DOF are drive train and generator. So basically i have 4 states. I’m trying to put a reference for the third state which is the perturbation of the generator speed. Some are saying i need to get the feedback from this state and minus from it the reference state but it failed. Could you please help me on this?

jjonkman commented 4 years ago

I'm not sure I understand what you are saying, but you'll likely need to eliminate the generator azimuth state from your state-space model (reducing the total states from 4 to 3). See the following forum topic for more information: https://wind.nrel.gov/forum/wind/viewtopic.php?f=4&t=1903&p=9924. As I said before, the linearization process has been discussed many times on our forum. Please use "Search" there and review the many questions and answers before posting additional linearization questions here.

caroledaniel commented 4 years ago

I'm trying to simulate my controller and i get this error, keep in mind i'm not putting Yaw as a DOF: FAST_Solution:FAST_AdvanceStates:AD_UpdateStates:BEMT_UpdateStates(node 2, blade 1):BEMT_UnCoupledSolve:DeterminePhiBounds:There is no valid value of phi for these operating conditions! Vx = NaN, Vy = NaN, rlocal = NaN, theta = NaN

caroledaniel commented 4 years ago

I read some articles about changing aeroDyn file, but i dont understand which file to be changed. im using NRELOFFSHORE5MWBaseline_Onshore_aerodyn15,dat file. what changes should i do? @jjonkman @bjonkman

caroledaniel commented 4 years ago

also i'm using onshore 5MW , Test 26

jjonkman commented 4 years ago

You are getting "NaN" in your solution, which suggests to me some sort of numerical or physical instability. You mention that you are using your own controller; does the solution work as expect without your controller? If so, I would guess that there is a problem in your controller. I can't really comment more without knowing more about how you've set up your OpenFAST model.