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
42da5edd
Verified
Commit
42da5edd
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
add(polar): polypolar method
parent
214cd796
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#7337
passed
2 years ago
Stage: static analysis
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
+af_tools/@Polar/Polar.m
+6
-0
6 additions, 0 deletions
+af_tools/@Polar/Polar.m
+af_tools/@Polar/loadpolar.m
+1
-1
1 addition, 1 deletion
+af_tools/@Polar/loadpolar.m
+af_tools/@Polar/polypolar.m
+54
-0
54 additions, 0 deletions
+af_tools/@Polar/polypolar.m
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
with
63 additions
and
1 deletion
+af_tools/@Polar/Polar.m
+
6
−
0
View file @
42da5edd
...
...
@@ -153,4 +153,10 @@ classdef Polar
methods
(
Static
)
self
=
loadpolar
(
polarFile
)
% Load polar from file
end
% ----------------------------------------------------------------------------------------------
methods
(
Static
)
self
=
polypolar
(
polyCl
,
polyCd
)
% Create polar using polynomial coefficients
end
end
This diff is collapsed.
Click to expand it.
+af_tools/@Polar/loadpolar.m
+
1
−
1
View file @
42da5edd
function
obj
=
loadpolar
(
polarFile
)
% LOADPOLAR Load a polar object from a file
% This static method can be used in place of a normal constructor.
% When this
function
is used, the Polar object saved in the MAT-File will be imported. By
% When this
method
is used, the Polar object saved in the MAT-File will be imported. By
% assigning the output to something, it effectively duplicates the polar from the MAT-file.
% -----
%
...
...
This diff is collapsed.
Click to expand it.
+af_tools/@Polar/polypolar.m
0 → 100644
+
54
−
0
View file @
42da5edd
function
Obj
=
polypolar
(
polyCl
,
polyCd
)
% POLYPOLAR Create a polar object using polynomial coefficients for cl and cd
% This static method can be used in place of a normal constructor.
% This will create a Polar object based on the polynomial coefficients given as input.
% The polar created will cover the full range of angles of attack ([-pi, pi] rad), with a step
% of 0.5 deg between two points.
% -----
%
% Usage:
% Polar.polypolar(polyCl,polyCd) returns a polar object with values equal to the coefficients.
%
% Inputs:
% polyCl : polynomial coefficients for cl (see polyval function for formatting), [1/deg]
% polyCd : polynomial coefficients for cd (see polyval function for formatting), [1/deg]
%
% Output:
% Obj: Polar object polynomial values for aoa, cl and cd an default values otherwise.
%
% Example:
% NewPolar = af_tools.Polar.polypolar([0.001, 2*pi, 0], [0.1, 0, 0.002]);
%
% See also: af_tools.Polar.
%
% -----
% (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 and constants
DEF
.
AOA_STEP
=
0.5
;
DEF
.
AIRFOIL
=
{
'Polynomial'
};
DEF
.
REYNOLDS
=
1e6
;
DEF
.
MACH
=
0
;
% ---------------------------------------
% Construct empty object first
Obj
=
af_tools
.
Polar
();
% Get lift and drag values
aoa_deg
=
(
-
180
:
DEF
.
AOA_STEP
:
180
)
'
;
Obj
.
aoa
=
deg2rad
(
aoa_deg
);
Obj
.
cl
=
polyval
(
polyCl
,
aoa_deg
);
Obj
.
cd
=
polyval
(
polyCd
,
aoa_deg
);
% Set other properties to default values
Obj
.
airfoil
=
DEF
.
AIRFOIL
;
Obj
.
reynolds
=
DEF
.
REYNOLDS
;
Obj
.
mach
=
DEF
.
MACH
;
end
This diff is collapsed.
Click to expand it.
CHANGELOG.md
+
2
−
0
View file @
42da5edd
...
...
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
-
**Polar**
: add polypolar method
### Changed
### Deprecated
...
...
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