@@ -26,6 +26,7 @@ function Linearization_OpeningFcn(hObject, eventdata, handles, varargin)
2626handles.Nacelle = varargin{4 };
2727handles.Control = varargin{5 };
2828handles.Drivetrain = varargin{6 };
29+ handles.AirDensity = varargin{7 };
2930
3031% Propose values for the wind speed range
3132set(handles .WindSpeed_From , ' String' , int2str(ceil(handles .Control .WindSpeed .Cutin )))
@@ -71,6 +72,7 @@ function SetFullLoad_Callback(hObject, eventdata, handles)
7172Airfoil = handles .Airfoil ;
7273Drivetrain = handles .Drivetrain ;
7374Control = handles .Control ;
75+ AirDensity = handles .AirDensity ;
7476
7577% Find rated wind speed by comparing demanded torque at rotational speed C
7678disp(' Searching for rated wind speed...' )
@@ -91,7 +93,7 @@ function SetFullLoad_Callback(hObject, eventdata, handles)
9193 for iter = 1 : 100
9294 U_new = U1 + abs((Control .Torque .Demanded - Qr1 )/(Qr1 - Qr2 ))*(U2 - U1 );
9395 [~ , CQr ] = PerformanceCoefficients(Blade , Airfoil , Control .Pitch .Fine , (OmegaC / Drivetrain .Gearbox .Ratio )*Blade .Radius(end )/U_new );
94- Qr_new = 0.5 * CQr * 1.225 * U_new ^ 2 * pi * Blade .Radius(end )^3 * Drivetrain .Gearbox .Efficiency / Drivetrain .Gearbox .Ratio ;
96+ Qr_new = 0.5 * CQr * AirDensity * U_new ^ 2 * pi * Blade .Radius(end )^3 * Drivetrain .Gearbox .Efficiency / Drivetrain .Gearbox .Ratio ;
9597 if abs((Qr_new - Control .Torque .Demanded )/Control .Torque .Demanded ) < 0.005
9698 success = true ;
9799 break
@@ -167,6 +169,7 @@ function Linearize_Callback(hObject, eventdata, handles)
167169Nacelle = handles .Nacelle ;
168170Control = handles .Control ;
169171Drivetrain = handles .Drivetrain ;
172+ AirDensity = handles .AirDensity ;
170173
171174% Run modal analysis for 0 rpm
172175disp(' Finding non-rotating mode shapes...' )
@@ -199,7 +202,7 @@ function Linearize_Callback(hObject, eventdata, handles)
199202
200203% Steady state curves
201204disp(' Determining steady state rotational speeds and pitch angles...' )
202- [~ , ~ , OmegaU , PitchAngle ] = SteadyState(Blade , Airfoil , Drivetrain , Control , WindSpeeds );
205+ [~ , ~ , OmegaU , PitchAngle ] = SteadyState(Blade , Airfoil , Drivetrain , Control , WindSpeeds , AirDensity );
203206RPM = OmegaU * 60 /(2 * pi );
204207
205208% Avoid some common errors with linearization
@@ -224,7 +227,7 @@ function Linearize_Callback(hObject, eventdata, handles)
224227FAST_InputFileName = [pwd , filesep ' subfunctions' filesep ' inputfiles' filesep ' FAST.fst' ];
225228
226229% Turbine input files
227- AeroDyn(Blade ,Airfoil ,Tower ,LinMode );
230+ AeroDyn(Blade ,Airfoil ,Tower ,LinMode , AirDensity );
228231ServoDyn(Drivetrain ,Control ,LinMode );
229232
230233% Preload the OutList
@@ -304,11 +307,10 @@ function Linearize_Callback(hObject, eventdata, handles)
304307 % Set input
305308 Blade = handles .Blade ;
306309 Drivetrain = handles .Drivetrain ;
307-
308- rhoAir = 1.225 ; % Density of air [kg/m3]
310+ AirDensity = handles .AirDensity ;
309311
310312 % Calculate aerodynamic torque
311- Q = 0.5 * CQr * rhoAir * windSpeed ^ 2 * pi * Blade .Radius(end )^3 * Drivetrain .Gearbox .Efficiency / Drivetrain .Gearbox .Ratio ;
313+ Q = 0.5 * CQr * AirDensity * windSpeed ^ 2 * pi * Blade .Radius(end )^3 * Drivetrain .Gearbox .Efficiency / Drivetrain .Gearbox .Ratio ;
312314
313315%% Wind speed steps
314316function WindSpeed_From_Callback(hObject , eventdata , handles )
0 commit comments