Skip to content

Commit

Permalink
Cleaning up PTO-Sim files
Browse files Browse the repository at this point in the history
  • Loading branch information
jleonqu committed May 23, 2023
1 parent 1557a7c commit f5f6688
Showing 2 changed files with 12 additions and 21 deletions.
30 changes: 12 additions & 18 deletions source/objects/ptoSimClass.m
Original file line number Diff line number Diff line change
@@ -109,29 +109,23 @@
% type: This property must be defined to specify the
% type of block that will be used. The type value of each block is
% presented below:
% Type = 1 ---- Electric generator equivalent circuit
% Type = 2 ---- Hydraulic cylinder
% Type = 3 ---- Hydraulic accumulator
% Type = 4 ---- Rectifying check valve
% Type = 5 ---- Hydraulic motor
% Type = 6 ---- Linear crank
% Type = 7 ---- Adjustable rod
% Type = 8 ---- Check valve
% Type = 9 ---- Direct drive linear generator
% Type = 10 ---- Direct drive Rotary generator
% type = 'electricGen' ---- Electric generator equivalent circuit
% type = 'hydraulicCyl' ---- Hydraulic cylinder
% type = 'hydraulicAcc' ---- Hydraulic accumulator
% type = 'rectCheckValve' ---- Rectifying check valve
% type = 'hydraulicMotor' ---- Hydraulic motor
% type = 'linCrank' ---- Linear crank
% type = 'adjustableRod' ---- Adjustable rod
% type = 'checkValve' ---- Check valve
% type = 'ddLinearGen' ---- Direct drive linear generator
% type = 'ddRotaryGen' ---- Direct drive Rotary generator
type = 'NOT DEFINED'; % PTOSim Block type
number = [] % PTOSim number
typeNum = []; % Number to represent different type of waves
number = [] % PTOSim block number
typeNum = []; % Number to represent different type of PTO-Sim blocks
end

methods
function obj = ptoSimClass(type)
% Initilization function
%if exist('name','var')
% obj.name = name;
%else
% error('The ptoSim class number(s) in the wecSimInputFile must be specified in ascending order starting from 1. The ptoSimClass() function should be called first to initialize each ptoSim block with a name.')
%end
obj.type = type;
switch obj.type
case {'electricGen'} % Electric generator equivalent circuit
3 changes: 0 additions & 3 deletions source/objects/responseClass.m
Original file line number Diff line number Diff line change
@@ -235,7 +235,6 @@
end
% PTO-Sim
if isstruct(ptosimOutput)
%names = {'HydPistonCompressible','GasHydAccumulator','RectifyingCheckValve','HydraulicMotorV2','ElectricMachineEC'};
hydPistonCompressibleSignals = {'pressureA','forcePTO','pressureB'};
gasHydAccumulatorSignals = {'pressure','flowRate'};
rectifyingCheckValveSignals = {'flowRateA','flowRateB','flowRateC','flowRateD'};
@@ -273,8 +272,6 @@
signals = rotaryGeneratorSignals;
end
for jj = 1:length(signals)
disp(strcat('jj = ',num2str(jj)))
disp(strcat('ii = ',num2str(ii)))
obj.ptoSim(ii).(signals{jj}) = ptosimOutput(ii).signals.values(:,jj);
end
end

0 comments on commit f5f6688

Please sign in to comment.