Skip to content
Snippets Groups Projects
Verified Commit 76f8791d authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

chore(valid): add checks for spindir and hubpos

parent 510808d0
No related branches found
No related tags found
No related merge requests found
...@@ -27,14 +27,15 @@ template; % Just load exisiting template ...@@ -27,14 +27,15 @@ template; % Just load exisiting template
% Adds a second element to the blade structure to represent the second rotor % Adds a second element to the blade structure to represent the second rotor
Blade(2) = Blade(1); % Make second rotor identical to first one Blade(2) = Blade(1); % Make second rotor identical to first one
Blade(2).spinDir = -Blade(1).spinDir; % Spin in opposite direction from first rotor
% Shift second rotor w.r.t the application type
if strcmp(Sim.Misc.appli, 'heli') if strcmp(Sim.Misc.appli, 'heli')
rotorShift = [0, 0, -1]; rotorShift = [0, 0, -1] * Blade(1).radius(end);
else else
rotorShift = [-1, 0, 0]; rotorShift = [-1, 0, 0] * Blade(1).radius(end);
end end
Blade(2).hubPos = Blade(1).hubPos + rotorShift; % Shift second rotor w.r.t the application type Blade(2).hubPos = Blade(1).hubPos + rotorShift;
Blade(2).spinDir = -Blade(1).spinDir; % Spin in opposite direction from first rotor
% ================================================================================================== % ==================================================================================================
% ===================================== Operating points =========================================== % ===================================== Operating points ===========================================
......
...@@ -345,6 +345,16 @@ function Blade = checkblade(Blade, configFile, nAirfoils, DEF) ...@@ -345,6 +345,16 @@ function Blade = checkblade(Blade, configFile, nAirfoils, DEF)
'<=', nAirfoils}, ... '<=', nAirfoils}, ...
configFile, 'Blade.iAirfoil'); configFile, 'Blade.iAirfoil');
validateattributes(Blade(i).hubPos, ...
{'numeric'}, ...
{'vector', 'finite', 'nonnan', 'numel', 3}, ...
configFile, 'Blade.hubPos');
validateattributes(Blade(i).spinDir, ...
{'numeric'}, ...
{'scalar', 'integer', 'nonzero', ...
'<=', 1, '>=', -1}, ...
configFile, 'Blade.spinDir');
end end
% Discretization % Discretization
......
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