Skip to content

Commit

Permalink
Merge pull request #6 from bjonkman/master
Browse files Browse the repository at this point in the history
Update template files for OpenFAST
  • Loading branch information
rafmudaf authored Dec 13, 2018
2 parents 9dbdacc + 5380412 commit f548e69
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 19 deletions.
2 changes: 0 additions & 2 deletions ConvertFASTversions/ConvertAeroDynDriver.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ function ConvertAeroDynDriver(oldDriverName, newDir, templateDir)
templateDir = strcat(thisDir,filesep, 'TemplateFiles' );

ModTemplate = 'AeroDyn15_Primary.dat';
DriverTemplate = 'bd_driver.inp';
else
ModTemplate = 'AeroDyn15_Primary.dat';
DriverTemplate = 'bd_driver.inp';
end

%%
Expand Down
17 changes: 16 additions & 1 deletion ConvertFASTversions/ConvertFAST8_16to17.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ function ConvertFAST8_16to17(oldFSTName, newDir, templateDir)

ADtemplate = 'AeroDyn15_Primary.dat';
BDtemplate = 'bd_primary.inp';
SrvDtemplate = 'SrvD_Primary_v1.05.x.dat';
FASTtemplate = 'OpenFAST.dat';
else
ADtemplate = 'AeroDyn15.dat';
BDtemplate = 'BeamDyn.dat';
FASTtemplate = 'FAST.fst';
SrvDtemplate = 'ServoDyn.dat';
FASTtemplate = 'enFAST.fst';
end
%%
% Primary input file:
Expand Down Expand Up @@ -82,6 +84,19 @@ function ConvertFAST8_16to17(oldFSTName, newDir, templateDir)
Matlab2FAST(ADPar,template,newADName, 2); %contains 2 header lines
end

%% %----------------------------------------------------------------------
% Get SrvD Data and write new ServoDyn file:
%----------------------------------------------------------------------
CompServo = GetFASTPar(FP,'CompServo');
if CompServo == 1
[SrvDPar, newSrvDName] = GetFASTPar_Subfile(FP, 'ServoFile', oldDir, newDir);
% [SrvDPar] = SetFASTPar(SrvDPar,'UsePAM','false');


template = [templateDir filesep SrvDtemplate]; %template for primary file
Matlab2FAST(SrvDPar, template, newSrvDName, 2); %contains 2 header lines
end


