diff --git a/.gitignore b/.gitignore index aaac7c06a..0f3bafe2b 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,7 @@ Matlab_Toolbox/*.slxc # Exclude testing results ROSCO_testing/results/ + +# Simulink/Matlab temp files +*.slxc +*.autosave diff --git a/Matlab_Toolbox/README.md b/Matlab_Toolbox/README.md index 6f4739c9f..eb672b93d 100644 --- a/Matlab_Toolbox/README.md +++ b/Matlab_Toolbox/README.md @@ -13,5 +13,5 @@ The modules not currently implemented include: - Shutdown control - Flap control -`runFAST.m` can be used to load the ROSCO parameters from a .IN file, using `load_ROSCO_params.m` and a more detailed version can be found in the `matlab-toolbox` [repository](https://github.com/dzalkind/matlab-toolbox/tree/master/Simulations). +`runFAST.m` can be used to load the ROSCO parameters from a .IN file, using `load_ROSCO_params.m`. Add the `matlab-toolbox` [repository](https://github.com/OpenFAST/matlab-toolbox) to your matlab path. diff --git a/Matlab_Toolbox/Utilities/Af_HPF.m b/Matlab_Toolbox/Utilities/Af_HPF.m new file mode 100644 index 000000000..e0dfb0953 --- /dev/null +++ b/Matlab_Toolbox/Utilities/Af_HPF.m @@ -0,0 +1,29 @@ +function [dHPF,HPF] = Af_HPF(omega,zeta,DT,varargin) +%% Example Code +% omega = 2*pi*6; %rad/s +% HPF = tf(om^2,[1,2*zeta*omega,omega^2]); +% dHFP = c2d(LPF,DT); +% +% varargin to specify order + +if isempty(varargin) + order = 2; +else + order = varargin{1}; +end + +if order == 2 + HPF = tf([1,0,0],[1,2*zeta*omega,omega^2]); +elseif order > 2 + [b,a] = butter(order,omega,'high','s'); + HPF = tf(b,a); +else + HPF = tf([1,0],[1,omega]); +end + +dHPF = c2d(HPF,DT,'tustin'); + +if 0 + figure(881); + bode(HPF); +end \ No newline at end of file diff --git a/Matlab_Toolbox/Utilities/Af_LPF.m b/Matlab_Toolbox/Utilities/Af_LPF.m new file mode 100644 index 000000000..0d29abde3 --- /dev/null +++ b/Matlab_Toolbox/Utilities/Af_LPF.m @@ -0,0 +1,29 @@ +function [dLPF,LPF] = Af_LPF(omega,zeta,DT,varargin) +%% Example Code +% omega = 2*pi*6; %rad/s +% LPF = tf(om^2,[1,2*zeta*omega,omega^2]); +% dLFP = c2d(LPF,DT); +% +% varargin to specify order + +if isempty(varargin) + order = 2; +else + order = varargin{1}; +end + +if order == 2 + LPF = tf(omega^2,[1,2*zeta*omega,omega^2]); +elseif order > 2 + [b,a] = butter(order,omega,'s'); + LPF = tf(b,a); +else + LPF = tf(omega,[1,omega]); +end + +dLPF = c2d(LPF,DT,'tustin'); + +if 0 + figure(881); + bode(LPF); +end \ No newline at end of file diff --git a/Matlab_Toolbox/Utilities/Af_MakeWind.m b/Matlab_Toolbox/Utilities/Af_MakeWind.m new file mode 100644 index 000000000..cced81f79 --- /dev/null +++ b/Matlab_Toolbox/Utilities/Af_MakeWind.m @@ -0,0 +1,376 @@ +function [windFileOut, W]=Af_MakeWind(fast,Disturbance,Simulation,varargin) +% Inputs: fast. struct +% Disturbance. struct +% .Type - type of wind input, options: const, steps, +% ramp, sine, step, EOG, ECD +% .U_ref - initial (or constant) wind before transient +% .LHshear - linear horizontal wind shear +% .Vshear - vertical (exponential) shear +% .LVshear - linear vertical shear +% .TStart - time to start transient event +% .TEnd - time to end transient event +% .Step - wind speed step size +% .Amp - amplitude (for sine) +% .Per - period (for sine and EOG) +% Simulation struct +% +% DZalkind 6/26/2020 - cleaned up old script, only const and step tested + +%% Input Handling +if ~isempty(varargin) > 0 + Mplot = varargin{1}; +end + + +% Simulation parameters +if isfield(Simulation,'TMax') + TMax = Simulation.TMax; +else + TMax = 9000; +end + +% Disturbance.Type +if isfield(Disturbance,'Type') + TYPE = Disturbance.Type; +else + disp('Af_MakeWind Warning: no disturbance type, setting constant wind input') + TYPE = 'const'; +end + +% Disturbance DT is usually 0.05 sec, but we can set it +if ~isfield(Disturbance,'DT') + DT = 0.05; +else + DT = Disturbance.DT; +end + + +%% Type Input Handling + +% U_ref is needed for all +if ~isfield(Disturbance,'U_ref') + Disturbance.U_ref = 15; + disp(['Af_MakeWind Warning: no U_ref set for ', TYPE, ' step wind input, setting U_ref = 15 m/s']); +end + +if strcmp(TYPE,'step') % Single Step in Wind + + if ~isfield(Disturbance,'Step') + Disturbance.Step = 2; + disp('Af_MakeWind Warning: no Step set for step wind input, setting Step = 2 m/s'); + end + + if ~isfield(Disturbance,'TStart') + Disturbance.TStart = 100; + disp('Af_MakeWind Warning: no TStart set for step wind input, setting TStart = 100 s'); + end + +elseif strcmp(TYPE,'ramp') % Ramp wind going from Vmin to Vmax to min, ramp starts at Stime + if ~isfield(Disturbance,'U_max') + Disturbance.Umin = 3; + disp('Af_MakeWind Warning: no U_max set for ramp wind input, setting Umin = 3 m/s'); + end + + + if ~isfield(Disturbance,'TStart') + Disturbance.TStart = 100; + disp('Af_MakeWind Warning: no TStart set for ramp input, setting TStart = 100 s'); + end + + if ~isfield(Disturbance,'TEnd') + Disturbance.TEnd = 1100; + disp('Af_MakeWind Warning: no TEnd set for ramp input, setting TEnd = 1100 s'); + end + + +elseif strcmp(TYPE,'sine') % Sinusoidal wind of DC+amp*sin(2*pi*freq*t) + + if ~isfield(Disturbance,'Amp') + Disturbance.Amp = 2; + disp('Af_MakeWind Warning: no Amp set for sine wind input, setting Amp = 2 m/s'); + end + + if ~isfield(Disturbance,'Per') + Disturbance.Per = 30; + disp('Af_MakeWind Warning: no Per set for sine wind input, setting Per = 30 sec'); + end + +elseif strcmp(TYPE,'steps') % Multiple steps in wind from Umin to Umax + if ~isfield(Disturbance,'Umin') + Disturbance.Umin = 3; + disp('Af_MakeWind Warning: no Vmin set for steps wind input, setting Umin = 3 m/s'); + end + + if ~isfield(Disturbance,'Umax') + Disturbance.Umax = 25; + disp('Af_MakeWind Warning: no Umax set for steps wind input, setting Umax = 25 m/s'); + end + + if ~isfield(Disturbance,'TStart') + Disturbance.TStart = 100; + disp('Af_MakeWind Warning: no TStart set for steps input, setting TStart = 100 s'); + end + + if ~isfield(Disturbance,'TEnd') + Disturbance.TEnd = 1100; + disp('Af_MakeWind Warning: no TEnd set for steps input, setting TEnd = 1100 s'); + end + + +elseif strcmp(TYPE,'EOG') + if ~isfield(Disturbance,'TStart') + Disturbance.TStart = 100; + disp('Af_MakeWind Warning: no TStart set for EOG input, setting TStart = 100 s'); + end + + if ~isfield(Disturbance,'Per') + Disturbance.Per = 30; + disp('Af_MakeWind Warning: no Per set for EOG wind input, setting Per = 30 sec'); + end + +elseif strcmp(TYPE,'ECD') + if ~isfield(Disturbance,'TStart') + Disturbance.TStart = 100; + disp('Af_MakeWind Warning: no TStart set for ECD input, setting TStart = 100 s'); + end + + if ~isfield(Disturbance,'TEnd') + Disturbance.TEnd = 100; + disp('Af_MakeWind Warning: no TEnd set for EOG input, setting TEnd = 110 s'); + end + +end + +%% Initialize W matrix for .wnd input +% The following parameters are fully described in the TurbSim/Aerodyn docs. + +% TMax= Max time, DT=Time step, WD= Wind Direction, VS= Vertical speed +% Hshear=Linear horizontal shear, Vshear= Power Law Vertical Shear, +% LVshear= Linear Vertical Shear, GS= Gust Speed +% Mplot==1 will produce a plot of the generated wind file (hub height) + +% Note: If any shear parameter input is a scalar, it will produce a wind +% file with a constant shear. If the input shear parameter is a vector, +% it must be the same length as the generated wind file and is used as the +% time varying shear. + +% EXAMPLE with Header +% ! Time Wind Wind Vert. Horiz. Vert. LinV Gust +% ! Speed Dir Speed Shear Shear Shear Speed +% 0.0 30 0 -1 0.1 0.14 0 0 + +% Generated wind file is stored in the PWD\WindData folder with +% the appropriate name for the type. + +% Initialize +samples = round(TMax/DT+1); +W = zeros(samples, 8); + +% Time +W(:,1) = 0:DT:TMax; + +% Direction, set to 0 unless ECD +W(:,3) = 0; + +% Vertical Speed, none for now +W(:,4) = 0; + +% Horizontal Shear (linear) +if isfield(Disturbance, 'LHshear') + W(:,5) = Disturbance.LHsear; +else + W(:,5) = 0; +end + +% Vertical Shear (exponential) +if isfield(Disturbance, 'Vshear') + W(:,6) = Disturbance.Vshear; +else + W(:,6) = 0; +end + +% Linear Vertical Shear +if isfield(Disturbance, 'LVshear') + W(:,7) = Disturbance.LVshear; +else + W(:,7) = 0; +end + +% Gust, set to 0 for now, let wind speed do the work +W(:,8) = 0; + + + +%% Make W(:,2), Wind Speed Vector + +switch TYPE + case 'const' % p1=DC VALUE + W(:,2) = ones(samples,1)*Disturbance.U_ref; + + case 'step' + tt = W(:,1); + uu = Disturbance.U_ref * ones(size(tt)); + uu(tt>Disturbance.TStart) = Disturbance.U_ref + Disturbance.Step; + W(:,2) = uu; + + + case 'steps' %p1=min, p2=max, p3=ds + +% p2=p2+p3; +% +% sgn=sign(p2-p1); +% +% W(:,2)=ones(samples,1)*p1; +% steptime=round(samples/2/(sgn*(p2-p1)/p3)); +% +% for n=1:2*sgn*(p2-p1)/p3 +% b=(n-1)*steptime+1; +% e=n*steptime+1; +% if e>samples; +% e=samples; +% end +% if n<=sgn*(p2-p1)/p3 +% W(b:e,2)=p1+sgn*(n-1)*p3; +% end +% if n>sgn*(p2-p1)/p3 +% W(b:e,2)=p2-sgn*(n-sgn*(p2-p1)/p3)*p3; +% end +% end + + + case 'sine' % p1=dcwind, p2=freq, p3=amp, + W(:,2)= Disturbance.U_ref + Disturbance.Amp*sin(2 * pi * W(:,1) / Disturbance.Period); + + case 'ramp' % p1=min, p2=max, p3=ST + + % ramp time breakpoints + t_ramp = [Disturbance.TStart, (Disturbance.TStart + Disturbance.TEnd)/2, Disturbance.TEnd]; + v_ramp = [Disturbance.U_ref, Disturbance.U_max, Disturbance.U_ref]; + + % append start end + t_ramp = [0, t_ramp, Simulation.TMax]; + v_ramp = [Disturbance.U_ref, v_ramp, Disturbance.U_ref]; + + % catch non-unique t_ramp(s) + [t_ramp, iu] = unique(t_ramp); + v_ramp = v_ramp(iu); + + W(:,2) = interp1(t_ramp',v_ramp',W(:,1)); + + + +% case 'yaw_step' % p1:5 [ Wind Speed Initial Yaw Start Time Final Yaw End Time ] +% +% tt = W(:,1); +% +% if p3 == p5 %just a step +% yy = p2*ones(samples,1); +% yy(tt>p3) = p4; +% +% else %ramp +% X = [0,p3,p5,TMax]; +% V = [p2,p2,p4,p4]; +% yy = interp1(X,V,tt); +% end +% W(:,2) = ones(samples,1)*p1./cosd(yy)+1.373157942907710e-08; +% W(:,2) = ones(samples,1)*p1; +% W(:,3) = yy; +% + + case 'EOG' + p3 = Disturbance.Per; + p2 = Distrubance.TStart; + p1 = Disturbance.U_ref; + + tt = W(:,1); + tt_gust = (0:DT:p3)'; + U = p1; + gust = [zeros(p2/DT,1); + -0.37*p4*sin(3*pi*tt_gust/p3).*(1-cos(2*pi*tt_gust/p3)); + zeros(samples-p2/DT-p3/DT-1,1)]; + W(:,2) = U+gust; + + case 'ECD' + p1 = Disturbance.U_ref; + p2 = Disturbance.TStart; + p3 = Distrubance.TEnd; + p4 = Disturbance.U_ref + 15; + + W(1:samples,2)=p1; + W((p2/DT)+1:((p2+p4)/DT)+1,2)= p1+0.5*15*(1-cos(pi*[((0)/DT)+1:((p4)/DT)+1]/(p4/DT))); + W(round((p2+p4)/DT)+1:end,2)= p3; + if p1<4 + theta_cg=180; + else + theta_cg=720/p1; + end + W(1:samples,3) = 0; + W((p2/DT)+1:((p2+p4)/DT)+1,3) = 0.5*theta_cg*(1-cos(pi*[((0)/DT)+1:((p4)/DT)+1]/(p4/DT))); + W(round((p2+p4)/DT)+1:end,3)= theta_cg; + + + case 'PeakTest' + startTime = 200; %start time of first gust + extraTime = 100; %time after test + periods = [60,45,30,20,10,5]; %sinusoid periods + + DT = 1/80; + T = periods(1); + tt = 0:DT:TMax; + gust = zeros(length(periods),length(tt)); + + startGust = [startTime,startTime + cumsum(periods(1:end-1))]; + + Amp = 6; %gust amplitude + startU = 9.3; %wind speed to start gust + + for iGust = 1:size(gust,1)-1 + T = periods(iGust); + gust(iGust,:) = (Amp/2 * (-cos(2*pi/T * (tt - startGust(iGust)))+1)).*(tt >= startGust(iGust) & tt <= startGust(iGust+1)); + end + + wind = sum(gust,1) + startU; + W(:,1) = tt; + W(:,2) = wind; + + if 1 + figure(100); + plot(tt,wind); + end + + case 'ConstRake' % p1=min, p2=t_start, p3=t_end, p4 = du + + tt = 0:DT:TMax; + b = p1 - p4/20 * p2; + m = p4 /20; + maxWS = 25; + tend = (maxWS-b)*(20/p4); + + W(:,2) = p1; + W(tt>p2,2) = m * tt(tt>p2) + b; + W(tt>tend,2) = maxWS; + + if 1 + figure(100); + plot(tt,W(:,2)); + end +end + + +%% Write Output +if ~isdir(fast.FAST_runDirectory) + mkdir(fast.FAST_runDirectory); +end + +windFileOut = fullfile(fast.FAST_runDirectory,[fast.FAST_namingOut,'.wnd']); +dlmwrite(windFileOut, W, 'delimiter','\t','precision','%.6f') +disp([TYPE,' Wind File Made: ',fast.FAST_namingOut,'.wnd']) + +if Mplot==1 + figure(800); + set(gcf,'Name','Wind Input') + plot(W(:,1),W(:,2)) + xlabel('Time [s]') + ylabel('HH Velocity [m/s]') + grid on +end \ No newline at end of file diff --git a/Matlab_Toolbox/Utilities/Af_MovingNotch.m b/Matlab_Toolbox/Utilities/Af_MovingNotch.m new file mode 100644 index 000000000..50ee65cc8 --- /dev/null +++ b/Matlab_Toolbox/Utilities/Af_MovingNotch.m @@ -0,0 +1,34 @@ +function [dNF_LPV,dNF_LPV_ss] = Af_MovingNotch(frequencyRange,zeta,beta,DT) +%% Example code +% Notch at 2P +% LPV filter with rotor speed as scheduling parameter + +% om_1P = 2*pi*RotorSpeedDomain/60; +% om_2P = 2*om_1P; +% +% zeta_2P = 0.8; +% beta_2P = zeta_2P/10; +% +% %populate range of 2P/4P filters +% dNF_2P_lpv = ss; +% for iom = 1:1:length(om_2P) +% NF_2P = tf([1,2*om_2P(iom)*beta_2P,(om_2P(iom))^2],[1,2*om_2P(iom)*zeta_2P,(om_2P(iom))^2]); +% dNF_2P_lpv(:,:,iom) = c2d(ss(NF_2P),Control.DT); +% end +% +% %sampling grid (scheduling parameter) +% dNF_2P_lpv.SamplingGrid = struct('Omega_2P',om_2P); + +%% +NF = tf; +dNF_LPV = tf; +dNF_LPV_ss = ss; + +for iFreq = 1:1:length(frequencyRange) + NF = tf([1,2*frequencyRange(iFreq)*beta,(frequencyRange(iFreq))^2],[1,2*frequencyRange(iFreq)*zeta,(frequencyRange(iFreq))^2]); + dNF_LPV(iFreq) = c2d((NF),DT); + dNF_LPV_ss(:,:,iFreq) = c2d(ss(NF),DT); +end + +%sampling grid (scheduling parameter) +dNF_LPV_ss.SamplingGrid = struct('Omega',frequencyRange); diff --git a/Matlab_Toolbox/Utilities/Af_sigma.m b/Matlab_Toolbox/Utilities/Af_sigma.m new file mode 100644 index 000000000..1016058fd --- /dev/null +++ b/Matlab_Toolbox/Utilities/Af_sigma.m @@ -0,0 +1,8 @@ +function a = Af_sigma(x0,x1); + +a3 = 2/(x0-x1)^3; +a2 = -3*(x0+x1)/(x0-x1)^3; +a1 = 6*x1*x0/(x0-x1)^3; +a0 = (x0-3*x1)*x0^2/(x0-x1)^3; + +a = [a3,a2,a1,a0]; \ No newline at end of file diff --git a/Matlab_Toolbox/Utilities/ParseROSCOInputLine.m b/Matlab_Toolbox/Utilities/ParseROSCOInputLine.m new file mode 100644 index 000000000..8f8db2746 --- /dev/null +++ b/Matlab_Toolbox/Utilities/ParseROSCOInputLine.m @@ -0,0 +1,128 @@ +function [value, label, isComment, descr, fieldType] = ParseROSCOInputLine( line ) +% This routine parses a line from a FAST type input file. +% Comment lines are assumed to start with any of the following individual characters: +% #!= +% or this combination of characters: +% -- +% If the line is not a comment, it is assumed to be of the form: +% value [,Array values] label descr +% If the value is an array, it must be separated by commas. +% If there are multiple values separated by white space, it is assumed to +% contain old values (instead of an array) +%-------------------------------------------------------------------------- +% Inputs: +% line - a line of text +% Outputs: +% value - the value of the parameter +% label - the name of the parameter/variable/field +% isComment - logical value that says if the line is a comment line +% descr - the description of the line +% fieldType - text saying the field is either a +% "Comment", "Logical", "Character", "Numeric" variable +%-------------------------------------------------------------------------- + + % first check that this isn't a blank line... + if isempty(line) || length(strtrim(line)) < 1 + value = ''; + label = ''; + isComment = true; + descr = ''; + fieldType = 'Comment'; + return + end + + trueFalseValues = {'true','false','t','f'}; + + % determine if this is a comment line: + first2Chars = sscanf(strtrim(line),'%c',2); %read the first two not-starting-with-whitespace characters + firstChar = first2Chars(1); + + if ~isempty( strfind( '#!=', firstChar ) ) || strcmp( first2Chars, '--' ) %comments start with any of these characters: # ! - = + value = strtrim(line); + label = ''; + isComment = true; + descr = value; + fieldType = 'Comment'; + else + isComment = false; + + % Get the Value, number or string + [value, cnt, ~, nextindex] = sscanf(line,'%f', 1); %First check if line begins with a number +% disp ([ '"' line(nextindex:end) '"']); + + if cnt == 0 || ... % we didn't find a number so... + ( nextindex < length(line) && ~isempty(strtrim(line(nextindex))) && ~strcmp(line(nextindex),',') ) % this would happen if a string started with a number and wasn't empty afterwards: e.g. "1P0.0" gets read as "1", but the next character is "P", not a space separating it from a label + [testVal, position] = textscan(line,'%q',1); %look for a string instead + if any( strcmpi(testVal{1}{1},trueFalseValues) ) + value = testVal{1}{1}; %this is a logical input + fieldType = 'Logical'; + else + if ~isempty(testVal{1}{1}) && strcmp(testVal{1}{1}(1),'@') + value = testVal{1}{1}; + else + value = ['"' testVal{1}{1} '"']; %add quotes back around the string + end + fieldType = 'Character'; + end + nextindex = position + 1; + else + fieldType = 'Numeric'; + end + + % Now get the label + + % Some looping is necessary because often times, + % old values for FAST parameters are kept next to new + % ones seperated by a space and need to be ignored + + + IsLabel = false; + label = ''; %initialize in case the line doesn't have a label + descr = ''; + + while ~IsLabel && length(line) >= nextindex + line = line(nextindex:end); + + [tmpVal, cnt, ~, nextindex] =sscanf(line,'%f',1); + if cnt == 0 || ~isfinite(tmpVal) %if we've reached something besides a number (or we read text as "Inf") - or we're at the end of the line + + [testVal, cnt, ~, nextindex] = sscanf(line,'%s',1); + if cnt == 1 + if any( strcmpi(testVal,trueFalseValues) ) + %this is a logical input + elseif strcmpi(testVal(1),',') + % commas are an indication that this parameter is a list + if strcmpi(fieldType, 'Numeric') + line = line(2:end); + [testVal, cnt, ~, nextindex] = sscanf(line,'%f',1); + if cnt == 1 + value = [value testVal]; + end + end + elseif strcmpi(testVal(1),'"') + [testVal, position] = textscan(line,'%q',1); %look for a string in quotes + nextindex = position + 1; + elseif strcmpi(testVal(1),'!') % is a comment in ROSCO, label is next + [tempStr,position] = textscan(line,'%s',2); + IsLabel = true; + label = tempStr{1}{2}; % hard code, sorry + descr = strtrim(line(position+1:end)); + else + IsLabel = true; + label = testVal; + descr = strtrim(line(nextindex:end)); + end + end + else + % this was a finite numeric value (not separated by commas), so we'll keep it + value = [value tmpVal]; + end + + end %while + + end %not a comment + + if strcmp(label,'-') + label = ''; + end +return \ No newline at end of file diff --git a/Matlab_Toolbox/Pl_FastPlots.m b/Matlab_Toolbox/Utilities/Pl_FastPlots.m similarity index 100% rename from Matlab_Toolbox/Pl_FastPlots.m rename to Matlab_Toolbox/Utilities/Pl_FastPlots.m diff --git a/Matlab_Toolbox/Utilities/Pre_LoadRotPerf.m b/Matlab_Toolbox/Utilities/Pre_LoadRotPerf.m new file mode 100644 index 000000000..bf9f017f6 --- /dev/null +++ b/Matlab_Toolbox/Utilities/Pre_LoadRotPerf.m @@ -0,0 +1,74 @@ +function RotPerf = Pre_LoadRotPerf(RotPerfFile) +% Load rotor performance information from a text file. +% Loads OpenFast model output into a MATLAB structure to be post processed +% +% Inputs: RotPerfFile - Cp_Ct_Cq.txt file from CCBlade/ROSCO +% Outputs: RotorPerformance - Structure containing rotor performance data +% +% Nikhar Abbas + + +fid = fopen(RotPerfFile, 'r'); +if fid == -1, error('Error loading file'), end + +% Read first line to start tline +tline = fgetl(fid); +while ~feof(fid) + tline = fgetl(fid); + l_str = strsplit(tline); + if tline + % Find pitch angle vector + if strcmpi(l_str{2},'Pitch') + tline = fgetl(fid); + BlPitch = str2num(tline); + % Find TSR vector + elseif strcmpi(l_str{2},'TSR') + tline = fgetl(fid); + TSR = str2num(tline); + % Find Wind speed vector + elseif strcmpi(l_str{2},'Wind') + tline = fgetl(fid); + Wind = str2num(tline); + + % Read Cp table + elseif strcmpi(l_str{2},'Power') + tline = fgetl(fid); + Cpmat = zeros(length(TSR),length(BlPitch)); + for pind = 1:length(TSR) + tline = fgetl(fid); + CpMat(pind,:) = str2num(tline); + end + + % Read Ct table + elseif strcmpi(l_str{2},'Thrust') + tline = fgetl(fid); + Ctmat = zeros(length(TSR),length(BlPitch)); + for pind = 1:length(TSR) + tline = fgetl(fid); + CtMat(pind,:) = str2num(tline); + end + + % Read Cq table + elseif strcmpi(l_str{2},'Torque') + tline = fgetl(fid); + Cqmat = zeros(length(TSR),length(BlPitch)); + for pind = 1:length(TSR) + tline = fgetl(fid); + CqMat(pind,:) = str2num(tline); + end + end + end +end + + + + +% Save Structure +RotPerf.BlPitch = BlPitch; +RotPerf.TSR = TSR; +RotPerf.Wind = Wind; +RotPerf.Cpmat = CpMat; +RotPerf.Ctmat = CtMat; +RotPerf.Cqmat = CqMat; + +end \ No newline at end of file diff --git a/Matlab_Toolbox/Utilities/ROSCO2Matlab.m b/Matlab_Toolbox/Utilities/ROSCO2Matlab.m new file mode 100644 index 000000000..906048d5f --- /dev/null +++ b/Matlab_Toolbox/Utilities/ROSCO2Matlab.m @@ -0,0 +1,414 @@ +function DataOut = ROSCO2Matlab(FST_file,hdrLines,DataOut) +%% Fast2Matlab +% DataOut = Fast2Matlab(FST_file,hdrLines,DataOut) +% Function for reading FAST input files in to a MATLAB struct. +% +% +%This function returns a structure DataOut, which contains the following +% cell arrays: +%.Val An array of values +%.Label An array of matching labels +%.HdrLines An array of the header lines (size specified at input) +% +% The following cell arrays may or may not be part of the DataOut structure +% (depending on the type of file being read): +%.OutList An array of variables to output +%.OutListComments An array of descriptions of the .OutList values +% +%.TowProp A matrix of tower properties with columns .TowPropHdr +%.TowPropHdr A cell array of headers corresponding to the TowProp table +% +%.BldProp A matrix of blade properties with columns .BldPropHdr +%.BldPropHdr A cell array of headers corresponding to the BldProp table +% +%.DLLProp A matrix of properties for the Bladed DLL Interface with columns .DLLPropHdr +%.DLLPropHdr A cell array of headers corresponding to the DLLProp table +% +%.FoilNm A Cell array of foil names +% +%.BldNodesHdr A cell array of headers corresponding to the BldNodes table +%.BldNodes A matrix of blade nodes with columns RNodes, AeroTwst DRNodes Chord and Nfoil +% +%.CasesHdr A cell array of headers corresponding to the Cases table +%.Cases A matrix of properties for individual cases in a driver file +% +%.AFCoeffHdr A cell array of headers corresponding to the AFCoeff table +%.AFCoeff A matrix of airfoil coefficients +% +%.TMDspProp A matrix of TMD spring forces +%.TMDspPropHdr A cell array of headers corresponding to the TMDspProp table +% +% .PointLoads A table of point loads in the BeamDyn driver input file +% .PointLoadsHdr A the headers for the point loads table +% +%.PrnElm An array determining whether or not to print a given element +% +%.kp A table of key points defined in BeamDyn +%.kpHdr A cell array of headers corresponding to the kp table +% +%.profile A table of profile values defined in TurbSim +%-------------------------------------------------------------------------- + +%These arrays are extracted from the FAST input file +% +% In: FST_file - Name of FAST input file +% hdrLines - Number of lines to skip at the top (optional) +% +% Knud A. Kragh, May 2011, NREL, Boulder +% +% Modified by Paul Fleming, JUNE 2011 +% Modified by Bonnie Jonkman, February 2013 (to allow us to read the +% platform file, too) +%% +if nargin < 2 + hdrLines = 0; +end + +%----------------------Read FST main file---------------------------------- +fid = fopen(FST_file,'r'); + +if fid == -1 + error(['FST file, ' FST_file ', could not be opened for reading. Check if the file exists or is locked.']) +end + +%skip hdr +for hi = 1:hdrLines + if nargin == 3 + fgetl(fid); + else + DataOut.HdrLines{hi,1} = fgetl(fid); %bjj: added field for storing header lines + end +end + +%PF: Commenting this out, not sure it's necessary +%DataOut.Sections=0; + +%Loop through the file line by line, looking for value-label pairs +%Stop once we've reached the OutList which this function is the last +%occuring thing before the EOF +if nargin == 3 + + count = max(length(DataOut.Label),length(DataOut.Val))+1; +else + count = 1; +end +NextIsMatrix = 0; +matrixVal = []; + +while true %loop until discovering Outlist or end of file, than break + + line = fgetl(fid); + if isnumeric(line) % we reached the end of the file\ + break + end + + % Check to see if the value is Outlist + + %if ~isempty(strfind(upper(line),upper('OutList'))) + if ~isempty(strfind( upper(line), upper('OutList') )) + % 6/23/2016: linearization inputs contain "OutList" in the + % comments, so we need to make sure this is either the first (value) or + % second (label) word of the line. + [value, ~, ~, nextindex] = sscanf(line,'%s', 1); + if strcmpi(value,'OutList') + [DataOut.OutList DataOut.OutListComments] = ParseFASTOutList(fid); + break; %bjj: we could continue now if we wanted to assume OutList wasn't the end of the file... + else + % try the second + [value] = sscanf(line(nextindex+1:end),'%s', 1); + if strcmpi(value,'OutList') + [DataOut.OutList DataOut.OutListComments] = ParseFASTOutList(fid); + break; %bjj: we could continue now if we wanted to assume OutList wasn't the end of the file... + end + end + end + + + [value, label, isComment, descr, fieldType] = ParseROSCOInputLine( line ); + + + if ~isComment + + if strcmpi(value,'"HtFract"') %we've reached the distributed tower properties table (and we think it's a string value so it's in quotes) + NTwInpSt = GetFASTPar(DataOut,'NTwInpSt'); + [DataOut.TowProp, DataOut.TowPropHdr] = ParseFASTNumTable(line, fid, NTwInpSt); + continue; %let's continue reading the file + elseif strcmpi(value,'"TwrElev"') %we've reached the distributed tower properties table (and we think it's a string value so it's in quotes) + NumTwrNds = GetFASTPar(DataOut,'NumTwrNds'); + [DataOut.TowProp, DataOut.TowPropHdr] = ParseFASTNumTable(line, fid, NumTwrNds); + continue; %let's continue reading the file + elseif strcmpi(value,'"BlFract"') %we've reached the distributed blade properties table (and we think it's a string value so it's in quotes) + NBlInpSt = GetFASTPar(DataOut,'NBlInpSt'); + [DataOut.BldProp, DataOut.BldPropHdr] = ParseFASTNumTable(line, fid, NBlInpSt); + continue; %let's continue reading the file + elseif strcmpi(label,'F_X') %we've reached the TMD spring forces table + NKInpSt = GetFASTPar(DataOut,'NKInpSt'); + [DataOut.TMDspProp, DataOut.TMDspPropHdr] = ParseFASTNumTable(line, fid, NKInpSt); + continue; %let's continue reading the file + elseif strcmpi(value,'"GenSpd_TLU"') %we've reached the DLL torque-speed lookup table (and we think it's a string value so it's in quotes) + DLL_NumTrq = GetFASTPar(DataOut,'DLL_NumTrq'); + [DataOut.DLLProp, DataOut.DLLPropHdr] = ParseFASTNumTable(line, fid, DLL_NumTrq); + continue; %let's continue reading the file + elseif strcmpi(label,'FoilNm') %note NO quotes because it's a label + NumFoil = GetFASTPar(DataOut,'NumFoil'); + [DataOut.FoilNm] = ParseFASTFileList( line, fid, NumFoil ); + continue; %let's continue reading the file + elseif strcmpi(label,'AFNames') %note NO quotes because it's a label + NumFoil = GetFASTPar(DataOut,'NumAFfiles'); + [DataOut.FoilNm] = ParseFASTFileList( line, fid, NumFoil ); + continue; %let's continue reading the file + elseif strcmpi(value,'"RNodes"') + BldNodes = GetFASTPar(DataOut,'BldNodes'); + [DataOut.BldNodes, DataOut.BldNodesHdr] = ParseFASTFmtTable( line, fid, BldNodes, false ); + continue; + elseif strcmpi(value,'"BlSpn"') + NumBlNds = GetFASTPar(DataOut,'NumBlNds'); + [DataOut.BldNodes, DataOut.BldNodesHdr] = ParseFASTNumTable( line, fid, NumBlNds ); + continue; + elseif strcmpi(value,'"WndSpeed"') %we've reached the cases table (and we think it's a string value so it's in quotes) + NumCases = GetFASTPar(DataOut,'NumCases'); + [DataOut.Cases, DataOut.CasesHdr] = ParseFASTNumTable(line, fid, NumCases); + continue; %let's continue reading the file + elseif strcmpi(label,'NumPointLoads') + DataOut.Label{count,1} = label; + DataOut.Val{count,1} = value; + count = count + 1; + + NumPointLoads = value; + line = fgetl(fid); % the next line is the header, and it may have comments + [DataOut.PointLoads, DataOut.PointLoadsHdr] = ParseFASTNumTable(line, fid, NumPointLoads); + continue; %let's continue reading the file + + elseif strcmpi(label,'NumAlf') + DataOut.Label{count,1} = label; + DataOut.Val{count,1} = value; + count = count + 1; + + NumAlf = value; + line = fgetl(fid); % the next line is the header, and it may have comments + line = line(2:end); + [DataOut.AFCoeff, DataOut.AFCoeffHdr] = ParseFASTNumTable(line, fid, NumAlf); + continue; %let's continue reading the file + elseif strcmpi(label,'kp_yr') %we've reached the BD key-points table + kp_total = GetFASTPar(DataOut,'kp_total'); + [DataOut.kp, DataOut.kpHdr] = ParseFASTNumTable(line, fid, kp_total); + continue; %let's continue reading the file + elseif strcmpi(label,'StdScale3') %we've reached the TurbSim profiles table + DataOut.Label{count,1} = label; + DataOut.Val{count,1} = value; + count = count + 1; + + NumUSRz = GetFASTPar(DataOut,'NumUSRz'); + line = fgetl(fid); % the next line is the header, and it may have comments + [DataOut.profile] = ParseFASTNumTable(line, fid, NumUSRz, 2 ); + continue; %let's continue reading the file + else + + if NextIsMatrix > 0 + matrixVal = vertcat( matrixVal, value ); + NextIsMatrix = NextIsMatrix - 1; + label = nextLabel; + value = matrixVal; + end + + if NextIsMatrix == 0 + DataOut.Label{count,1} = label; + DataOut.Val{count,1} = value; + count = count + 1; + matrixVal = []; + end + + if strcmpi(label,'GlbPos(3)') % the next one is a DCM from the BD driver file: + NextIsMatrix = 3; % three rows of a matrix (DCM) + nextLabel = 'DCM'; + elseif strcmpi(label,'kp_total') % the next one is a DCM from the BD driver file: + NextIsMatrix = GetFASTPar(DataOut,'member_total'); + nextLabel = 'MemberKeyPtTable'; + end + end + end + +end %end while + +fclose(fid); %close file + +return +end %end function +%% +function [OutList OutListComments] = ParseFASTOutList( fid ) + + %Now loop and read in the OutList + + outCount = 0; + while true + line = fgetl(fid); + if isempty(line) %Fortran allows blank lines in this list + continue; + end + [outVarC, position] = textscan(line,'%q',1); %we need to get the entire quoted line + outVar = outVarC{1}{1}; % this will not have quotes around it anymore... + + if isnumeric(line) %loop until we reach the word END or hit the end of the file + break; + else + indx = strfind(upper(outVar),'END'); + if (~isempty(indx) && indx == 1) %we found "END" so that's the end of the file + break; + else + outCount = outCount + 1; + OutList{outCount,1} = ['"' outVar '"']; + if position < length(line) + OutListComments{outCount,1} = line((position+1):end); + else + OutListComments{outCount,1} = ' '; + end + end + end + end %end while + + if outCount == 0 + disp( 'WARNING: no outputs found in OutList' ); + OutList = []; + OutListComments = ''; + end + +end %end function +%% +function [Table, Headers] = ParseFASTNumTable( line, fid, InpSt, NumUnitsLines ) + + % read a numeric table from the FAST file + + if strncmp(line,'--------------------------------------------', 20) + % this assumes we are using TurbSim profiles file + Headers = fgetl(fid); + nc = 5; + else + + % we've read the line of the table that includes the header + % let's parse it now, getting the number of columns as well: + if contains(line,',') + % these will be assumed to be comma delimited: + TmpHdr = textscan(line,'%s', 'Delimiter',','); + else + TmpHdr = textscan(line,'%s'); + end + + Headers = TmpHdr{1}; + if strcmp( Headers{1}, '!' ) + Headers = Headers(2:end); + end + nc = length(Headers); + end + + if nargin < 4 + NumUnitsLines = 1; + end + + for i=1:NumUnitsLines + % read the units line: + fgetl(fid); + end + + % now initialize Table and read its values from the file: + Table = zeros(InpSt, nc); %this is the size table we'll read + i = 0; % this the line of the table we're reading + while i < InpSt + + line = fgetl(fid); + if isnumeric(line) % we reached the end prematurely + break + elseif i == 0 + [~,cnt]=sscanf(line,'%f',nc); + if cnt==0 + break + % stop reading and return because the line was not numeric + elseif cnt.ech (flag) 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 --------------------------------------------- -"NRELOffshrBsline5MW_Onshore_ElastoDyn.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) -"NRELOffshrBsline5MW_Onshore_AeroDyn15.dat" AeroFile - Name of file containing aerodynamic input parameters (quoted string) +"../NREL-5MW/NRELOffshrBsline5MW_Onshore_ElastoDyn.dat" EDFile - Name of file containing ElastoDyn input parameters (quoted string) +"unused" BDBldFile(1) - Name of file containing BeamDyn input parameters for blade 1 (quoted string) +"unused" BDBldFile(2) - Name of file containing BeamDyn input parameters for blade 2 (quoted string) +"unused" BDBldFile(3) - Name of file containing BeamDyn input parameters for blade 3 (quoted string) +"../NREL-5MW/NRELOffshrBsline5MW_InflowWind.dat" InflowFile - Name of file containing inflow wind input parameters (quoted string) +"../NREL-5MW/NRELOffshrBsline5MW_Onshore_AeroDyn15.dat" AeroFile - Name of file containing aerodynamic input parameters (quoted string) "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) @@ -41,6 +41,12 @@ True TabDelim - Use tab delimiters in text tabular output file? "ES10.3E2" OutFmt - Format used for text tabular output, excluding the time channel. Resulting field should be 10 characters. (quoted string) ---------------------- LINEARIZATION ------------------------------------------- False Linearize - Linearization analysis (flag) +False CalcSteady - Calculate a steady-state periodic operating point before linearization? [unused if Linearize=False] (flag) + 3 TrimCase - Controller parameter to be trimmed {1:yaw; 2:torque; 3:pitch} [used only if CalcSteady=True] (-) + 0.001 TrimTol - Tolerance for the rotational speed convergence [used only if CalcSteady=True] (-) + 0.01 TrimGain - Proportional gain for the rotational speed error (>0) [used only if CalcSteady=True] (rad/(rad/s) for yaw or pitch; Nm/(rad/s) for torque) + 0 Twr_Kdmp - Damping factor for the tower [used only if CalcSteady=True] (N/(m/s)) + 0 Bld_Kdmp - Damping factor for the blades [used only if CalcSteady=True] (N/(m/s)) 2 NLinTimes - Number of times to linearize (-) [>=1] [unused if Linearize=False] 30, 60 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] diff --git a/Test_Cases/5MW_Land_Simulink/DISCON.IN b/Test_Cases/5MW_Land_Simulink/DISCON.IN index 1e5cf3de5..a68b2329e 100644 --- a/Test_Cases/5MW_Land_Simulink/DISCON.IN +++ b/Test_Cases/5MW_Land_Simulink/DISCON.IN @@ -76,7 +76,7 @@ 97.0 ! WE_GearboxRatio - Gearbox ratio [>=1], [-] 43702538.05700 ! WE_Jtot - Total drivetrain inertia, including blades, hub and casted generator inertia to LSS, [kg m^2] 1.225 ! WE_RhoAir - Air density, [kg m^-3] -"../5MW_Baseline/Cp_Ct_Cq.NREL5MW.txt" ! PerfFileName - File containing rotor performance tables (Cp,Ct,Cq) +"../NREL-5MW/Cp_Ct_Cq.NREL5MW.txt" ! PerfFileName - File containing rotor performance tables (Cp,Ct,Cq) 104 48 ! PerfTableSize - Size of rotor performance tables, first number refers to number of blade pitch angles, second number referse to number of tip-speed ratios 44 ! WE_FOPoles_N - Number of first-order system poles used in EKF 3.00 3.50 4.00 4.50 5.00 5.50 6.00 6.50 7.00 7.50 8.00 8.50 9.00 9.50 10.00 10.50 11.00 11.90 12.40 12.90 13.40 13.90 14.40 14.90 15.40 15.90 16.40 16.90 17.40 17.90 18.40 18.90 19.40 19.90 20.40 20.90 21.40 21.90 22.40 22.90 23.40 23.90 24.40 24.90 ! WE_FOPoles_v - Wind speeds corresponding to first-order system poles [m/s] diff --git a/Test_Cases/5MW_Land_Simulink/NRELOffshrBsline5MW_Onshore_AeroDyn15.dat b/Test_Cases/5MW_Land_Simulink/NRELOffshrBsline5MW_Onshore_AeroDyn15.dat deleted file mode 100644 index 4b46b1f68..000000000 --- a/Test_Cases/5MW_Land_Simulink/NRELOffshrBsline5MW_Onshore_AeroDyn15.dat +++ /dev/null @@ -1,82 +0,0 @@ -------- AERODYN v15 for OpenFAST INPUT FILE ----------------------------------------------- -NREL 5.0 MW offshore baseline aerodynamic input properties. -====== General Options ============================================================================ -False Echo - Echo the input to ".AD.ech"? (flag) -"default" DTAero - Time interval for aerodynamic calculations {or "default"} (s) - 1 WakeMod - Type of wake/induction model (switch) {0=none, 1=BEMT, 2=DBEMT} [WakeMod cannot be 2 when linearizing] - 2 AFAeroMod - Type of blade airfoil aerodynamics model (switch) {1=steady model, 2=Beddoes-Leishman unsteady model} [AFAeroMod must be 1 when linearizing] - 1 TwrPotent - Type tower influence on wind based on potential flow around the tower (switch) {0=none, 1=baseline potential flow, 2=potential flow with Bak correction} -False TwrShadow - Calculate tower influence on wind based on downstream tower shadow? (flag) -True TwrAero - Calculate tower aerodynamic loads? (flag) -False FrozenWake - Assume frozen wake during linearization? (flag) [used only when WakeMod=1 and when linearizing] -False CavitCheck - Perform cavitation check? (flag) [AFAeroMod must be 1 when CavitCheck=true] -====== Environmental Conditions =================================================================== - 1.225 AirDens - Air density (kg/m^3) - 1.464E-05 KinVisc - Kinematic air viscosity (m^2/s) - 335 SpdSound - Speed of sound (m/s) - 103500 Patm - Atmospheric pressure (Pa) [used only when CavitCheck=True] - 1700 Pvap - Vapour pressure of fluid (Pa) [used only when CavitCheck=True] - 0.5 FluidDepth - Water depth above mid-hub height (m) [used only when CavitCheck=True] -====== Blade-Element/Momentum Theory Options ====================================================== [unused when WakeMod=0] - 2 SkewMod - Type of skewed-wake correction model (switch) {1=uncoupled, 2=Pitt/Peters, 3=coupled} [unused when WakeMod=0] -"default" SkewModFactor - Constant used in Pitt/Peters skewed wake model {or "default" is 15/32*pi} (-) [used only when SkewMod=2; unused when WakeMod=0] -True TipLoss - Use the Prandtl tip-loss model? (flag) [unused when WakeMod=0] -True HubLoss - Use the Prandtl hub-loss model? (flag) [unused when WakeMod=0] -true TanInd - Include tangential induction in BEMT calculations? (flag) [unused when WakeMod=0] -False AIDrag - Include the drag term in the axial-induction calculation? (flag) [unused when WakeMod=0] -False TIDrag - Include the drag term in the tangential-induction calculation? (flag) [unused when WakeMod=0 or TanInd=FALSE] -"Default" IndToler - Convergence tolerance for BEMT nonlinear solve residual equation {or "default"} (-) [unused when WakeMod=0] - 100 MaxIter - Maximum number of iteration steps (-) [unused when WakeMod=0] -====== Dynamic Blade-Element/Momentum Theory Options ============================================== [used only when WakeMod=2] - 2 DBEMT_Mod - Type of dynamic BEMT (DBEMT) model {1=constant tau1, 2=time-dependent tau1} (-) [used only when WakeMod=2] - 4 tau1_const - Time constant for DBEMT (s) [used only when WakeMod=2 and DBEMT_Mod=1] -====== Beddoes-Leishman Unsteady Airfoil Aerodynamics Options ===================================== [used only when AFAeroMod=2] - 3 UAMod - Unsteady Aero Model Switch (switch) {1=Baseline model (Original), 2=Gonzalez's variant (changes in Cn,Cc,Cm), 3=Minemma/Pierce variant (changes in Cc and Cm)} [used only when AFAeroMod=2] -True FLookup - Flag to indicate whether a lookup for f' will be calculated (TRUE) or whether best-fit exponential equations will be used (FALSE); if FALSE S1-S4 must be provided in airfoil input files (flag) [used only when AFAeroMod=2] -====== Airfoil Information ========================================================================= - 1 AFTabMod - Interpolation method for multiple airfoil tables {1=1D interpolation on AoA (first table only); 2=2D interpolation on AoA and Re; 3=2D interpolation on AoA and UserProp} (-) - 1 InCol_Alfa - The column in the airfoil tables that contains the angle of attack (-) - 2 InCol_Cl - The column in the airfoil tables that contains the lift coefficient (-) - 3 InCol_Cd - The column in the airfoil tables that contains the drag coefficient (-) - 4 InCol_Cm - The column in the airfoil tables that contains the pitching-moment coefficient; use zero if there is no Cm column (-) - 0 InCol_Cpmin - The column in the airfoil tables that contains the Cpmin coefficient; use zero if there is no Cpmin column (-) - 8 NumAFfiles - Number of airfoil files used (-) -"../5MW_Baseline/Airfoils/Cylinder1.dat" AFNames - Airfoil file names (NumAFfiles lines) (quoted strings) -"../5MW_Baseline/Airfoils/Cylinder2.dat" -"../5MW_Baseline/Airfoils/DU40_A17.dat" -"../5MW_Baseline/Airfoils/DU35_A17.dat" -"../5MW_Baseline/Airfoils/DU30_A17.dat" -"../5MW_Baseline/Airfoils/DU25_A17.dat" -"../5MW_Baseline/Airfoils/DU21_A17.dat" -"../5MW_Baseline/Airfoils/NACA64_A17.dat" -====== Rotor/Blade Properties ===================================================================== -True UseBlCm - Include aerodynamic pitching moment in calculations? (flag) -"../5MW_Baseline/NRELOffshrBsline5MW_AeroDyn_blade.dat" ADBlFile(1) - Name of file containing distributed aerodynamic properties for Blade #1 (-) -"../5MW_Baseline/NRELOffshrBsline5MW_AeroDyn_blade.dat" ADBlFile(2) - Name of file containing distributed aerodynamic properties for Blade #2 (-) [unused if NumBl < 2] -"../5MW_Baseline/NRELOffshrBsline5MW_AeroDyn_blade.dat" ADBlFile(3) - Name of file containing distributed aerodynamic properties for Blade #3 (-) [unused if NumBl < 3] -====== Tower Influence and Aerodynamics ============================================================= [used only when TwrPotent/=0, TwrShadow=True, or TwrAero=True] - 12 NumTwrNds - Number of tower nodes used in the analysis (-) [used only when TwrPotent/=0, TwrShadow=True, or TwrAero=True] -TwrElev TwrDiam TwrCd -(m) (m) (-) -0.0000000E+00 6.0000000E+00 1.0000000E+00 -8.5261000E+00 5.7870000E+00 1.0000000E+00 -1.7053000E+01 5.5740000E+00 1.0000000E+00 -2.5579000E+01 5.3610000E+00 1.0000000E+00 -3.4105000E+01 5.1480000E+00 1.0000000E+00 -4.2633000E+01 4.9350000E+00 1.0000000E+00 -5.1158000E+01 4.7220000E+00 1.0000000E+00 -5.9685000E+01 4.5090000E+00 1.0000000E+00 -6.8211000E+01 4.2960000E+00 1.0000000E+00 -7.6738000E+01 4.0830000E+00 1.0000000E+00 -8.5268000E+01 3.8700000E+00 1.0000000E+00 -8.7600000E+01 3.8700000E+00 1.0000000E+00 -====== Outputs ==================================================================================== -True SumPrint - Generate a summary file listing input options and interpolated properties to ".AD.sum"? (flag) - 0 NBlOuts - Number of blade node outputs [0 - 9] (-) - 1, 9, 19 BlOutNd - Blade nodes whose values will be output (-) - 0 NTwOuts - Number of tower node outputs [0 - 9] (-) - 1, 2, 6 TwOutNd - Tower nodes whose values will be output (-) - OutList - The next line(s) contains a list of output parameters. See OutListParameters.xlsx for a listing of available output channels, (-) -"RtVAvgxh" -END of input file (the word "END" must appear in the first 3 columns of this last OutList line) ---------------------------------------------------------------------------------------- diff --git a/Test_Cases/5MW_Land_Simulink/NRELOffshrBsline5MW_Onshore_ElastoDyn.dat b/Test_Cases/5MW_Land_Simulink/NRELOffshrBsline5MW_Onshore_ElastoDyn.dat deleted file mode 100644 index f4f02b66e..000000000 --- a/Test_Cases/5MW_Land_Simulink/NRELOffshrBsline5MW_Onshore_ElastoDyn.dat +++ /dev/null @@ -1,159 +0,0 @@ -------- ELASTODYN v1.03.* 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) - 3 Method - Integration method: {1: RK4, 2: AB4, or 3: ABM4} (-) -"DEFAULT" DT - Integration time step (s) ----------------------- ENVIRONMENTAL CONDITION --------------------------------- - 9.80665 Gravity - Gravitational acceleration (m/s^2) ----------------------- DEGREES OF FREEDOM -------------------------------------- -True FlapDOF1 - First flapwise blade mode DOF (flag) -True FlapDOF2 - Second flapwise blade mode DOF (flag) -True EdgeDOF - First edgewise blade mode DOF (flag) -False TeetDOF - Rotor-teeter DOF (flag) [unused for 3 blades] -True DrTrDOF - Drivetrain rotational-flexibility DOF (flag) -True GenDOF - Generator DOF (flag) -True YawDOF - Yaw DOF (flag) -True TwFADOF1 - First fore-aft tower bending-mode DOF (flag) -True TwFADOF2 - Second fore-aft tower bending-mode DOF (flag) -True TwSSDOF1 - First side-to-side tower bending-mode DOF (flag) -True TwSSDOF2 - Second side-to-side tower bending-mode DOF (flag) -False PtfmSgDOF - Platform horizontal surge translation DOF (flag) -False PtfmSwDOF - Platform horizontal sway translation DOF (flag) -False PtfmHvDOF - Platform vertical heave translation DOF (flag) -False PtfmRDOF - Platform roll tilt rotation DOF (flag) -False PtfmPDOF - Platform pitch tilt rotation DOF (flag) -False PtfmYDOF - Platform yaw rotation DOF (flag) ----------------------- INITIAL CONDITIONS -------------------------------------- - 0 OoPDefl - Initial out-of-plane blade-tip displacement (meters) - 0 IPDefl - Initial in-plane blade-tip deflection (meters) - 10 BlPitch(1) - Blade 1 initial pitch (degrees) - 10 BlPitch(2) - Blade 2 initial pitch (degrees) - 10 BlPitch(3) - Blade 3 initial pitch (degrees) [unused for 2 blades] - 0 TeetDefl - Initial or fixed teeter angle (degrees) [unused for 3 blades] - 0 Azimuth - Initial azimuth angle for blade 1 (degrees) - 12.1 RotSpeed - Initial or fixed rotor speed (rpm) - 0 NacYaw - Initial or fixed nacelle-yaw angle (degrees) - 0 TTDspFA - Initial fore-aft tower-top displacement (meters) - 0 TTDspSS - Initial side-to-side tower-top displacement (meters) - 0 PtfmSurge - Initial or fixed horizontal surge translational displacement of platform (meters) - 0 PtfmSway - Initial or fixed horizontal sway translational displacement of platform (meters) - 0 PtfmHeave - Initial or fixed vertical heave translational displacement of platform (meters) - 0 PtfmRoll - Initial or fixed roll tilt rotational displacement of platform (degrees) - 0 PtfmPitch - Initial or fixed pitch tilt rotational displacement of platform (degrees) - 0 PtfmYaw - Initial or fixed yaw rotational displacement of platform (degrees) ----------------------- TURBINE CONFIGURATION ----------------------------------- - 3 NumBl - Number of blades (-) - 63 TipRad - The distance from the rotor apex to the blade tip (meters) - 1.5 HubRad - The distance from the rotor apex to the blade root (meters) - -2.5 PreCone(1) - Blade 1 cone angle (degrees) - -2.5 PreCone(2) - Blade 2 cone angle (degrees) - -2.5 PreCone(3) - Blade 3 cone angle (degrees) [unused for 2 blades] - 0 HubCM - Distance from rotor apex to hub mass [positive downwind] (meters) - 0 UndSling - Undersling length [distance from teeter pin to the rotor apex] (meters) [unused for 3 blades] - 0 Delta3 - Delta-3 angle for teetering rotors (degrees) [unused for 3 blades] - 0 AzimB1Up - Azimuth value to use for I/O when blade 1 points up (degrees) - -5.0191 OverHang - Distance from yaw axis to rotor apex [3 blades] or teeter pin [2 blades] (meters) - 1.912 ShftGagL - Distance from rotor apex [3 blades] or teeter pin [2 blades] to shaft strain gages [positive for upwind rotors] (meters) - -5 ShftTilt - Rotor shaft tilt angle (degrees) - 1.9 NacCMxn - Downwind distance from the tower-top to the nacelle CM (meters) - 0 NacCMyn - Lateral distance from the tower-top to the nacelle CM (meters) - 1.75 NacCMzn - Vertical distance from the tower-top to the nacelle CM (meters) - -3.09528 NcIMUxn - Downwind distance from the tower-top to the nacelle IMU (meters) - 0 NcIMUyn - Lateral distance from the tower-top to the nacelle IMU (meters) - 2.23336 NcIMUzn - Vertical distance from the tower-top to the nacelle IMU (meters) - 1.96256 Twr2Shft - Vertical distance from the tower-top to the rotor shaft (meters) - 87.6 TowerHt - Height of tower above ground level [onshore] or MSL [offshore] (meters) - 0 TowerBsHt - Height of tower base above ground level [onshore] or MSL [offshore] (meters) - 0 PtfmCMxt - Downwind distance from the ground level [onshore] or MSL [offshore] to the platform CM (meters) - 0 PtfmCMyt - Lateral distance from the ground level [onshore] or MSL [offshore] to the platform CM (meters) - 0 PtfmCMzt - Vertical distance from the ground level [onshore] or MSL [offshore] to the platform CM (meters) - 0 PtfmRefzt - Vertical distance from the ground level [onshore] or MSL [offshore] to the platform reference point (meters) ----------------------- MASS AND INERTIA ---------------------------------------- - 0 TipMass(1) - Tip-brake mass, blade 1 (kg) - 0 TipMass(2) - Tip-brake mass, blade 2 (kg) - 0 TipMass(3) - Tip-brake mass, blade 3 (kg) [unused for 2 blades] - 56780 HubMass - Hub mass (kg) - 115926 HubIner - Hub inertia about rotor axis [3 blades] or teeter axis [2 blades] (kg m^2) - 534.116 GenIner - Generator inertia about HSS (kg m^2) - 240000 NacMass - Nacelle mass (kg) -2.60789E+06 NacYIner - Nacelle inertia about yaw axis (kg m^2) - 0 YawBrMass - Yaw bearing mass (kg) - 0 PtfmMass - Platform mass (kg) - 0 PtfmRIner - Platform inertia for roll tilt rotation about the platform CM (kg m^2) - 0 PtfmPIner - Platform inertia for pitch tilt rotation about the platform CM (kg m^2) - 0 PtfmYIner - Platform inertia for yaw rotation about the platform CM (kg m^2) ----------------------- BLADE --------------------------------------------------- - 17 BldNodes - Number of blade nodes (per blade) used for analysis (-) -"../5MW_Baseline/NRELOffshrBsline5MW_Blade.dat" BldFile(1) - Name of file containing properties for blade 1 (quoted string) -"../5MW_Baseline/NRELOffshrBsline5MW_Blade.dat" BldFile(2) - Name of file containing properties for blade 2 (quoted string) -"../5MW_Baseline/NRELOffshrBsline5MW_Blade.dat" BldFile(3) - Name of file containing properties for blade 3 (quoted string) [unused for 2 blades] ----------------------- ROTOR-TEETER -------------------------------------------- - 0 TeetMod - Rotor-teeter spring/damper model {0: none, 1: standard, 2: user-defined from routine UserTeet} (switch) [unused for 3 blades] - 0 TeetDmpP - Rotor-teeter damper position (degrees) [used only for 2 blades and when TeetMod=1] - 0 TeetDmp - Rotor-teeter damping constant (N-m/(rad/s)) [used only for 2 blades and when TeetMod=1] - 0 TeetCDmp - Rotor-teeter rate-independent Coulomb-damping moment (N-m) [used only for 2 blades and when TeetMod=1] - 0 TeetSStP - Rotor-teeter soft-stop position (degrees) [used only for 2 blades and when TeetMod=1] - 0 TeetHStP - Rotor-teeter hard-stop position (degrees) [used only for 2 blades and when TeetMod=1] - 0 TeetSSSp - Rotor-teeter soft-stop linear-spring constant (N-m/rad) [used only for 2 blades and when TeetMod=1] - 0 TeetHSSp - Rotor-teeter hard-stop linear-spring constant (N-m/rad) [used only for 2 blades and when TeetMod=1] ----------------------- DRIVETRAIN ---------------------------------------------- - 100 GBoxEff - Gearbox efficiency (%) - 97 GBRatio - Gearbox ratio (-) -8.67637E+08 DTTorSpr - Drivetrain torsional spring (N-m/rad) - 6.215E+06 DTTorDmp - Drivetrain torsional damper (N-m/(rad/s)) ----------------------- FURLING ------------------------------------------------- -False Furling - Read in additional model properties for furling turbine (flag) [must currently be FALSE) -"unused" FurlFile - Name of file containing furling properties (quoted string) [unused when Furling=False] ----------------------- TOWER --------------------------------------------------- - 20 TwrNodes - Number of tower nodes used for analysis (-) -"NRELOffshrBsline5MW_Onshore_ElastoDyn_Tower.dat" TwrFile - Name of file containing tower properties (quoted string) ----------------------- OUTPUT -------------------------------------------------- -True SumPrint - Print summary data to ".sum" (flag) - 1 OutFile - Switch to determine where output will be placed: {1: in module output file only; 2: in glue code output file only; 3: both} (currently unused) -True TabDelim - Use tab delimiters in text tabular output file? (flag) (currently unused) -"ES10.3E2" OutFmt - Format used for text tabular output (except time). Resulting field should be 10 characters. (quoted string) (currently unused) - 0 TStart - Time to begin tabular output (s) (currently unused) - 1 DecFact - Decimation factor for tabular output {1: output every time step} (-) (currently unused) - 0 NTwGages - Number of tower nodes that have strain gages for output [0 to 9] (-) - 10, 19, 28 TwrGagNd - List of tower nodes that have strain gages [1 to TwrNodes] (-) [unused if NTwGages=0] - 3 NBlGages - Number of blade nodes that have strain gages for output [0 to 9] (-) - 5, 9, 13 BldGagNd - List of blade nodes that have strain gages [1 to BldNodes] (-) [unused if NBlGages=0] - OutList - The next line(s) contains a list of output parameters. See OutListParameters.xlsx for a listing of available output channels, (-) -"OoPDefl1" - Blade 1 out-of-plane and in-plane deflections and tip twist -"IPDefl1" - Blade 1 out-of-plane and in-plane deflections and tip twist -"TwstDefl1" - Blade 1 out-of-plane and in-plane deflections and tip twist -"BldPitch1" - Blade 1 pitch angle -"Azimuth" - Blade 1 azimuth angle -"RotSpeed" - Low-speed shaft and high-speed shaft speeds -"GenSpeed" - Low-speed shaft and high-speed shaft speeds -"TTDspFA" - Tower fore-aft and side-to-side displacements and top twist -"TTDspSS" - Tower fore-aft and side-to-side displacements and top twist -"TTDspTwst" - Tower fore-aft and side-to-side displacements and top twist -"Spn2MLxb1" - Blade 1 local edgewise and flapwise bending moments at span station 2 (approx. 50% span) -"Spn2MLyb1" - Blade 1 local edgewise and flapwise bending moments at span station 2 (approx. 50% span) -"RootFxb1" - Out-of-plane shear, in-plane shear, and axial forces at the root of blade 1 -"RootFyb1" - Out-of-plane shear, in-plane shear, and axial forces at the root of blade 1 -"RootFzb1" - Out-of-plane shear, in-plane shear, and axial forces at the root of blade 1 -"RootMxb1" - In-plane bending, out-of-plane bending, and pitching moments at the root of blade 1 -"RootMyb1" - In-plane bending, out-of-plane bending, and pitching moments at the root of blade 1 -"RootMzb1" - In-plane bending, out-of-plane bending, and pitching moments at the root of blade 1 -"RotTorq" - Rotor torque and low-speed shaft 0- and 90-bending moments at the main bearing -"LSSGagMya" - Rotor torque and low-speed shaft 0- and 90-bending moments at the main bearing -"LSSGagMza" - Rotor torque and low-speed shaft 0- and 90-bending moments at the main bearing -"YawBrFxp" - Fore-aft shear, side-to-side shear, and vertical forces at the top of the tower (not rotating with nacelle yaw) -"YawBrFyp" - Fore-aft shear, side-to-side shear, and vertical forces at the top of the tower (not rotating with nacelle yaw) -"YawBrFzp" - Fore-aft shear, side-to-side shear, and vertical forces at the top of the tower (not rotating with nacelle yaw) -"YawBrMxp" - Side-to-side bending, fore-aft bending, and yaw moments at the top of the tower (not rotating with nacelle yaw) -"YawBrMyp" - Side-to-side bending, fore-aft bending, and yaw moments at the top of the tower (not rotating with nacelle yaw) -"YawBrMzp" - Side-to-side bending, fore-aft bending, and yaw moments at the top of the tower (not rotating with nacelle yaw) -"TwrBsFxt" - Fore-aft shear, side-to-side shear, and vertical forces at the base of the tower (mudline) -"TwrBsFyt" - Fore-aft shear, side-to-side shear, and vertical forces at the base of the tower (mudline) -"TwrBsFzt" - Fore-aft shear, side-to-side shear, and vertical forces at the base of the tower (mudline) -"TwrBsMxt" - Side-to-side bending, fore-aft bending, and yaw moments at the base of the tower (mudline) -"TwrBsMyt" - Side-to-side bending, fore-aft bending, and yaw moments at the base of the tower (mudline) -"TwrBsMzt" - Side-to-side bending, fore-aft bending, and yaw moments at the base of the tower (mudline) -"NcIMURAys" - Nacell IMU Measurement of angular acceleration about the y-axis (Fore-aft) -"NcIMUTAys" -END of input file (the word "END" must appear in the first 3 columns of this last OutList line) ---------------------------------------------------------------------------------------- diff --git a/Test_Cases/5MW_Land_Simulink/NRELOffshrBsline5MW_Onshore_ElastoDyn_Tower.dat b/Test_Cases/5MW_Land_Simulink/NRELOffshrBsline5MW_Onshore_ElastoDyn_Tower.dat deleted file mode 100644 index cbb726978..000000000 --- a/Test_Cases/5MW_Land_Simulink/NRELOffshrBsline5MW_Onshore_ElastoDyn_Tower.dat +++ /dev/null @@ -1,54 +0,0 @@ -------- ELASTODYN V1.00.* TOWER INPUT FILE ------------------------------------- -NREL 5.0 MW offshore baseline tower input properties. ----------------------- TOWER PARAMETERS ---------------------------------------- - 11 NTwInpSt - Number of input stations to specify tower geometry - 1 TwrFADmp(1) - Tower 1st fore-aft mode structural damping ratio (%) - 1 TwrFADmp(2) - Tower 2nd fore-aft mode structural damping ratio (%) - 1 TwrSSDmp(1) - Tower 1st side-to-side mode structural damping ratio (%) - 1 TwrSSDmp(2) - Tower 2nd side-to-side mode structural damping ratio (%) ----------------------- TOWER ADJUSTMUNT FACTORS -------------------------------- - 1 FAStTunr(1) - Tower fore-aft modal stiffness tuner, 1st mode (-) - 1 FAStTunr(2) - Tower fore-aft modal stiffness tuner, 2nd mode (-) - 1 SSStTunr(1) - Tower side-to-side stiffness tuner, 1st mode (-) - 1 SSStTunr(2) - Tower side-to-side stiffness tuner, 2nd mode (-) - 1 AdjTwMa - Factor to adjust tower mass density (-) - 1 AdjFASt - Factor to adjust tower fore-aft stiffness (-) - 1 AdjSSSt - Factor to adjust tower side-to-side stiffness (-) ----------------------- DISTRIBUTED TOWER PROPERTIES ---------------------------- - HtFract TMassDen TwFAStif TwSSStif - (-) (kg/m) (Nm^2) (Nm^2) -0.0000000E+00 5.5908700E+03 6.1434300E+11 6.1434300E+11 -1.0000000E-01 5.2324300E+03 5.3482100E+11 5.3482100E+11 -2.0000000E-01 4.8857600E+03 4.6326700E+11 4.6326700E+11 -3.0000000E-01 4.5508700E+03 3.9913100E+11 3.9913100E+11 -4.0000000E-01 4.2277500E+03 3.4188300E+11 3.4188300E+11 -5.0000000E-01 3.9164100E+03 2.9101100E+11 2.9101100E+11 -6.0000000E-01 3.6168300E+03 2.4602700E+11 2.4602700E+11 -7.0000000E-01 3.3290300E+03 2.0645700E+11 2.0645700E+11 -8.0000000E-01 3.0530100E+03 1.7185100E+11 1.7185100E+11 -9.0000000E-01 2.7887500E+03 1.4177600E+11 1.4177600E+11 -1.0000000E+00 2.5362700E+03 1.1582000E+11 1.1582000E+11 ----------------------- TOWER FORE-AFT MODE SHAPES ------------------------------ - 0.7004 TwFAM1Sh(2) - Mode 1, coefficient of x^2 term - 2.1963 TwFAM1Sh(3) - , coefficient of x^3 term - -5.6202 TwFAM1Sh(4) - , coefficient of x^4 term - 6.2275 TwFAM1Sh(5) - , coefficient of x^5 term - -2.504 TwFAM1Sh(6) - , coefficient of x^6 term - -70.5319 TwFAM2Sh(2) - Mode 2, coefficient of x^2 term - -63.7623 TwFAM2Sh(3) - , coefficient of x^3 term - 289.737 TwFAM2Sh(4) - , coefficient of x^4 term - -176.513 TwFAM2Sh(5) - , coefficient of x^5 term - 22.0706 TwFAM2Sh(6) - , coefficient of x^6 term ----------------------- TOWER SIDE-TO-SIDE MODE SHAPES -------------------------- - 1.385 TwSSM1Sh(2) - Mode 1, coefficient of x^2 term - -1.7684 TwSSM1Sh(3) - , coefficient of x^3 term - 3.0871 TwSSM1Sh(4) - , coefficient of x^4 term - -2.2395 TwSSM1Sh(5) - , coefficient of x^5 term - 0.5357 TwSSM1Sh(6) - , coefficient of x^6 term - -121.21 TwSSM2Sh(2) - Mode 2, coefficient of x^2 term - 184.415 TwSSM2Sh(3) - , coefficient of x^3 term - -224.904 TwSSM2Sh(4) - , coefficient of x^4 term - 298.536 TwSSM2Sh(5) - , coefficient of x^5 term - -135.838 TwSSM2Sh(6) - , coefficient of x^6 term - - diff --git a/Test_Cases/NREL-5MW/NRELOffshrBsline5MW_Onshore_ElastoDyn.dat b/Test_Cases/NREL-5MW/NRELOffshrBsline5MW_Onshore_ElastoDyn.dat index c9d2ff626..46c89f7d6 100644 --- a/Test_Cases/NREL-5MW/NRELOffshrBsline5MW_Onshore_ElastoDyn.dat +++ b/Test_Cases/NREL-5MW/NRELOffshrBsline5MW_Onshore_ElastoDyn.dat @@ -153,5 +153,7 @@ True TabDelim - Use tab delimiters in text tabular output file? (fla "TwrBsMxt" - Side-to-side bending, fore-aft bending, and yaw moments at the base of the tower (mudline) "TwrBsMyt" - Side-to-side bending, fore-aft bending, and yaw moments at the base of the tower (mudline) "TwrBsMzt" - Side-to-side bending, fore-aft bending, and yaw moments at the base of the tower (mudline) +"NcIMURAys" - Nacelle IMU rotational acceleration in the nodding direction +"NcIMUTAxs" - Nacelle IMU rotational acceleration in the streamwise direction END of input file (the word "END" must appear in the first 3 columns of this last OutList line) ---------------------------------------------------------------------------------------