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

refactor(nacacamber): use spacedvector

parent d80f2a93
No related branches found
No related tags found
No related merge requests found
...@@ -107,12 +107,14 @@ function [xc, yc, gradY] = camber4digits(digits, nPoints, spacing) ...@@ -107,12 +107,14 @@ function [xc, yc, gradY] = camber4digits(digits, nPoints, spacing)
% P = Position of the max camber divided by 10 % P = Position of the max camber divided by 10
% XX = Maximum thickness divided by 100 % XX = Maximum thickness divided by 100
import af_tools.utils.spacedvector;
% Airfoil parameters % Airfoil parameters
m = str2double(digits(1)) /100; m = str2double(digits(1)) /100;
p = str2double(digits(2)) /10; p = str2double(digits(2)) /10;
% Camberline % Camberline
xc = getxc(spacing, nPoints); xc = spacedvector(spacing, nPoints);
yc = zeros(size(xc)); yc = zeros(size(xc));
gradY = zeros(size(xc)); gradY = zeros(size(xc));
...@@ -139,13 +141,15 @@ function [xc, yc, gradY] = camber5digits(digits, nPoints, spacing) ...@@ -139,13 +141,15 @@ function [xc, yc, gradY] = camber5digits(digits, nPoints, spacing)
% Q = Camber line (0=standard, 1=reflex) % Q = Camber line (0=standard, 1=reflex)
% XX = Maximum thickness divided by 100 % XX = Maximum thickness divided by 100
import af_tools.utils.spacedvector;
% Airfoil parameters % Airfoil parameters
cld = str2double(digits(1)) *3/20; cld = str2double(digits(1)) *3/20;
p = str2double(digits(2)) /20; p = str2double(digits(2)) /20;
q = str2double(digits(3)); q = str2double(digits(3));
% Camberline % Camberline
xc = getxc(spacing, nPoints); xc = spacedvector(spacing, nPoints);
yc = zeros(size(xc)); yc = zeros(size(xc));
gradY = zeros(size(xc)); gradY = zeros(size(xc));
...@@ -177,24 +181,6 @@ yc = (cld/0.3) * yc; ...@@ -177,24 +181,6 @@ yc = (cld/0.3) * yc;
end end
% ------------------------------------------------------------------------------
function xc = getxc(spacing, nPoints)
% GETXC Returns xc vector based on chosen spacing and number of points
switch spacing
case 'linear'
xc = linspace(0, 1, (nPoints));
case 'halfcosine'
beta = linspace(0, pi, (nPoints));
xc = (1-cos(beta))/2;
case 'cosine'
beta = linspace(0, pi/2, (nPoints));
xc = 1-cos(beta);
end
end
% ------------------------------------------------------------------------------ % ------------------------------------------------------------------------------
function [r,k1,k2k1] = getcoeffs5digits(q, p) function [r,k1,k2k1] = getcoeffs5digits(q, p)
% GETCOEFFS5DIGITS Outputs the value of the various coefficients used in the NACA 5digits formula. % GETCOEFFS5DIGITS Outputs the value of the various coefficients used in the NACA 5digits formula.
......
...@@ -19,23 +19,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -19,23 +19,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security ### Security
## [1.2.0] - 2022-04-10
### Added
- **uiuccleaner**: Add `refine` option to allow the refining of the original
datafile (spline interpolation to add more points).
### Changed
- Refactor of spacing function (**nacacamber**, **uiuccleaner**).
### Fixed
- **utils.parsefileinputs**: minor fix in case inputFiles is a cell array
## [1.1.0] - 2022-04-10 ## [1.1.0] - 2022-04-10
### Added ### Added
- Added `savedat` option for _nacaairfoil_ - **nacaairfoil**: Added `savedat` option
- **Added uiuccleaner function** - **Added uiuccleaner function**.
### Changed ### Changed
- Coordinates outputted by _nacaairfoil_ now start at TE, go along upper side to - **nacaairfoil**: Coordinates outputted now start at TE, go along upper side to
LE, then go along lower side back to TE LE, then go along lower side back to TE.
- Refactor input parsing for xf2mat - **xf2mat**: Refactor input parsing.
## [1.0.0] - 2022-04-08 ## [1.0.0] - 2022-04-08
- Initial release - Initial release
[Unreleased]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/v1.0.0...master [Unreleased]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/v1.0.0...master
[1.2.0]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/v1.1.0...v1.2.0
[1.1.0]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/v1.0.0...v1.1.0 [1.1.0]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/compare/v1.0.0...v1.1.0
[1.0.0]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/releases/v1.0.0 [1.0.0]: https://gitlab.uliege.be/am-dept/matlab_airfoil_toolbox/-/releases/v1.0.0
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