%% %----------------------------------------------------------------------
% Get BD Data and write new BD file:
Expand Down
1 change: 1 addition & 0 deletions ConvertFASTversions/TemplateFiles/AeroDyn15_Primary.dat
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Description line that will be printed in the output file and written to the scre
1 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]
FALSE 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 (-)
Expand Down
4 changes: 2 additions & 2 deletions ConvertFASTversions/TemplateFiles/AirfoilInfo_v1.01.x.dat
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
1.0 NonDimArea ! The non-dimensional area of the airfoil (area/chord^2) (set to 1.0 if unsure or unneeded)
0 NumCoords ! The number of coordinates in the airfoil shape file. Set to zero if coordinates not included.
! ......... x-y coordinates are next if NumCoords > 0 .............
1 NumTabs ! Number of airfoil tables in this file. Each table must have lines for Re and Ctrl.
1 NumTabs ! Number of airfoil tables in this file.
! ------------------------------------------------------------------------------
! data for table 1
! ------------------------------------------------------------------------------
0.75 Re ! Reynolds number in millions
0.0 Ctrl ! Control setting (must be 0 for current AirfoilInfo)
0.0 UserProp ! User property (control) setting
True InclUAdata ! Is unsteady aerodynamics data included in this table? If TRUE, then include 32 UA coefficients below this line
!........................................
0 alpha0 ! 0-lift angle of attack, depends on airfoil.
Expand Down
2 changes: 1 addition & 1 deletion ConvertFASTversions/TemplateFiles/SrvD_Primary_v1.05.x.dat
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ True TabDelim - Use tab delimiters in text tabular output file? (fl
"ES10.3E2" OutFmt - Format used for text tabular output (except time). Resulting field should be 10 characters. (quoted string) (currently unused)
30.0 TStart - Time to begin tabular output (s) (currently unused)
OutList - The next line(s) contains a list of output parameters. See OutListParameters.xlsx for a listing of available output channels, (-)
"ExOut1, ExOut2" - Two example outputs
"GenTq" - Example outputs
END of ServoDyn input file (the word "END" must appear in the first 3 columns of this last line).


25 changes: 15 additions & 10 deletions ConvertFASTversions/TemplateFiles/bd_primary.inp
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
--------- BEAMDYN with OpenFAST INPUT FILE -------------------------------------------
Example primary input file
---------------------- SIMULATION CONTROL --------------------------------------
TRUE Echo - Echo input data to "<RootName>.ech" (flag)
True QuasiStaticInit - Use quasistatic pre-conditioning with centripetal accelerations in initialization (flag) [dynamic solve only]
0.0 rhoinf - Numerical damping parameter for generalized-alpha integrator
2 quadrature - Quadrature method: 1=Gaussian; 2=Trapezoidal (switch)
DEFAULT refine - Refinement factor for trapezoidal quadrature (-). DEFAULT = 1 [used only when quadrature=2]
DEFAULT n_fact - Factorization frequency for the Jacobian in N-R iteration(-). DEFAULT = 5
DEFAULT DTBeam - Time step size (s).
DEFAULT NRMax - Max number of iterations in Newton-Raphson algorithm (-). DEFAULT = 10
DEFAULT stop_tol - Tolerance for stopping criterion (-)
True RotStates - Orient states in the rotating frame during linearization? (flag) [used only when linearizing]
TRUE Echo - Echo input data to "<RootName>.ech"? (flag)
TRUE QuasiStaticInit - Use quasistatic pre-conditioning with centripetal accelerations in initialization (flag) [dynamic solve only]
0.0 rhoinf - Numerical damping parameter for generalized-alpha integrator
2 quadrature - Quadrature method: 1=Gaussian; 2=Trapezoidal (switch)
DEFAULT refine - Refinement factor for trapezoidal quadrature (-) [DEFAULT = 1; used only when quadrature=2]
DEFAULT n_fact - Factorization frequency for the Jacobian in N-R iteration(-) [DEFAULT = 5]
DEFAULT DTBeam - Time step size (s)
DEFAULT load_retries - Number of factored load retries before quitting the aimulation [DEFAULT = 20]
DEFAULT NRMax - Max number of iterations in Newton-Raphson algorithm (-) [DEFAULT = 10]
DEFAULT stop_tol - Tolerance for stopping criterion (-) [DEFAULT = 1E-5]
FALSE tngt_stf_fd - Use finite differenced tangent stiffness matrix? (flag)
FALSE tngt_stf_comp - Compare analytical finite differenced tangent stiffness matrix? (flag)
DEFAULT tngt_stf_pert - Perturbation size for finite differencing (-) [DEFAULT = 1E-6]
DEFAULT tngt_stf_difftol - Maximum allowable relative difference between analytical and fd tangent stiffness (-); [DEFAULT = 0.1]
TRUE RotStates - Orient states in the rotating frame during linearization? (flag) [used only when linearizing]
---------------------- GEOMETRY PARAMETER --------------------------------------
1 member_total - Total number of members (-)
49 kp_total - Total number of key points (-) [must be at least 3]
Expand Down
19 changes: 19 additions & 0 deletions Plots/PlotFASToutput.m
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,12 @@

scaleFact = 1;
% [ColToFind, scaleFact] = getAD14ChannelName(ColToFind);
% [ColToFind, scaleFact] = getFASTv7ChannelName(ColToFind);

[newColNames, scaleFactM] = MooringColNames( ColToFind, colNames );
[newColNames, scaleFactB] = BeamDynColNames( ColToFind, newColNames );
scaleFact = scaleFact*scaleFactM*scaleFactB;

% disp( [colNames newColNames])

Indx = find( strcmpi(ColToFind, newColNames), 1, 'first' );
Expand Down Expand Up @@ -719,6 +721,23 @@
ChannelName_old = 'WaveElev';
elseif strcmpi(ChannelName,'TwHt1TPxi')
ChannelName_old = 'TTDspFA';
elseif strcmpi(ChannelName,'uWind')
ChannelName_old = 'Wind1VelX';
elseif strcmpi(ChannelName,'vWind')
ChannelName_old = 'Wind1VelY';
elseif strcmpi(ChannelName,'wWind')
ChannelName_old = 'Wind1VelZ';
elseif strcmpi(ChannelName,'RotCp')
ChannelName_old = 'RtAeroCp';
scaleFact = 1;
elseif strcmpi(ChannelName,'RotCq')
ChannelName_old = 'RtAeroCq';
scaleFact = 1;
elseif strcmpi(ChannelName,'TSR')
ChannelName_old = 'RtTSR';
elseif strcmpi(ChannelName,'RotCt')
ChannelName_old = 'RtAeroCt';
scaleFact = 1;
elseif strcmpi(ChannelName,'TwHt1TPyi')
ChannelName_old = 'TTDspSS';
elseif strcmpi(ChannelName,'ReactFXss')
Expand Down
7 changes: 4 additions & 3 deletions Utilities/ReadFASTtext.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
%%
DescStr = '';

switch nargin;
switch nargin
case 1
delim = '';
HeaderRows = 8;
Expand Down Expand Up @@ -113,12 +113,13 @@
ChanUnit = cell(1,nCols);
end

fmtStr = repmat('%f',1,nCols);
fmtStr = repmat('%f',1,nCols);
if isempty( delim )
Channels = cell2mat( textscan( fid, fmtStr ) );
else
Channels = cell2mat( textscan( line, fmtStr, 'delimiter', delim ) );
Channels = cell2mat( textscan( fid, fmtStr, 'delimiter', delim ) );
end
Channels = Channels(1:2:end,:);

fclose(fid);

Expand Down

0 comments on commit f548e69

Please sign in to comment.