From 67225be0a6c074aec849d2a26028729723be1cec Mon Sep 17 00:00:00 2001 From: Thomas Lambert <t.lambert@uliege.be> Date: Wed, 20 Sep 2023 10:59:46 +0200 Subject: [PATCH] refact(config): more generic coax template --- src/configs/templatecoax.m | 57 +++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/src/configs/templatecoax.m b/src/configs/templatecoax.m index fe60dd4..5615acb 100644 --- a/src/configs/templatecoax.m +++ b/src/configs/templatecoax.m @@ -1,5 +1,5 @@ % TEMPLATECOAX Template configuration file for Coaxial rotors simulations with Rotare. -% This file extends the regular template configuration by adding a second rotor geometry. +% This file extends the regular template configuration by adding N-1 coaxial rotors. % ----- % % See also: template, rotare, validconfig. @@ -16,37 +16,44 @@ % Issues: https://gitlab.uliege.be/rotare/rotare/-/issues %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +N_ROTORS = 4; % Total number of rotors in coaxial configuration, [-] + % ================================================================================================== % ================================== Baseline configuration ======================================== % ================================================================================================== % 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') - -% ================================================================================================== -% ================================= Blade and rotor geometry ======================================= -% ================================================================================================== -% 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).spinDir = -Blade(1).spinDir; % Spin in opposite direction from first rotor +Sim.Out.show3D = false; % Disable 3D as it is not supported for coaxial (yet) -% Shift second rotor w.r.t the application type -if strcmp(Sim.Misc.appli, 'heli') - rotorShift = [0, 0, -1] * Blade(1).radius(end); -else - rotorShift = [-1, 0, 0] * Blade(1).radius(end); -end -Blade(2).hubPos = Blade(1).hubPos + rotorShift; +% FIXME: Currently only indvel is supported for coaxial +Mod.solvers = 'indvel'; % BEMT Solver ('leishman', 'indfact', 'indvel', 'stahlhut', 'all') % ================================================================================================== -% ===================================== Operating points =========================================== +% ====================================== COAXIAL SYSTEM =========================================== % ================================================================================================== - -% Operating points must be set for the two rotors -% We simply extend the collective and rpm fields by adding values for the new rotor -Op.collective = [Op.collective; 1, 4, 7]; -Op.rpm = [Op.rpm; 900, 1200]; +% Adds a as many rotors as required, based on the initial blade geometry + +% First rotor settings for collective and RPM +init_coll = Op.collective; +init_rpm = Op.rpm; +Blade(N_ROTORS - 1) = Blade(1); % Pre-alloc + +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 + + % Shift second rotor w.r.t the application type + if strcmp(Sim.Misc.appli, 'heli') + rotorShift = [0, 0, -1] * Blade(i - 1).radius(end); + else + rotorShift = [-1, 0, 0] * Blade(i - 1).radius(end); + end + Blade(i).hubPos = Blade(i - 1).hubPos + rotorShift; + + % =================================== Operating points ========================================= + Op.collective = [Op.collective; init_coll]; + Op.rpm = [Op.rpm; init_rpm]; +end -- GitLab