From 422dc4575c735a560e787fd70be73e46956f0192 Mon Sep 17 00:00:00 2001 From: Thomas Lambert <t.lambert@uliege.be> Date: Fri, 22 Sep 2023 14:53:42 +0200 Subject: [PATCH] feat(coax,WIP): add options for contraction --- src/classes/@ElemPerf/ElemPerf.m | 2 +- src/configs/caradonna1981.m | 5 +++++ src/configs/knight1937.m | 5 +++++ src/configs/template.m | 5 +++++ src/configs/templatecoax.m | 1 + src/solvers/bemt.m | 2 +- src/utils/preproc/validateconfig.m | 21 +++++++++++++++++++-- 7 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/classes/@ElemPerf/ElemPerf.m b/src/classes/@ElemPerf/ElemPerf.m index c700032..4c4d7df 100644 --- a/src/classes/@ElemPerf/ElemPerf.m +++ b/src/classes/@ElemPerf/ElemPerf.m @@ -290,7 +290,7 @@ classdef ElemPerf < handle calcforces(self) % Calculate forces, torque and power [cl, cd] = getclcd(self, aoaVect, reyVect, i) % Get values of cl and cd plotveltriangles(self, nTriangles, varargin) - updateupstreamvel(self, PrevOpRot) + updateupstreamvel(self, PrevOpRot, Mod) end end diff --git a/src/configs/caradonna1981.m b/src/configs/caradonna1981.m index 48410f2..bc082d9 100644 --- a/src/configs/caradonna1981.m +++ b/src/configs/caradonna1981.m @@ -53,6 +53,11 @@ Mod.solvers = {'all'}; % BEMT Solver ('leishman', 'indfact', 'indvel', 'stahlh % Extensions/corrections Mod.Ext.losses = 'all'; % Include losses using Prandtl formula ('none', 'hub', 'tip', 'both') +% [COAXIAL ONLY] Contraction model +Mod.coax.model = 'mst'; % Type of contraction ('none', 'sst', 'smst', 'mst') +Mod.coax.contraType = 'farfield'; % (opt) Type of contraction ('farfield', 'value') +Mod.coax.contraVal = 1 / 2; % (opt) Contraction ratio between upper disk and lower rotor, [-] + % Numerical parameters Mod.Num.convCrit = 1e-4; % Convergence criterion value, Mod.Num.maxIter = 500; % Maximum number of iterations for convergence calculations diff --git a/src/configs/knight1937.m b/src/configs/knight1937.m index 7e6ee22..a328fa7 100644 --- a/src/configs/knight1937.m +++ b/src/configs/knight1937.m @@ -48,6 +48,11 @@ Mod.solvers = {'indvel'}; % BEMT Solver ('leishman', 'indfact', 'indvel', 'sta % Extensions/corrections Mod.Ext.losses = 'all'; % Include losses using Prandtl formula ('none', 'hub', 'tip', 'both') +% [COAXIAL ONLY] Contraction model +Mod.coax.model = 'mst'; % Type of contraction ('none', 'sst', 'smst', 'mst') +Mod.coax.contraType = 'farfield'; % (opt) Type of contraction ('farfield', 'value') +Mod.coax.contraVal = 1 / 2; % (opt) Contraction ratio between upper disk and lower rotor, [-] + % Numerical parameters Mod.Num.convCrit = 1e-4; % Convergence criterion value, Mod.Num.maxIter = 500; % Maximum number of iterations for convergence calculations diff --git a/src/configs/template.m b/src/configs/template.m index 3e471b3..6df35d0 100644 --- a/src/configs/template.m +++ b/src/configs/template.m @@ -85,6 +85,11 @@ Mod.solvers = 'all'; % BEMT Solver ('leishman', 'indfact', 'indvel', 'stahlhut' % Extensions/corrections Mod.Ext.losses = 'none'; % Include losses using Prandtl formula ('none', 'hub', 'tip', 'both') +% [COAXIAL ONLY] Contraction model +Mod.coax.model = 'mst'; % Type of contraction ('none', 'sst', 'smst', 'mst') +Mod.coax.contraType = 'farfield'; % Type of contraction ('farfield', 'value') +Mod.coax.contraVal = 1 / 2; % (opt) Contraction ratio between upper disk and lower rotor, [-] + % Numerical parameters Mod.Num.convCrit = 1e-4; % Convergence criterion value, Mod.Num.maxIter = 500; % Maximum number of iterations for convergence calculations diff --git a/src/configs/templatecoax.m b/src/configs/templatecoax.m index 978dfcd..aae4f71 100644 --- a/src/configs/templatecoax.m +++ b/src/configs/templatecoax.m @@ -41,6 +41,7 @@ for i = 2:N_ROTORS % ================================ Blade and rotor geometry ==================================== Blade(i) = Blade(1); % Make second rotor identical to first one Blade(i).spinDir = -1 * Blade(i - 1).spinDir; % Invert spin direction for each rotor + Blade(i).nElem = round(Blade(i - 1).nElem * 1); % Shift second rotor w.r.t the application type if strcmp(Sim.Misc.appli, 'heli') diff --git a/src/solvers/bemt.m b/src/solvers/bemt.m index 7de504b..8924ea4 100644 --- a/src/solvers/bemt.m +++ b/src/solvers/bemt.m @@ -39,7 +39,7 @@ function bemt(OpRot, Mod) bemtsinglerot(OpRot(1), Mod); for i = 2:length(OpRot) - OpRot(i).ElPerf.updateupstreamvel(OpRot(i - 1)); % Update upstream velocity + OpRot(i).ElPerf.updateupstreamvel(OpRot(i - 1), Mod); % Update upstream velocity bemtsinglerot(OpRot(i), Mod); % Calculate BEMT as usual, with new upstream vel distribution end diff --git a/src/utils/preproc/validateconfig.m b/src/utils/preproc/validateconfig.m index 57fdc42..413ac30 100644 --- a/src/utils/preproc/validateconfig.m +++ b/src/utils/preproc/validateconfig.m @@ -74,6 +74,8 @@ function [Sim, Mod, Flow, Op, Airfoil, Blade] = validateconfig(configFile) DEF.NONDIM = {'US', 'EU'}; DEF.VERBOSITY = {'min', 'all'}; DEF.SOLVERS = {'leishman', 'indfact', 'indvel', 'stahlhut', 'all'}; + DEF.CONTRACTION_TYPE = {'farfield', 'value'}; + DEF.CONTRACTION_MODEL = {'none', 'sst', 'smst', 'mst'}; DEF.FLUID = {'air', 'seawater', 'freshwater'}; DEF.LOSSES = {'none', 'hub', 'tip', 'both', 'all'}; DEF.POLARS = {'polynomial', 'file'}; @@ -88,12 +90,12 @@ function [Sim, Mod, Flow, Op, Airfoil, Blade] = validateconfig(configFile) % Input checks Sim = checksim(Sim, configFile, DEF); % Simulation parameters - Mod = checkmod(Mod, configFile, DEF); % Models, solvers, etc. Flow.fluid = validatestring(Flow.fluid, DEF.FLUID, configFile, 'Flow.fluid'); % Fluid Airfoil = checkairfoil(Airfoil, configFile, DEF); % Airfoils data Blade = checkblade(Blade, configFile, length(Airfoil), DEF); % Blade Op = checkop(Op, configFile, DEF, numel(Blade), Flow.fluid); % Operating points + Mod = checkmod(Mod, configFile, numel(Blade), DEF); % Models, solvers, etc. % =========================================== % Extra warnings @@ -169,7 +171,7 @@ end % ================================================================================================== % ==================================== Models and solvers ========================================== % ================================================================================================== -function Mod = checkmod(Mod, configFile, DEF) +function Mod = checkmod(Mod, configFile, nRotors, DEF) % Solvers Mod.solvers = cellstr(Mod.solvers); @@ -195,6 +197,21 @@ function Mod = checkmod(Mod, configFile, DEF) {'scalar', 'positive'}, ... configFile, 'Mod.Num.maxIter'); + if nRotors > 1 + Mod.coax.model = validatestring(Mod.coax.model, DEF.CONTRACTION_MODEL, ... + configFile, 'Mod.coax.model'); + if ~strcmpi(Mod.coax.model, 'none') + Mod.coax.contraType = validatestring(Mod.coax.contraType, DEF.CONTRACTION_TYPE, ... + configFile, 'Mod.coax.contraType'); + end + if strcmp(Mod.coax.contraType, 'value') + validateattributes(Mod.coax.contraVal, ... + {'double'}, ... + {'scalar', 'positive'}, ... + configFile, 'Mod.Num.convCrit'); + end + end + end % ================================================================================================== -- GitLab