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

doc(Airfoil): 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 c1a6d24d
No related branches found
No related tags found
No related merge requests found
classdef Airfoil < handle classdef Airfoil < handle
% AIRFOIL Class for airfoils with all their important data. % AIRFOIL Airfoil coordinates and associated polars.
% This AIRFOIL class is used to represent completely an airfoil and the important metrics % The Airfoil class is used to represent an airfoil and all important metrics attached to it
% attached to it. These data include: % (i.e. its Polars).
% - the airofil name
% - the airofil full coordinates (in Selig format)
% - the airofil upper surface coordinates
% - the airofil lower surface coordinates
% - a structure containing the original airfoil polars (obtained using xf2mat)
% - a structure containing the extended airfoil polars (obtained using extendpolar)
% ----- % -----
% %
% Usage: % Airfoil properties:
% Af = AIRFOIL initiates an empty airfoil object. % name - Airfoil name
% coord - Airfoil coordinates (in Ledneicer format)
% upper - Airfoil's upper surface coordinates
% lower - Airfoil's lower surface coordinates
% Polar - Handle of the Polar object used to store the airfoil aerodynamic coefficients
% %
% Af = AIRFOIL(coordFile) initiates an airfoil object whose coordinates will be found in % Airfoil methods:
% coordFile. The airfoil name will be retreived automatically from the coordinates file. % Airfoil - Constructor
% loadpolar - Load the airfoil polar (from xfoil or xflr5 data)
% polypolar - Create polynomial polars
% extendpolar - Extends the polars over the full range of AOA
% analyze - Extract all important metrics from the polars
% addextremereynolds - Add virtual polars for Re=0 and Re=1e9 to simplify extrapolation
% %
% Af = AIRFOIL(coordFile, name) initiates an airfoil object whose coordinates will be found in % Airfoil constructor:
% coordFile, but using the name given as input. % Airfoil() creates an empty object.
% %
% Inputs: % Af = Airfoil(coordFile) instantiate an airfoil object whose coordinates will be found in
% coordFile : Airfoil coordinates, in Selig or Lednicer format (dat-file) % 'coordFile' (a dat-file). The airfoil name will be retreived automatically from the
% name : The name of the airfoil % coordinates file.
% %
% Example: % Af = Airfoil(coordFile, name) instatiate an airfoil object based on the coordinates in
% Af = AIRFOIL % 'coordFile' and sets the airfoil name to 'name' instead of retreiving it form the dat-file.
% Af = AIRFOIL('data/naca0012.dat')
% Af = AIRFOIL('data/naca0012.dat','NACA 0012')
% %
% See also: XF2MAT, EXTENDPOLAR. % Constructor inputs:
% coordFile : File with the airfoil coordinates, in Selig or Lednicer format (dat-file)
% name : (optional) Airfoil name
%
% See also: af_tools.Polar, af_tools.xf2mat, af_tools.extendpolar.
% %
% <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 polar a handle class, remove useless methods from here
% ------------------------------------------- % -------------------------------------------
% (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>
...@@ -42,16 +48,16 @@ classdef Airfoil < handle ...@@ -42,16 +48,16 @@ classdef Airfoil < handle
% ---------------------------------------------------------------------------------------------- % ----------------------------------------------------------------------------------------------
properties properties
% Name name % Airfoil name
name
% Coordinates (full airfoil, upper and lower surfaces separately)
coord
upper
lower
end end
properties (GetAccess = public, SetAccess = protected) % Private properties to prevent accidental re-assignment
% Polar must be protected to ensure proprer behavior of the codes using Airfoil properties (GetAccess = public, SetAccess = private)
coord % Airfoil coordinates (in Ledneicer format)
upper % Airfoil's upper surface coordinates
lower % Airfoil's lower surface coordinates
% Handle of the Polar object used to store the airfoil aerodynamic coefficients
Polar (1, 1) af_tools.Polar Polar (1, 1) af_tools.Polar
end end
...@@ -59,11 +65,13 @@ classdef Airfoil < handle ...@@ -59,11 +65,13 @@ classdef Airfoil < handle
function self = Airfoil(coordFile, name) function self = Airfoil(coordFile, name)
% AIRFOIL Constructor. % AIRFOIL Constructor.
% Initiates the Airfoil object based on its coordFile. If a name is explicitely % Instantiate the airfoil based on a dat-file with all its cordinates.
% passed, this will be used for the airfoil name. If no name is given, it will be % If a name is explicitely passed as input, this will be used for the airfoil name.
% retreived from the coordFile. % If no name is given, it will be retreived from the coordFile. See main class help
% for details.
self.Polar = af_tools.Polar; self.Polar = af_tools.Polar;
if nargin > 0 && ~isempty(coordFile) if nargin > 0 && ~isempty(coordFile)
import af_tools.* import af_tools.*
......
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