Skip to content
Snippets Groups Projects
Commit e6696d50 authored by Tamburrini Robin's avatar Tamburrini Robin
Browse files

chore: define pitch, tgSpeed and truePitch as dependent parameters

parent 050799d7
No related branches found
No related tags found
No related merge requests found
......@@ -61,10 +61,7 @@ classdef ElemPerf < handle
upstreamVelAx (1, :) double % Upstream axial velocity above rotor disk, [m/s]
upstreamVelTg (1, :) double % Upstream tangential velocity above rotor disk, [m/s]
tgSpeed (1, :) double % Tangential speed, [m/s]
pitch (1, :) double % Pitch (twist + collective), [rad]
alpha0 (1, :) double % Zero lift angle of attack, [rad]
truePitch (1, :) double % Pitch (twist + collective - alpha_0), [rad]
cl (1, :) double % Lift coefficient, [-]
cd (1, :) double % Drag coefficient, [-]
......@@ -85,6 +82,10 @@ classdef ElemPerf < handle
% Make alpha a dependent property because Matlab does not like when we set multiple properties
% from a single set method otherwise.
properties (Dependent)
tgSpeed (1, :) double % Tangential speed, [m/s]
pitch (1, :) double % Pitch (twist + collective), [rad]
truePitch (1, :) double % Pitch (twist + collective - alpha_0), [rad]
alpha (1, :) double % Angle of attack, [rad]
reynolds (1, :) double % Reynolds number, [-]
massflow (1, :) double % Mass flow rate through the element, [kg/s]
......@@ -120,18 +121,12 @@ classdef ElemPerf < handle
self.Rot = Rot;
self.Op = Op;
% Blade pitch
self.pitch = Rot.Bl.twist + Op.coll;
% Upstream axial velocity
self.upstreamVelAx = ones(size(self.pitch)) * Op.speed;
% Upstream tangential velocity
self.upstreamVelTg = zeros(size(self.pitch));
% In-plane velocities
self.tgSpeed = Op.omega .* Rot.Bl.y;
% Get alpha_0 from reynolds
self.alpha0 = zeros(size(self.pitch));
for i = 1:length(Rot.Af)
......@@ -145,19 +140,28 @@ classdef ElemPerf < handle
end
end
% Calculate truePitch
if strcmp(self.Rot.pitchRef, 'zerolift')
self.truePitch = self.pitch - self.alpha0;
else
self.truePitch = self.pitch;
end
end
end
% ---------------------------------------------
% Get methods for dependent properties
function pitch = get.pitch(self)
pitch = self.Rot.Bl.twist + self.Op.coll;
end
function tgSpeed = get.tgSpeed(self)
tgSpeed = self.Op.omega .* self.Rot.Bl.y;
end
function truePitch = get.truePitch(self)
if strcmp(self.Rot.pitchRef, 'zerolift')
truePitch = self.pitch - self.alpha0;
else
truePitch = self.pitch;
end
end
function alpha = get.alpha(self)
alpha = self.alpha_;
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment