Processing OpenFast linearization output

Discuss theory and modeling of wind-turbine structures.

Moderator: Bonnie.Jonkman

Srinivasa.Ramisetti
Posts: 17
Joined: Fri May 08, 2020 2:12 am
Organization: CSIR-SERC
Location: India

Re: Processing OpenFast linearization output

Postby Srinivasa.Ramisetti » Thu May 14, 2020 8:14 am

Dear Jason,

Thanks for your reply. Based on your suggestion, I used the InflowWind, ServoDyn and ElastDyn dat files from the 5MW_OC4Semi_Linear case available on github. I had run this case previously with VSContrl=1 which is the default and it runs fine. But when I run openfast with the 5MW_OC4Semi_Linear inputs by changing VSContrl = 0 from VSContrl = 1 as you suggested the simulation fails with the following output. I believe some other inputs also needed to be changed when I use VSContrl. Can you please let me know how to resolve this issue?

FAST_InitializeAll:SrvD_Init:ValidatePrimaryData:VS_Rgn2K*VS_RtGnSp^2 must not be greater than
VS_RtTq.

FAST encountered an error during module initialization.
Simulation error level: FATAL ERROR

Regards,
Srinivasa

Jason.Jonkman
Posts: 4952
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Processing OpenFast linearization output

Postby Jason.Jonkman » Thu May 14, 2020 8:54 am

Dear Srinivasa,

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: https://nwtc.nrel.gov/system/files/FAST.pdf. 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.

I hope that helps.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Srinivasa.Ramisetti
Posts: 17
Joined: Fri May 08, 2020 2:12 am
Organization: CSIR-SERC
Location: India

Re: Processing OpenFast linearization output

Postby Srinivasa.Ramisetti » Thu May 14, 2020 10:57 am

Dear Jason,

Indeed your suggestion helped me in resolving the problem with VSContrl=1. This is a slightly different question. I see there is no difference in the .lin output file generated while using VSContrl=1 or VSContrl=0. Do you expect any difference in results?

Going back to my original question of using the runCampbell script. I am still unable to make the script run even after using the *.dat files from 5MW_OC4Semi_Linear case. I get several errors about missing parameters (see below) in Matlab. I guess the template files should be containing these parameters which the script wants to replace with some actual values. Is there anything you could suggest to resolve these multiple problems with the runCampbell script?

Parameter CalcSteady not found; adding it to data structure.
Parameter TrimCase not found; adding it to data structure.
Parameter TrimGain not found; adding it to data structure.
Parameter TrimTol not found; adding it to data structure.
Parameter Twr_Kdmp not found; adding it to data structure.
Parameter Bld_Kdmp not found; adding it to data structure.

Best Regards,
Srinivasa

Jason.Jonkman
Posts: 4952
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Processing OpenFast linearization output

Postby Jason.Jonkman » Thu May 14, 2020 12:22 pm

Dear Srinivasa,

With VSContrl = 0, a generator model (GenModel) is used instead of a variable-speed torque controller. Perhaps the generator model settings you are using are giving similar results to the variable-speed torque controller model settings you are using.

The updated version of OpenFAST in with the linearization and mode shape visualization capability (https://github.com/OpenFAST/openfast/pull/373) includes a change to the input files. In particular, the OpenFAST primary (*.fst) file has changed. The OpenFAST r-test will be updated once the OpenFAST pull-request has been merged in.

Included in the pull request, is a link to updated input files. In particular, an example updated OpenFAST primary input file is available here: https://github.com/bjonkman/r-test/blob ... Shapes.fst.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Srinivasa.Ramisetti
Posts: 17
Joined: Fri May 08, 2020 2:12 am
Organization: CSIR-SERC
Location: India

Re: Processing OpenFast linearization output

Postby Srinivasa.Ramisetti » Sat May 16, 2020 10:59 pm

Dear Jason,

I am confused with the different github branches of OpenFAST and r-tests. It is not very clear which OpeFAST branch and which r-test can be used with runCampbell script available in the matlab-toolbox. I have tried your suggestions to use runCampbell script and run linearization for the 5MW_OC4Semi_Linear case. But I am still unable (error while trying to read NLinTimes.) to run it as I found that OpenFAST code, which you suggested, from https://github.com/OpenFAST/openfast/pull/373 does not include linearization for HydroDyn and MoorDyn. The features for linearization for HydroDyn and MoorDyn are available in the code from https://github.com/OpenFAST/openfast/pull/350 but this does not include the mode shape visualization features and the parameters (CalcSteady, TrimCase, TrimGain, TrimTol, Twr_Kdmp, and Bld_Kdmp) used in runCampbell script. To my understanding it is not possible to use runCampbell script without merging the two branches (350 and 373) to run the 5MW_OC4Semi_Linear case. I think it could be really helpful if these two branches can be merged into the dev branch. Please correct me if I am wrong.

Also I tried running the case 5MW_Land_ModeShapes using the code from https://github.com/OpenFAST/openfast/pull/373 but the simulation fails (see below for the errors).

FAST_InitializeAll:FAST_Init:FAST_ReadPrimaryFile:Invalid numerical input for file
"5MW_Land_ModeShapes/5MW_Land_ModeShapes.fst" occurred while trying to read NLinTimes.

Best Regards,
Srinivasa

Jason.Jonkman
Posts: 4952
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Processing OpenFast linearization output

Postby Jason.Jonkman » Mon May 18, 2020 8:02 am

Dear Srinivasa,

Yes, I agree. These linearization capabilities of floating offshore functionality and for trim/mode shape visualization were developed in separately funded projects, which is why they are in separate branches, but I agree that these branches need to be reviewed and merged. I'm not sure what the hold up is to review and merge these branches, but it is likely related to the fact that it is a lot of work to do so.

Please note that using unmerged forks and branches of OpenFAST will in general be more difficult than using the more robust and stable master branch, or even the dev branch, of OpenFAST.

You are using the input file 5MW_Land_ModeShapes.fst from here: https://github.com/bjonkman/r-test/blob ... Shapes.fst? I would expect this to run using the runCampbell.m script together with the compiled source code from pull request 373. Did you change the files in some way? You can always enable the "Echo" option from the primary input file to debug problems in the input-file processing.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Srinivasa.Ramisetti
Posts: 17
Joined: Fri May 08, 2020 2:12 am
Organization: CSIR-SERC
Location: India

Re: Processing OpenFast linearization output

Postby Srinivasa.Ramisetti » Wed May 20, 2020 10:26 am

Dear Jason,

Yes I have used the same input file as you suggested. I have made no changed to any input files. Also, the "Echo" option is true.

I think previously there was some problem switching between the dev and the pr373 branches. So I tried again compiling the openfast sources from pull request 373 (the compilation took more time, almost 3 hours, compared to the openfast dev branch. gfortran version above 5 is required to compile the code unlike the code in the dev branch). This time I am able to run the 5MW_Land_ModeShapes case with the runCampbell script but I got errors (see below) related to the postprocessing data in the campbell_diagram_data function. Can you please confirm if you have run this case with the matlab script without any problems? If so could you be able share your matlab-toolbox code?

------Output from matlab------
Running mbc3 (v2.0, 29-Jan-2018)

Rotating channel "ED OoPDefl1, (m)" does not form a unique blade triplet. Blade(s) not found: 2 3
Rotating channel "ED IPDefl1, (m)" does not form a unique blade triplet. Blade(s) not found: 2 3
Rotating channel "ED TwstDefl1, (deg)" does not form a unique blade triplet. Blade(s) not found: 2 3
Rotating channel "ED BldPitch1, (deg)" does not form a unique blade triplet. Blade(s) not found: 2 3
Rotating channel "ED Spn2MLxb1, (kN-m)" does not form a unique blade triplet. Blade(s) not found: 2 3
Rotating channel "ED Spn2MLyb1, (kN-m)" does not form a unique blade triplet. Blade(s) not found: 2 3
Rotating channel "ED RootFxb1, (kN)" does not form a unique blade triplet. Blade(s) not found: 2 3
Rotating channel "ED RootFyb1, (kN)" does not form a unique blade triplet. Blade(s) not found: 2 3
Rotating channel "ED RootFzb1, (kN)" does not form a unique blade triplet. Blade(s) not found: 2 3
Rotating channel "ED RootMxb1, (kN-m)" does not form a unique blade triplet. Blade(s) not found: 2 3
Rotating channel "ED RootMyb1, (kN-m)" does not form a unique blade triplet. Blade(s) not found: 2 3
Rotating channel "ED RootMzb1, (kN-m)" does not form a unique blade triplet. Blade(s) not found: 2 3

Multi-Blade Coordinate transformation completed
Error: File: campbell_diagram_data.m Line: 131 Column: 16
Creating a string using double quotes is not supported. Use the string function.

Error in runCampbell (line 206)
[CampbellData{i_case}] = campbell_diagram_data(MBC_data{i_case}, BladeLen, TowerLen, [],
strrep(newFSTName,'.fst','.MBD.sum'));

-------------End----------------

Thank you,
Srinivasa

Jason.Jonkman
Posts: 4952
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Processing OpenFast linearization output

Postby Jason.Jonkman » Wed May 20, 2020 1:42 pm

Dear Srinivasa,

Yes, the runCampbell.m script runs on our end. Are you using the master branch of the MATLAB-Toolbox? Did you change the source code in some way? According to your error message, the following line of code:

Code: Select all

[CampbellData{i_case}] = campbell_diagram_data(MBC_data{i_case}, BladeLen, TowerLen, [], strrep(newFSTName,'.fst','.MBD.sum'));

is on line 206, but in the master branch of the MATLAB-Toolbox, this is line 184. So, I'm confused.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Srinivasa.Ramisetti
Posts: 17
Joined: Fri May 08, 2020 2:12 am
Organization: CSIR-SERC
Location: India

Re: Processing OpenFast linearization output

Postby Srinivasa.Ramisetti » Wed May 20, 2020 10:07 pm

Dear Jason,

Yes I am using the master branch of the MATLAB-Toolbox and yes I had to make few changes to the runCampbell script to make it use the dat files for the 5MW_Land_ModeShapes case as the master branch does not have the template dat files which I already mentioned here in the forum. There are a few other changes like reducing the size of arrays like WindSpeedAry =[3, 4, 5]; %(m/sec). Please see below the runCampbell code for your reference (I am sorry for the spamming this post with the matlab code as I had a problem attaching the txt file). I guess the script that you have on your end may be different from the script on the master branch because if you look at line number 184 in runCampbell script the number of arguments is 5 while the function campbell_diagram_data accepts only 4 arguments. I tried to change this in the script but I get new errors with xlswrite function.

I noticed the code to the function CampbellMatchModeNames used in runCampbell is missing. There are also parts of the code (like the copy command at line 180 and xlswrite, which does not work on Mac OS) that are OS-dependent. I think this script has not been carefully tested before committing to the github repository. Please correct me if I am wrong.

Thank you,
Srinivasa

------runCampbell.m------

Code: Select all

%
% by Bonnie Jonkman
% (c) 2016 National Renewable Energy Laboratory
% (c) 2018 Envision Energy, USA
%--------------------------------------------------------------------------

%% let's get the directory that contains the template files
templateDir = [ '..\..\ConvertFASTversions\TemplateFiles'];

% IfWtemplate  = [templateDir filesep 'InflowWind.dat'];
% SrvDtemplate = [templateDir filesep 'ServoDyn.dat'];
% EDtemplate   = [templateDir filesep 'ElastoDyn.dat'];
% FASTtemplate = [templateDir filesep 'OpenFAST.dat'];
%
% VizTemplate = [templateDir filesep 'OpenFAST-Modes.viz'];
% WriteVTKmodes = true;
% WriteFASTfiles = true;

IfWtemplate  = ['MYPATH/TemplateFiles/NRELOffshrBsline5MW_InflowWind_Steady13mps.dat'];
SrvDtemplate = ['MYPATH/TemplateFiles/NRELOffshrBsline5MW_Onshore_ServoDyn.dat'];
EDtemplate   = ['MYPATH/TemplateFiles/NRELOffshrBsline5MW_Onshore_ElastoDyn.dat'];

FASTtemplate = 'MYPATH/TemplateFiles/OpenFAST.dat';
Viztemplate = 'MYPATH/TemplateFiles/OpenFAST-Modes.viz';
%VizTemplate = [templateDir filesep 'OpenFAST-Modes.viz'];
WriteVTKmodes = true;
WriteFASTfiles = true;

WriteVTKmodes = false;
WriteFASTfiles = true;

%% Executable and base file:       
% FASTexe = '..\..\bin\openFAST_Win32.exe';
% FSTName = 'OpenFAST.fst';
%
% VizFile = 'OpenFAST-Modes.viz';

FASTexe = 'MYPATHTPOF/OpenFAST/OpenFAST-373/build/bin/openfast';
%FSTName = 'OpenFAST.fst';
FSTName = 'MYPATHTOINPUT/OpenFAST/5MW_Land_ModeShapes/5MW_Land_ModeShapes.fst';
VizFile = 'OpenFAST-Modes.viz';

%----------------------------------------------------------------------
%% Read data from original files (for modification):
[oldDir, baseName, ext ] = fileparts(FSTName);
if strcmp(oldDir,filesep)
    oldDir = ['.' filesep];
end

XLSname = [baseName '-CampbellData.xlsx']; % name for spreadsheet to write

FP = FAST2Matlab(FSTName,2); %FP are Fast Parameters, specify 2 lines of header (FAST 8)

[IfWP, InflowFile] = GetFASTPar_Subfile(FP, 'InflowFile', oldDir, oldDir);
[SrvP, ServoFile]  = GetFASTPar_Subfile(FP, 'ServoFile',  oldDir, oldDir);
[EP, EDFile] = GetFASTPar_Subfile(FP, 'EDFile', oldDir, oldDir);

CompElast = GetFASTPar(FP, 'CompElast');
CompInflow = GetFASTPar(FP, 'CompInflow');
CompServo = GetFASTPar(FP, 'CompServo');
CompAero = GetFASTPar(FP, 'CompAero');

TipRad = GetFASTPar(EP, 'TipRad');
HubRad = GetFASTPar(EP, 'HubRad');
BladeLen  = TipRad - HubRad;
TowerLen = GetFASTPar(EP, 'TowerHt');


if WriteVTKmodes
    VizP = FAST2Matlab(VizFile,2);
    WrVTK = 3;
else
    WrVTK = 0;
end

%----------------------------------------------------------------------
%% modify data, write new files (if necessary), and run

% RotSpeedAry = 0:2:14; %10; %0:2:14; %rpm
%
%
% WindSpeedAry = [];
% CompInflow = 0;
% CompAero = 0;


%% ED 5MW values:
%WindSpeedAry =[3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]; %(m/sec)
%RotSpeedAry = [6.972, 7.183, 7.506, 7.942, 8.469, 9.156, 10.296, 11.431, 11.89, 12.1, 12.1, 12.1, 12.1, 12.1, 12.1, 12.1, 12.1, 12.1, 12.1, 12.1, 12.1, 12.1, 12.1]; %(rpm)
%BldPitch1   = [0, 0, 0, 0, 0, 0, 0, 0, 0, 3.823, 6.602, 8.668, 10.45, 12.055, 13.536, 14.92, 16.226, 17.473, 18.699, 19.941, 21.177, 22.347, 23.469]; % (deg)
%GenTqAry    = [0.606, 2.58, 5.611, 9.686, 14.62, 20.174, 25.51, 31.455, 40.014, 43.094, 43.094, 43.094, 43.094, 43.094, 43.094, 43.094, 43.094, 43.094, 43.094, 43.094, 43.094, 43.094, 43.094]*1000; %(N-m)

WindSpeedAry =[3, 4, 5]; %(m/sec)
RotSpeedAry = [6.972, 7.183, 7.506]; %(rpm)
BldPitch1   = [0, 0, 0]; % (deg)
GenTqAry    = [0.606, 2.58, 5.611]*1000; %(N-m)

SimTime   = 5600; % time in seconds that the first linearization output will happen (maximum time to converge to steady-state solution)
RatedWindSpeed = 11.4;

%%
nPoints = max( length(RotSpeedAry), length(WindSpeedAry) );

FAST_linData = cell(nPoints,1); % raw data read from FAST's .lin files
getMatData   = cell(nPoints,1); % FAST .lin data converted to format that MBC can process
MBC_data     = cell(nPoints,1); % processed MBC3 data
CampbellData = cell(nPoints,1);

%%
for i_case = nPoints:-1:1

    if (CompAero > 0)
        wkSheetName = [ num2str(WindSpeedAry(i_case)), ' mps' ];       
    else
        wkSheetName = [ num2str(RotSpeedAry(i_case)), ' RPM' ];
    end
    if ( RotSpeedAry(i_case) == 0 )
        NLinTimes = 1;
    else
        NLinTimes = 36;
    end       
   
    %newFASTbase = [ baseName, '-', strrep(wkSheetName,' ','') ];
    newFASTbase = [ oldDir, '/', baseName, '-', strrep(wkSheetName,' ','') ];
    newFSTName = [ newFASTbase ext ];
    FileNames = strcat( strrep(newFSTName, '.fst','.'), strrep( cellstr(num2str( (1:NLinTimes)' )), ' ', ''), '.lin' );
       
       
    if WriteFASTfiles
        if (WindSpeedAry(i_case) > RatedWindSpeed && CompAero > 0)
            GenTq    = 43094;
            TrimCase = 3;
%             TrimGain = .1 / (RotSpeedAry(i_case) * pi/30); %-> convert RotSpeed to rad/s
%             TrimGain = TrimGain*0.1
            TrimGain = 0.001;
        else
            GenTq = GenTqAry(i_case);       
            TrimCase = 2;
%             TrimGain = 3340 / (RotSpeedAry(i_case) * pi/30); %-> convert RotSpeed to rad/s
            TrimGain = 300;
        end

       
        % InflowWind
        if CompInflow > 0
            IfWP_mod = SetFASTPar(IfWP,'HWindSpeed',WindSpeedAry(i_case));     
            Matlab2FAST(IfWP_mod,IfWtemplate,  InflowFile, 2); %contains 2 header lines
        end

       
        % ServoDyn
        if CompServo > 0
            SrvP_mod = SetFASTPar(SrvP,'VS_RtTq',GenTq);
            Matlab2FAST(SrvP_mod,SrvDtemplate, ServoFile,  2); %contains 2 header lines
        end
       
       
        % ElastoDyn
        EP_mod   = SetFASTPar(EP, 'RotSpeed',RotSpeedAry(i_case));

        if CompInflow > 0
            EP_mod   = SetFASTPar(EP_mod,'BlPitch(1)',BldPitch1(i_case));       
            EP_mod   = SetFASTPar(EP_mod,'BlPitch(2)',BldPitch1(i_case));       
            EP_mod   = SetFASTPar(EP_mod,'BlPitch(3)',BldPitch1(i_case));
        end

        Matlab2FAST(EP_mod, EDtemplate, EDFile,    2); %contains 2 header lines
       
        FP_mod = SetFASTPar(FP,'TMax',SimTime);
        FP_mod = SetFASTPar(FP_mod,'Linearize','true');
        FP_mod = SetFASTPar(FP_mod,'CalcSteady','true');
        FP_mod = SetFASTPar(FP_mod,'NLinTimes',NLinTimes);
        FP_mod = SetFASTPar(FP_mod,'TrimCase', TrimCase);
        FP_mod = SetFASTPar(FP_mod,'TrimGain', TrimGain);
        FP_mod = SetFASTPar(FP_mod,'TrimTol', 1e-3);
        FP_mod = SetFASTPar(FP_mod,'Twr_Kdmp', 0);
        FP_mod = SetFASTPar(FP_mod,'Bld_Kdmp', 0);
        FP_mod = SetFASTPar(FP_mod,'OutFmt','"ES20.12E3"'); % make sure we get enough digits of precision
        FP_mod = SetFASTPar(FP_mod,'WrVTK',WrVTK);
        Matlab2FAST(FP_mod,FASTtemplate, newFSTName, 2); %contains 2 header lines

            %% Run FAST with new input files
        status = system([FASTexe ' ' newFSTName]);
   
        if status ~= 0 % check that we have some output here
            break
        end
       
    end
   
    %% Analyze results from .lin files (azimuth average)

    if WriteVTKmodes
        ModesVizName = [newFASTbase '.ModeShapeVTK' ];
        [MBC_data{i_case}, getMatData{i_case}, FAST_linData{i_case}] = fx_mbc3( FileNames, ModesVizName );

        VizP = SetFASTPar(VizP,'CheckpointRoot',strrep(newFSTName,'.fst', '.ModeShapeVTK'));
        VizP = SetFASTPar(VizP,'MatlabFileName',ModesVizName);
        Matlab2FAST(VizP,VizTemplate, VizFile, 2); %contains 2 header lines
       
        system( [FASTexe ' -VTKLin ' VizFile]);
        system(['copy fort.51 ' strrep( newFSTName, '.fst','.viz.51' )]);
    else
        [MBC_data{i_case}, getMatData{i_case}, FAST_linData{i_case}] = fx_mbc3( FileNames );
    end
    [CampbellData{i_case}] = campbell_diagram_data(MBC_data{i_case}, BladeLen, TowerLen, [], strrep(newFSTName,'.fst','.MBD.sum'));       
   
    % write results at this RPM/WindSpeed to Excel worksheet
    try
        xlswrite(XLSname, CampbellData{i_case}.ModesTable, wkSheetName); % create a worksheet with these modes
    catch
        disp(['warning::could not write Campbell data in Excel worksheet for ' wkSheetName]);
    end
   

end


%%
% [modeID_table, modesDesc] = IdentifyModes(CampbellData);
[modeID_table, modesDesc] = CampbellMatchModeNames(CampbellData);

%%
opTable = cell(3,nPoints+1);
opTable{1,1} = 'Operating Points';
opTable{2,1} = 'Wind Speed (mps)';
opTable{3,1} = 'Rotor Speed (rpm)';
for i=1:nPoints
    opTable{2,i+1} = CampbellData{i}.WindSpeed;
    opTable{3,i+1} = CampbellData{i}.RotSpeed_rpm;
end

%%
thisTable = cell(length(modesDesc)+2,nPoints+1);
thisTable{1,1} = 'Mode Number Table';
if (CompAero > 0)
    thisTable{2,1} = 'Wind Speed (mps)';
    thisTable(2,2:end) = num2cell(WindSpeedAry);
    wkSheetName = 'WS_ModesID';
else
    thisTable{2,1} = 'Rotor Speed (rpm)';
    thisTable(2,2:end) = num2cell(RotSpeedAry);
    wkSheetName = 'ModesID';
end
%%
for i = 1:length(modesDesc)
    thisTable(i+2,1) = modesDesc(i);
end
thisTable(3:end,2:end) = num2cell(modeID_table);

try
    xlswrite(XLSname, thisTable, wkSheetName); % create a worksheet with these modes
    xlswrite(XLSname, opTable, 'OP'); % create a worksheet with these operating points
catch
    disp(['warning::could not write modes identification data in Excel worksheet for ' wkSheetName]);
end


%%
[num,txt,CampbellPlotData] = Plot_CampbellData(XLSname,wkSheetName);

Emmanuel.Branlard
Posts: 2
Joined: Tue Jan 15, 2019 12:00 pm
Organization: NREL
Location: Boulder, CO

Re: Processing OpenFast linearization output

Postby Emmanuel.Branlard » Thu May 21, 2020 6:47 pm

Hi Srinivasa,

Feel free to edit your issue on github (https://github.com/OpenFAST/matlab-toolbox/issues/18) and add some of the additional problem you encounter (such like the copy function which is OS dependent). I think the function campbell_diagram_data can be called without the 4th argument, which is optional, in which case the xls file is not written.

As you noticed, the script runCampbell is not a fully operational example, and most of the matlab functions were mostly used on windows. I have personally adapted and used a variation of this script (to avoid the xlswrite calls for instance) . As I mentioned in your github issue, we are working on streamlining the toolset to perform linearization. I'll likely post a pull request in the coming week. If you can wait, you might find the updated version easier to use, and your feedback/testing will be great.

Otherwise, it seems you are really close to get everything running with the current version.

I hope that helps,

Emmanuel

Srinivasa.Ramisetti
Posts: 17
Joined: Fri May 08, 2020 2:12 am
Organization: CSIR-SERC
Location: India

Re: Processing OpenFast linearization output

Postby Srinivasa.Ramisetti » Thu May 21, 2020 10:40 pm

Dear Emmanuel,

I have updated the issue on github with additional problems that should be resolved.

I replaced this line [CampbellData{i_case}] = campbell_diagram_data(MBC_data{i_case}, BladeLen, TowerLen, [], strrep(newFSTName,'.fst','.MBD.sum'));
to
[CampbellData{i_case}] = campbell_diagram_data(MBC_data{i_case}, BladeLen, TowerLen, strrep(newFSTName,'.fst','.MBD.sum'));
With this replacement I am now able to write the MBD.sum.xlsx file. I thought the use of [] was a mistake.

I still have problems generating the campbell diagram. I cannot use the xlswrite and csvwriteCampbell function that you shared with me on github. So I used the writetable function to write the xlsx file. But I get some other new errors (see below) while using the Plot_CampbellData.

-----Error output from matlab--------
Index exceeds matrix dimensions.

Error in Plot_CampbellData (line 93)
CampbellPlotData.lineLabels = txt(2: nLines+1, 1);

Error in runCampbell (line 266)
[num,txt,CampbellPlotData] = Plot_CampbellData(XLSname,wkSheetName);

Dhaneesh.Machavarapu
Posts: 61
Joined: Sat Feb 29, 2020 9:56 am
Organization: NITcalicut
Location: INDIA

Re: Processing OpenFast linearization output

Postby Dhaneesh.Machavarapu » Sat Jun 06, 2020 10:12 pm

Sir,

when I was trying to run mbc file with more than two different .lin files this error message was displaying.

[MBC]=fx_mbc3('5MW_Land_DLL_WTurb.1.lin','5MW_Land_DLL_WTurb.2.lin','5MW_Land_DLL_WTurb.3.lin','5MW_Land_DLL_WTurb.4.lin','5MW_Land_DLL_WTurb.5.lin','5MW_Land_DLL_WTurb.6.lin')
Error using fx_mbc3
Too many input arguments.

Can I get some help?

Jason.Jonkman
Posts: 4952
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Processing OpenFast linearization output

Postby Jason.Jonkman » Mon Jun 08, 2020 7:05 am

Dear Dhaneesh,

As mentioned in the posts above, If you want to specify multiple files, use a cell array, e.g.,

Code: Select all

FileNames = {'5MW_Land_DLL_WTurb.1.lin','5MW_Land_DLL_WTurb.2.lin','5MW_Land_DLL_WTurb.3.lin','5MW_Land_DLL_WTurb.4.lin','5MW_Land_DLL_WTurb.5.lin','5MW_Land_DLL_WTurb.6.lin'}

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

Srinivasa.Ramisetti
Posts: 17
Joined: Fri May 08, 2020 2:12 am
Organization: CSIR-SERC
Location: India

Re: Processing OpenFast linearization output

Postby Srinivasa.Ramisetti » Tue Jun 23, 2020 11:16 am

Dear Jason,

I am having trouble reproducing the Campbell diagram of NREL 5MW land based turbine using the test case ‘5MW_Land_BD_Linear’ available within the OpenFast dev branch. I have tried to use the matlab runCampbell script with some modifications to make it usable on Mac and generate the excel file to plot the Campbell diagram. The results are very different from the once reported by you. I am trying to understand if there is a problem with the matlab script or the input parameters used in the fst file. Could you please answer the following queries to help me diagnose the problem?

1. Does the input parameters, like total simulation time of 5s, timestep of 0.001, NLinTimes=1, LinTimes=0 used in the .fst file reproduce the results? Do I need to increase the total simulation time and change the first linearization step in LinTimes?
2. I am able to generate the excel file by adapting runCampbell script for different rotor speeds but the worksheet where the modes are mapped to the natural frequencies have some index numbers to be zero for all the rotor speeds. Could you help me understand the algorithm used in IdentifyModes function?

Screenshot 2020-06-23 at 22.36.11.png
Screenshot 2020-06-23 at 22.36.11.png (46.01 KiB) Viewed 348 times


3. I have also tried using the fx_mbc3 and the CampbellDiagram excel sheet shared on the forum to cross-check the results. But the mode descriptions, in particular for the blades, are not very clear. Also it was difficult to copy the output data (DescStates, MBC_ModeShapeMagnitude, MBC_ModeShapePhaseDeg_MBC_DampingRatio) from fx_mbc3 as they were all in descending order unlike what is mentioned in the excel file comments. Is this data not sorted inside the fx_mbc3 script?

Regards,
Srinivasa

Jason.Jonkman
Posts: 4952
Joined: Thu Nov 03, 2005 4:38 pm
Location: Boulder, CO
Contact:

Re: Processing OpenFast linearization output

Postby Jason.Jonkman » Tue Jun 23, 2020 5:22 pm

Dear Srinivasa,

Here are my answers to your questions:

1. The model 5MW_Land_BD_Linear.fst is not set up correctly to generate a Campbell diagram; this test was simplified for testing the compiled code, not producing useful results. For example, to generate a proper Campbell diagram, you'll need to find a periodic steady-state solution before linearizing and linearize at multiple azimuth steps to cover the full rotor rotation (requiring increasing TMax and setting NLinTimes = 36 with appropriate LinTimes). And due to the large number of DOFs in BeamDyn, you'll also need to change the precision of the linearization output (e.g., use OutFmt = "ES17.9E3") so that the eigenanalysis produces good results.

2. The IdentifyModes function only partially works. It is probably better to identify the modes manually, at least at first.

3. You don't need to use the old CampbellDiagram spreadsheet and manually paste in the data if you are using the runCampbell.m script.

Please note that the OpenFAST linearization process is being improved now. The approach will be more straightforward--including automated calculation of steady-state solutions and mode shape visualizations--once the following OpenFAST pull request is merged in: https://github.com/OpenFAST/openfast/pull/373.

Best regards,
Jason Jonkman, Ph.D.
Senior Engineer | National Wind Technology Center (NWTC)

National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway | Golden, CO 80401
+1 (303) 384 – 7026 | Fax: +1 (303) 384 – 6901
nwtc.nrel.gov


Return to “Structural Analysis”

Who is online

Users browsing this forum: No registered users and 1 guest