diff --git a/src/classes/@Result/Result.m b/src/classes/@Result/Result.m index e37170a5899564599970d5366fd6e98d7661768b..91d79f56c13baf56ab8fd19770f81a5cd2b66ef8 100644 --- a/src/classes/@Result/Result.m +++ b/src/classes/@Result/Result.m @@ -5,7 +5,7 @@ classdef Result < handle % % Notes: % - Almost all properties are private to prevent accidental overwriting. - % + % - Most properties are structured as [nRotor, nOperPoint] % ----- % % Result properties: @@ -14,11 +14,16 @@ classdef Result < handle % indvel - Results obtained with the indVel solver % stahlhut - Results obtained with the stalhlut solver % operPts - Table with the operating points for each individual result - % ModExt - Modelling enstension options (losses, etc) - % + % ModExt - Modelling extension options (losses, etc) + % cT - Table with all Thrust coefficients + % cP - Table with all Power coefficients + % cQ - Table with all Torque coefficients % % Result methods: - % save - Save the Result object to file + % save - Save the Result object to file + % summarize - Output a summary table with the operating points and the performance + % filter - Filter for a specific operating point + % plotperf - Plot and compare rotor performances % % Result constructor: % Result = Result() creates an empty object. @@ -73,8 +78,8 @@ classdef Result < handle % --------------------------------------------- % Set methods function set.operPts(self, val) - % Note: A bug in Matlab prevents the user of variable names when size checks are added - % in the property definition. https://stackoverflow.com/q/48423003 + % Note: A bug in Matlab prevents the use of variable names when size checks are added + % in the property definition. See: https://stackoverflow.com/q/48423003 self.operPts = val; self.operPts.Properties.VariableNames = {'altitude', 'speed', 'rpm', 'collective'}; @@ -105,29 +110,21 @@ end function resTable = maketable(self, prop) % MAKETABLE Gather properties from all solvers and all operating points in a table - resTable = table('Size', [size(self.operPts, 1), 4], ... - 'VariableTypes', {'double', 'double', 'double', 'double'}); - - propName = cell(1, 4); - for i = 1:length(self.SOLVERS) - propName{i} = [prop, '_', self.SOLVERS{i}]; - end - - resTable.Properties.VariableNames = propName; - - for iRotor = 1:size(self.indvel, 2) - for iSolv = 1:length(self.SOLVERS) - for iOp = 1:size(self.operPts, 1) + resTable = table('Size', [size(self.operPts, 1), 0]); - solver = self.SOLVERS{iSolv}; + for iSolv = 1:length(self.SOLVERS) + thissolver = self.SOLVERS{iSolv}; + tmpTable = []; - if ~isempty(self.(solver)) - resTable.(iSolv)(iOp, iRotor) = self.(solver)(iOp, iRotor).(prop); - else - resTable.(iSolv)(iOp, iRotor) = NaN; - end + for iRotor = size(self.(thissolver), 2):-1:1 + for iOp = size(self.operPts, 1):-1:1 + tmpTable(iOp, iRotor) = self.(thissolver)(iOp, iRotor).(prop); end end + + if ~isempty(tmpTable) + resTable = addvars(resTable, tmpTable, 'NewVariableNames', [prop, '_', thissolver]); + end end end diff --git a/src/configs/templatecoax.m b/src/configs/templatecoax.m index 004aa0adda9a1cbba604808253c6424ebd8f63ae..fe60dd459439af0e46ec24ac5aef729c1a78f025 100644 --- a/src/configs/templatecoax.m +++ b/src/configs/templatecoax.m @@ -22,8 +22,9 @@ % Just load exisiting template template; +Sim.Out.show3D = false; % Show the 3D view of the whole rotor % Currently only indvel is supported fro coaxial -Mod.solvers = 'indvel'; % BEMT Solver ('leishman', 'indfact', 'indvel', 'stahlhut', 'all') +% Mod.solvers = 'indvel'; % BEMT Solver ('leishman', 'indfact', 'indvel', 'stahlhut', 'all') % ================================================================================================== % ================================= Blade and rotor geometry =======================================