Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
matlab_airfoil_toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aerospace and Mechanical Engineering
matlab_airfoil_toolbox
Commits
3ddf567a
Verified
Commit
3ddf567a
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
add(airfoil): add airfoil class
parent
42da5edd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#7340
passed
2 years ago
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
+af_tools/@Airfoil/Airfoil.m
+103
-0
103 additions, 0 deletions
+af_tools/@Airfoil/Airfoil.m
+af_tools/@Airfoil/addextremereynolds.m
+42
-0
42 additions, 0 deletions
+af_tools/@Airfoil/addextremereynolds.m
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
with
146 additions
and
0 deletions
+af_tools/@Airfoil/Airfoil.m
0 → 100644
+
103
−
0
View file @
3ddf567a
classdef
Airfoil
% AIRFOIL Class for airfoils with all their important data.
% This AIRFOIL class is used to represent completely an airfoil and the important metrics
% attached to it. These data include:
% - 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)
%
% <a href="https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox">Documentation (README)</a>
% <a href="https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/issues">Report an issue</a>
% -----
%
% Usage:
% Af = AIRFOIL initiates an empty airfoil object.
%
% Af = AIRFOIL(coordFile) initiates an airfoil object whose coordinates will be found in
% coordFile. The airfoil name will be retreived automatically from the coordinates file.
%
% Af = AIRFOIL(coordFile, name) initiates an airfoil object whose coordinates will be found in
% coordFile, but using the name given as input.
%
% Inputs:
% coordFile : Airfoil coordinates, in Selig or Lednicer format (dat-file)
% name : The name of the airfoil
%
% Example:
% Af = AIRFOIL
% Af = AIRFOIL('data/naca0012.dat')
% Af = AIRFOIL('data/naca0012.dat','NACA 0012')
%
% See also: XF2MAT, EXTENDPOLAR.
%
% -----
% (c) Copyright 2022 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% Apache 2.0 License
% https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox
% ----------------------------------------------------------------------------------------------
properties
% Name
name
% Coordinates (full airfoil, upper and lower surfaces separately)
coord
upper
lower
end
properties
(
GetAccess
=
public
,
SetAccess
=
protected
)
% Polar must be protected to ensure proprer behavior of the codes using Airfoil
Polar
(
1
,
1
)
af_tools
.
Polar
end
methods
function
self
=
Airfoil
(
coordFile
,
name
)
% AIRFOIL Constructor.
% Initiates the Airfoil object based on its coordFile. If a name is explicitely
% passed, this will be used for the airfoil name. If no name is given, it will be
% retreived from the coordFile.
self
.
Polar
=
af_tools
.
Polar
;
if
nargin
>
0
&&
~
isempty
(
coordFile
)
import
af_tools
.*
% Parse the coordinates files and save the useful properties
Dat
=
formatairfoilcoord
(
coordFile
);
self
.
coord
=
Dat
.
coord
;
self
.
upper
=
Dat
.
upper
;
self
.
lower
=
Dat
.
lower
;
% Define name
if
nargin
==
2
self
.
name
=
name
;
else
self
.
name
=
Dat
.
airfoil
;
end
end
end
% ---------------------------------------
% Other methods
function
self
=
loadpolar
(
self
,
polarFile
)
self
.
Polar
=
self
.
Polar
.
loadpolar
(
polarFile
);
end
function
self
=
polypolar
(
self
,
clPoly
,
cdPoly
)
self
.
Polar
=
self
.
Polar
.
polypolar
(
clPoly
,
cdPoly
);
end
function
self
=
extendpolar
(
self
)
self
.
Polar
=
self
.
Polar
.
extendpolar
();
end
self
=
addextremereynolds
(
self
)
end
end
This diff is collapsed.
Click to expand it.
+af_tools/@Airfoil/addextremereynolds.m
0 → 100644
+
42
−
0
View file @
3ddf567a
function
obj
=
addextremereynolds
(
obj
)
% ADDEXTREMEREYNOLDS Adds dupplicate polars for extreme Reynolds number.
% In order to make a proper interpolation later on, this method duplicates the polars for the
% lowest and highest Reynolds and assign these respectively to Re = 1 and Re = 1e15.
% This will allow extrapolation outside of the original Range by symply considering the Polars
% to be Reynolds-independant if the Reynolds is very low or very high.
%
% Note:
% If we have only one polar (i.e. one Reynolds), then this method does not do anything.
% -----
% (c) Copyright 2022 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% Apache 2.0 License
% https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox
% ----------------------------------------------------------------------------------------------
% Defaults extreme Reynolds
DEF
.
LOW_REYNOLDS
=
1
;
DEF
.
HIGH_REYNOLDS
=
1e15
;
% Add duplicate polars for extreme Reynolds
if
~
isempty
(
obj
.
Polar
)
if
length
(
obj
.
Polar
.
reynolds
)
>
1
obj
.
Polar
.
reynolds
=
[
DEF
.
LOW_REYNOLDS
,
obj
.
Polar
.
reynolds
,
DEF
.
HIGH_REYNOLDS
];
obj
.
Polar
.
aoa
=
duplicateextremes
(
obj
.
Polar
.
aoa
);
obj
.
Polar
.
cl
=
duplicateextremes
(
obj
.
Polar
.
cl
);
obj
.
Polar
.
cd
=
duplicateextremes
(
obj
.
Polar
.
cd
);
obj
.
Polar
.
cm
=
duplicateextremes
(
obj
.
Polar
.
cm
);
end
end
end
function
array
=
duplicateextremes
(
array
)
% DUPLICATEEXTREMES Duplicates the first and last columns of an array
array
=
[
array
(:,
1
),
array
,
array
(:,
end
)];
end
This diff is collapsed.
Click to expand it.
CHANGELOG.md
+
1
−
0
View file @
3ddf567a
...
...
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
-
**Polar**
: add polypolar method
-
**Airfoil**
class
### Changed
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment