Skip to content

Commit d6d87e1

Browse files
kmruehldforbush2jtgrasbakeestejleonqu
authored
Pulling bugfix PR WEC-Sim#1473 into dev (WEC-Sim#1480)
* Match PR 1478 on main (WEC-Sim#1479) * match PR 1478 changes on main --------- Co-authored-by: jtgrasb <87095491+jtgrasb@users.noreply.github.com> Co-authored-by: akeeste <akeeste@sandia.gov> * Fixing Regression Tests for RM3 (WEC-Sim#1473) * Fixing Regression Tests for RM3 * Updating the correct _org.mat files * resolving figure issues --------- Co-authored-by: Ruehl <kmruehl@sandia.gov> --------- Co-authored-by: dforbush2 <dforbus@sandia.gov> Co-authored-by: jtgrasb <87095491+jtgrasb@users.noreply.github.com> Co-authored-by: akeeste <akeeste@sandia.gov> Co-authored-by: Jorge Leon <72461917+jleonqu@users.noreply.github.com>
1 parent afeb73d commit d6d87e1

13 files changed

Lines changed: 59 additions & 99 deletions

File tree

Binary file not shown.

tests/RegressionTests/IrregularWaves/irregularCIC/runLoadIrregularCIC.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
% and Tp=8[s]. The RM3 WEC models has 2 bodies, restricted to heave motion
2020
% only, and has PTO damping=1200[kN-s/m].
2121

22-
global plotNO
2322
locdir=pwd;
2423
%% Run Simulation
2524
wecSim; % Run Simulation
@@ -75,7 +74,7 @@
7574
save('irregularCIC','irregularCIC')
7675

7776
%% Plot Old vs. New Comparison
78-
if plotNO==1 % global variable
77+
if testCase.openCompare==1
7978
cd ../..
8079
plotOldNew(B1,B2,Rel,[irregularCIC.B1_H_max ,irregularCIC.B1_H_I],...
8180
[irregularCIC.B2_H_max ,irregularCIC.B2_H_I],...
Binary file not shown.

tests/RegressionTests/IrregularWaves/irregularSS/runLoadIrregularSS.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
% and Tp=8[s]. The RM3 WEC models has 2 bodies, restricted to heave motion
2020
% only, and has PTO damping=1200[kN-s/m].
2121

22-
global plotNO
2322
locdir=pwd;
2423
%% Run Simulation
2524
wecSim; % Run Simulation
@@ -75,7 +74,7 @@
7574
save('irregularSS','irregularSS')
7675

7776
%% Plot Old vs. New Comparison
78-
if plotNO==1 % global variable
77+
if testCase.openCompare==1
7978
cd ../..
8079
plotOldNew(B1,B2,Rel,[irregularSS.B1_H_max ,irregularSS.B1_H_I],...
8180
[irregularSS.B2_H_max ,irregularSS.B2_H_I],...

tests/RegressionTests/IrregularWaves/printPlotIrregular.m

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,21 @@
1818
% irregular waves.
1919

2020
%% Load Data
21-
cd irregularCIC
22-
load('irregularCIC_org.mat') % Load WEC-Sim Run Data
23-
cd .. ; cd irregularSS
24-
load('irregularSS_org.mat') % Load WEC-Sim Run Data
25-
cd ..
26-
21+
load('./irregularCIC/irregularCIC.mat') % Load WEC-Sim Run Data
22+
load('./irregularSS/irregularSS.mat') % Load WEC-Sim Run Data
2723

2824
%% Plot Heave Comparisons
2925
h=figure('units','normalized','outerposition',[0 0 1 1]);
3026
% First Row = All simulations, all times
3127
% Second Row = All simulations, t=350-400s
32-
% Third Row = Original and New WEC-Sim runs only, t=350-400s
3328

3429
%First Column: Body 1 Heave
3530
startTime = 100;
3631
subplot(2,3,1)
3732
m = plot(irregularCIC.B1.WEC_Sim_new.time,irregularCIC.B1.WEC_Sim_new.heave,'r--',...
3833
irregularCIC.B1.WEC_Sim_new.time, irregularSS.B1.WEC_Sim_new.heave,'b-.');
39-
% a = get(m(1),'LineWidth')+1;
40-
% set(m(1),'LineWidth',a)
34+
a = get(m(1),'LineWidth')+1;
35+
set(m(1),'LineWidth',a)
4136
xlabel('time(s)')
4237
ylabel('Heave(m)')
4338
title('Float 1DOF 1200PTO')
@@ -49,6 +44,8 @@
4944
irregularCIC.B1.WEC_Sim_new.heave(find(irregularCIC.B1.WEC_Sim_new.time==startTime):end),'r--',...
5045
irregularSS.B1.WEC_Sim_new.time(find( irregularSS.B1.WEC_Sim_new.time==startTime):end),...
5146
irregularSS.B1.WEC_Sim_new.heave(find( irregularSS.B1.WEC_Sim_new.time==startTime):end),'b-.');
47+
a=get(m(1),'LineWidth')+1;
48+
set(m(1),'LineWidth',a)
5249
xlabel('time(s)')
5350
ylabel('Heave(m)')
5451
xlim([100 200])
@@ -58,6 +55,8 @@
5855
subplot(2,3,2)
5956
m = plot(irregularCIC.B2.WEC_Sim_new.time,irregularCIC.B2.WEC_Sim_new.heave,'r--',...
6057
irregularSS.B2.WEC_Sim_new.time, irregularSS.B2.WEC_Sim_new.heave,'b-.');
58+
a=get(m(1),'LineWidth')+1;
59+
set(m(1),'LineWidth',a)
6160
xlabel('time(s)')
6261
ylabel('Heave(m)')
6362
title('Spar/Plate 1DOF 1200PTO')
@@ -69,6 +68,8 @@
6968
irregularCIC.B2.WEC_Sim_new.heave(find(irregularCIC.B2.WEC_Sim_new.time==startTime):end),'r--',...
7069
irregularSS.B2.WEC_Sim_new.time(find( irregularSS.B2.WEC_Sim_new.time==startTime):end),...
7170
irregularSS.B2.WEC_Sim_new.heave(find( irregularSS.B2.WEC_Sim_new.time==startTime):end),'b-.');
71+
a=get(m(1),'LineWidth')+1;
72+
set(m(1),'LineWidth',a)
7273
xlabel('time(s)')
7374
ylabel('Heave(m)')
7475
xlim([100 200])
@@ -78,6 +79,8 @@
7879
subplot(2,3,3)
7980
m = plot(irregularCIC.Rel.WEC_Sim_new.time,irregularCIC.Rel.WEC_Sim_new.heave,'r--',...
8081
irregularSS.Rel.WEC_Sim_new.time, irregularSS.Rel.WEC_Sim_new.heave,'b-.');
82+
a=get(m(1),'LineWidth')+1;
83+
set(m(1),'LineWidth',a)
8184
xlabel('time(s)')
8285
ylabel('Heave(m)')
8386
title('Relative Motion 1DOF 1200PTO')
@@ -92,9 +95,13 @@
9295
irregularCIC.Rel.WEC_Sim_new.heave(find(irregularCIC.Rel.WEC_Sim_new.time==startTime):end),'r--',...
9396
irregularSS.Rel.WEC_Sim_new.time(find( irregularSS.Rel.WEC_Sim_new.time==startTime):end),...
9497
irregularSS.Rel.WEC_Sim_new.heave(find( irregularSS.Rel.WEC_Sim_new.time==startTime):end),'b-.');
98+
a=get(m(1),'LineWidth')+1;
99+
set(m(1),'LineWidth',a)
95100
xlabel('time(s)')
96101
ylabel('Heave(m)')
97102
xlim([100 200])
98103
ylim([-2 2])
99104

105+
savefig(fullfile('figIrrSolver'));
106+
100107
clear a h l m B1_H_Tolerance B2_H_Tolerance Rel_H_Tolerance str1 str2

tests/RegressionTests/RegularWaves/printPlotRegular.m

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,14 @@
1818
% regular waves.
1919

2020
%% Load Data
21-
cd regular
22-
load('regular_org.mat') % Load WEC-Sim Run Data
23-
cd .. ; cd regularCIC
24-
load('regularCIC_org.mat') % Load WEC-Sim Run Data
25-
cd .. ; cd regularSS
26-
load('regularSS_org.mat') % Load WEC-Sim Run Data
27-
cd ..
28-
21+
load('./regular/regular.mat')
22+
load('./regularCIC/regularCIC.mat')
23+
load('./regularSS/regularSS.mat')
2924

3025
%% Plot Heave Comparisons
3126
h=figure('units','normalized','outerposition',[0 0 1 1]);
3227
% First Row = All simulations, all times
3328
% Second Row = All simulations, t=350-400s
34-
% Third Row = Original and New WEC-Sim runs only, t=350-400s
3529

3630
%First Column: Body 1 Heave
3731
startTime = 100;
@@ -118,4 +112,6 @@
118112
xlim([100 150])
119113
ylim([-2 2])
120114

115+
savefig(fullfile('figRegSolver'));
116+
121117
clear a h l m B1_H_Tolerance B2_H_Tolerance Rel_H_Tolerance str1 str2
-69.7 KB
Binary file not shown.

tests/RegressionTests/RegularWaves/regular/runLoadRegular.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
% and Tp=8[s]. The RM3 WEC models has 2 bodies, restricted to heave motion
2020
% only, and has PTO damping=1200[kN-s/m].
2121

22-
global plotNO
2322
locdir=pwd;
2423
%% Run Simulation
2524
wecSim; % Run Simulation
@@ -67,7 +66,7 @@
6766
save('regular','regular')
6867

6968
%% Plot Old vs. New Comparison
70-
if plotNO==1 % global variable
69+
if testCase.openCompare==1
7170
cd ../..
7271
plotOldNew(B1,B2,Rel,[regular.B1_H_max ,regular.B1_H_I],...
7372
[regular.B2_H_max ,regular.B2_H_I]...
-64.6 KB
Binary file not shown.

tests/RegressionTests/RegularWaves/regularCIC/runLoadRegularCIC.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
% and Tp=8[s]. The RM3 WEC models has 2 bodies, restricted to heave motion
2020
% only, and has PTO damping=1200[kN-s/m].
2121

22-
global plotNO
2322
locdir=pwd;
2423
%% Run Simulation
2524

@@ -68,8 +67,7 @@
6867
save('regularCIC','regularCIC');
6968

7069
%% Plot Old vs. New Comparison
71-
72-
if plotNO==1
70+
if testCase.openCompare==1
7371
cd ../..
7472
plotOldNew(B1,B2,Rel,[regularCIC.B1_H_max ,regularCIC.B1_H_I],...
7573
[regularCIC.B2_H_max ,regularCIC.B2_H_I],...

0 commit comments

Comments
 (0)