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

doc(Polar): Improve class main documentation

- Use the proper syntax to take advantage of Matlab formatting and links
in help.

- Add more details and reformulate some stuff.
parent 8b639d8c
No related branches found
No related tags found
No related merge requests found
Pipeline #8640 passed
classdef Polar classdef Polar
% POLAR Class for polars and their manipulations. % POLAR Airfoil polars and some associated properties.
% The POLAR class is used to represent completely one or multiple polar curves related to a % The Polar class is used to store an airfoil polars (cl, cd, cm values for different angles
% single airfoil. % of attacks, at different Reynolds and Mach numbers).
% It can also contain some interesting extra properties such as the stall point, the zero-lift
% points, the linear lift range. It is also possible to compute the extrapolation of the
% polars over the complete range of angles of attack if needed.
% %
% The class also implements quick shortcuts for the more generic functions of af_tools, such % Note:
% as findcllinearrange, findstall or findzerolift. % - One Polar object correspond to one Airfoil. The properties of the Polar object are
% vectors/matrices whose the columns represent a single polar curve.
% - The method 'loadpolar' can be used instead of the constructor to load a previously saved
% polar object.
% ----- % -----
% %
% Properties: % Polar properties:
% - airfoil : Airfoil name % reynolds - Rynolds number of each polar curve, [-]
% - reynolds : Rynolds number of each polar curve % mach - Mach number of each polar curve, [-]
% - mach : Mach number of each polar curve % nCrit - nCrit number of each polar curve, [-]
% - nCrit : nCrit number of each polar curve % aoa - Angles of attack (one column per Reynolds), [rad]
% - aoa : Angles of attack (one column per Reynolds) % cl - Lift coefficient (one row per aoa, one column per Reynolds), [-]
% - cl : Lift coefficient (one row per aoa, one column per Reynolds) % cd - Drag coefficient (one row per aoa, one column per Reynolds), [-]
% - cd : Drag coefficient (one row per aoa, one column per Reynolds) % cm - Moment coefficient (one row per aoa, one column per Reynolds), [-]
% - cm : Moment coefficient (one row per aoa, one column per Reynolds) % Ext - Struct with the data of the extended polars
% Stall - Struct with the data of the stall point for each curve
% Zero - Struct with the data of the zero-lift point for each curve
% Lin - Struct with the data of the linear range each curve
% %
% Private properties (set by running the methods below): % Polar methods:
% - Ext : Struct with the data of the extended polars % Polar - Constructor
% - Stall : Struct with the data of the stall point for each curve % loadpolar - Load a polar from the MAT-file
% - Zero : Struct with the data of the zero-lift point for each curve % extendpolar - Extend polar curves over [-pi, pi]
% - Lin : Struct with the data of the linear range each curve % findstall - Find stall point
% findzerolift - Find zero-lift point
% findcllinrange - Find lift curve linear range
% analyze - Runs the above three functions
% plotpolars - Plot the polars
% %
% Methods (consult the help of each method with "help af_tools.Polar.<method>"): % Polar constructor:
% - loadpolar : Load a polar from the MAT-file % Pol = Polar() creates an empty object.
% - extendpolar : Extend polar curves over [-pi, pi]
% - findstall : Find stall point
% - findzerolift : Find zero-lift point
% - findcllinrange : Find lift curve linear range
% - analyse : Runs the above three functions
% - plotpolars : Plot the polars
% %
% Pol = Polar(reynolds, aoa, c_l) creates a polar object with only the lift coefficient data.
% %
% See also: af_tools.xf2mat. % Pol = Polar(reynolds, aoa, c_l, c_d, c_m) creates a polar object with only the lift and drag
% coefficients data.
%
% Pol = Polar(reynolds, aoa, c_l, c_d, c_m) creates a polar object with the data for the lift,
% drag and moment coefficient.
%
% Constructor input:
% reynolds : Rynolds number of each polar curve, [-]
% aoa : Angles of attack (one column per Reynolds), [rad]
% cl : Lift coefficient (one row per aoa, one column per Reynolds), [-]
% cd : Drag coefficient (one row per aoa, one column per Reynolds), [-]
% cm : Drag coefficient (one row per aoa, one column per Reynolds), [-]
%
% See also: af_tools.Airfoil, af_tools.xf2mat.
% %
% <a href="https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox">Documentation (online)</a> % <a href="https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox">Documentation (online)</a>
% TODO: make this class handle class, verify everything, simplfiy methods
% ------------------------------------------- % -------------------------------------------
% (c) Copyright 2022 University of Liege % (c) Copyright 2022 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be> % Author: Thomas Lambert <t.lambert@uliege.be>
...@@ -45,22 +67,22 @@ classdef Polar ...@@ -45,22 +67,22 @@ classdef Polar
% Repo: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox % Repo: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox
% Issues: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/issues % Issues: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/issues
% ---------------------------------------------------------------------------------------------- % ----------------------------------------------------------------------------------------------
properties properties
airfoil (1, :) cell reynolds (1, :) double {mustBeNonnegative} % Rynolds number, [-]
reynolds (1, :) double {mustBeNonnegative} mach (1, :) double {mustBeNonnegative} % Mach number, [-]
mach (1, :) double {mustBeNonnegative} nCrit (1, :) double {mustBeNonnegative} % nCrit number, [-]
nCrit (1, :) double {mustBeNonnegative} aoa (:, :) double {mustBeReal} % Angles of attack, [rad]
aoa (:, :) double {mustBeReal} cl (:, :) double {mustBeReal} % Lift coefficient, [-]
cl (:, :) double {mustBeReal} cd (:, :) double {mustBeReal} % Drag coefficient, [-]
cd (:, :) double {mustBeReal} cm (:, :) double {mustBeReal} % Moment coefficient, [-]
cm (:, :) double {mustBeReal}
end end
properties (SetAccess = private) properties (SetAccess = private)
Ext = struct('aoa', [], 'cl', [], 'cd', [], 'cm', []) Ext = struct('aoa', [], 'cl', [], 'cd', [], 'cm', []) % Extended polar data
Stall = struct('aoa', [], 'cl', [], 'cd', []) Stall = struct('aoa', [], 'cl', [], 'cd', []) % Stall point data
Zero = struct('aoa', [], 'cd', []) Zero = struct('aoa', [], 'cd', []) % Zero-lift point data
Lin = struct('slope', [], 'aoaRange', [], 'clRange', []) Lin = struct('slope', [], 'aoaRange', [], 'clRange', []) % Lift linear range data
end end
% ---------------------------------------------------------------------------------------------- % ----------------------------------------------------------------------------------------------
...@@ -68,7 +90,11 @@ classdef Polar ...@@ -68,7 +90,11 @@ classdef Polar
function self = Polar(reynolds, aoa, c_l, c_d, c_m) function self = Polar(reynolds, aoa, c_l, c_d, c_m)
% POLAR Constructor for Polar object % POLAR Constructor for Polar object
% Create a polar object with basic information. % Instantiate a polar object using basic information. See the main class help for
% details about the constructor inputs.
%
% It is also possible to populate the properties of the object based on a saved polar
% using the Polar.loadpolar method.
% %
% See also: af_tools.Polar.loadpolar % See also: af_tools.Polar.loadpolar
...@@ -118,7 +144,7 @@ classdef Polar ...@@ -118,7 +144,7 @@ classdef Polar
function self = findcllinrange(self) function self = findcllinrange(self)
% FINDZEROLIFT Find the linear range of the cl and its slope % FINDZEROLIFT Find the linear range of the cl and its slope
% %
% See also: af_tools.findcllinrange. % See also: af_tools.findcllinearrange.
[self.Lin.clRange, self.Lin.aoaRange, self.Lin.slope] = ... [self.Lin.clRange, self.Lin.aoaRange, self.Lin.slope] = ...
af_tools.findcllinearrange(self); af_tools.findcllinearrange(self);
...@@ -137,7 +163,7 @@ classdef Polar ...@@ -137,7 +163,7 @@ classdef Polar
function self = analyze(self) function self = analyze(self)
% ANALYZE Get all useful information from the polar curves at once % ANALYZE Get all useful information from the polar curves at once
% %
% See also: af_tools.findstall, af_tools.findzerolift, af_tools.findcllinrange. % See also: af_tools.findstall, af_tools.findzerolift, af_tools.findcllinearrange.
self = findstall(self); self = findstall(self);
self = findzerolift(self); self = findzerolift(self);
......
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