Skip to content

Commit

Permalink
Add ROSCO Simulink Model and simple Matlab/Simulink run case
Browse files Browse the repository at this point in the history
  • Loading branch information
dzalkind authored and nikhar-abbas committed Sep 17, 2020
1 parent 2866ebd commit b29d62b
Show file tree
Hide file tree
Showing 11 changed files with 22,357 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ examples/cp_ct_cq_lut.p
# Files Generated in Examples
Examples/DISCON.IN
Examples/*.p

# Matlab Stuff
Matlab_Toolbox/*.slxc
*.mat

45 changes: 45 additions & 0 deletions Matlab_Toolbox/ReadWrite_FAST.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
function [P,Cx] = ReadWrite_FAST(fast)
% fast should have the following fields:
% .FAST_directory - where files come from
% .FAST_InputFile - main input file (.fst)
% .FAST_runDirectory - where new files will be run from
%
% Outputs:
% P - parameter structure
% F - filename structure
%
% This is a simplified version of a similar file at https://github.com/dzalkind/matlab-toolbox/tree/master/Simulations

%% Read
FP = FAST2Matlab(fullfile(fast.FAST_directory,fast.FAST_InputFile),2); %FP are Fast Parameters, specify 2 lines of header (FAST 8)

[EDP, EDFile] = GetFASTPar_Subfile(FP, 'EDFile', fast.FAST_directory, fast.FAST_directory);
[IWP, IWFile] = GetFASTPar_Subfile(FP, 'InflowFile', fast.FAST_directory, fast.FAST_directory);
[ADP, ADFile] = GetFASTPar_Subfile(FP, 'AeroFile', fast.FAST_directory, fast.FAST_directory);
[SvDP, SvDFile] = GetFASTPar_Subfile(FP, 'ServoFile', fast.FAST_directory, fast.FAST_directory);
[HDP, HDFile] = GetFASTPar_Subfile(FP, 'HydroFile', fast.FAST_directory, fast.FAST_directory,true);
% [SbDP, SbDFile] = GetFASTPar_Subfile(FP, 'SubFile', fast.FAST_directory, fast.FAST_directory);
% [MDP, MDFile] = GetFASTPar_Subfile(FP, 'MooringFile', fast.FAST_directory, fast.FAST_directory);
% [IDP, IDFile] = GetFASTPar_Subfile(FP, 'IceFile', fast.FAST_directory, fast.FAST_directory);

% Control Parameters
[~,SD_dllFile] = GetFASTPar_Subfile(SvDP,'DLL_InFile',fast.FAST_directory, fast.FAST_directory);
SD_dllP = ROSCO2Matlab(SD_dllFile,2);
PerfFileName = GetFASTPar(SD_dllP,'PerfFileName');

% Cp Surface
Cx = Pre_LoadRotPerf(fullfile(fast.FAST_directory,PerfFileName(2:end-1)));


%% Write Outputs

% parameters
P.FP = FP;
P.EDP = EDP;
P.IWP = IWP;
P.ADP = ADP;
P.HDP = HDP;
P.SvDP = SvDP;
P.SD_dllP = SD_dllP;


Loading

0 comments on commit b29d62b

Please sign in to comment.