-
Notifications
You must be signed in to change notification settings - Fork 89
/
updateInputFiles.m
87 lines (66 loc) · 2.4 KB
/
updateInputFiles.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
%% example files in the OpenFAST glue-code regression tests:
caseFile = './glue-codes/openfast/CaseList.md';
[pathstr] = fileparts(caseFile);
fid = fopen(caseFile);
caseNames = textscan(fid,'%s');
caseNames = caseNames{1};
fclose(fid);
for i= 1:length(caseNames)
casePath = [ pathstr filesep caseNames{i} ];
ConvertFAST8_16to17( [casePath filesep caseNames{i} '.fst'], casePath );
end
%% example files in the OpenFAST BeamDyn regression tests:
caseFile = './modules/beamdyn/CaseList.md';
[pathstr] = fileparts(caseFile);
fid = fopen(caseFile);
caseNames = textscan(fid,'%s');
caseNames = caseNames{1};
fclose(fid);
for i= 1:length(caseNames)
casePath = [ pathstr filesep caseNames{i} ];
ConvertBeamDynDriver( [casePath filesep 'bd_driver.inp'], casePath );
end
%% example files in the OpenFAST BeamDyn documentation:
docsPath = '../../docs/source/user/beamdyn/examples/';
caseNames = strcat(docsPath, {'bd_driver_dynamic_nrel_5mw.inp', 'bd_driver_static_nrel_5mw.inp'} );
for i= 1:length(caseNames)
ConvertBeamDynDriver( caseNames{i}, docsPath );
end
%% example files in the OpenFAST AeroDyn documentation:
docsPath = '../../docs/source/user/aerodyn/examples/';
caseNames = strcat(docsPath, {'ad_driver_example.inp'} );
for i= 1:length(caseNames)
ConvertAeroDynDriver( caseNames{i}, docsPath );
end
%% example files in the OpenFAST AeroDyn regression tests:
caseFile = './modules/aerodyn/CaseList.md';
[pathstr] = fileparts(caseFile);
fid = fopen(caseFile);
if fid > 0
caseNames = textscan(fid,'%s');
caseNames = caseNames{1};
fclose(fid);
for i= 1:length(caseNames)
casePath = [ pathstr filesep caseNames{i} ];
ConvertAeroDynDriver( [casePath filesep 'ad_driver.inp'], casePath );
end
end
%% TurbSim files in all the regression tests:
caseFile = './glue-codes/TurbSimWindsList.md';
[pathstr] = fileparts(caseFile);
fid = fopen(caseFile);
caseNames = textscan(fid,'%s');
caseNames = caseNames{1};
fclose(fid);
thisFile = which('ConvertFAST8_16to17');
thisDir = fileparts(thisFile);
templateDir = strcat(thisDir,filesep, 'TemplateFiles' );
template = [templateDir filesep 'TurbSim.inp']; %template for primary file
TurbSim_exe = '..\..\build\bin\TurbSim_x64.exe';
%%
for i= 1:length(caseNames)
TSfile = [ pathstr filesep caseNames{i} ];
TSData=FAST2Matlab(TSfile,2);
Matlab2FAST(TSData,template,TSfile,2);
system([TurbSim_exe ' ' TSfile])
end