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

docs(readme): cleanup and reflect latest changes

parent 2b28ac3a
No related branches found
No related tags found
No related merge requests found
...@@ -77,20 +77,22 @@ af_tools.xf2mat(args) ...@@ -77,20 +77,22 @@ af_tools.xf2mat(args)
- All functions can be used as standalone functions and give meaningful output - All functions can be used as standalone functions and give meaningful output
on their own (they are not sub-routines used to perform intermediary tasks). on their own (they are not sub-routines used to perform intermediary tasks).
- Most functions can be run without input arguments. In that case, the functions - All functions can be called without arguments. If that is the case, they will
will prompt the user for the few mandatory arguments while the others will be prompt the user to manually enter or select the few mandatory arguments. The
set to their default values. rest will be set to default values.
List of functions: List of functions:
- [xf2mat](#xf2mat): Aggregates multiple XFOIL or XFLR5 polar results into a single structure. - [xf2mat](#xf2mat): Aggregates multiple XFOIL or XFLR5 polar results into a single structure.
- [extendpolar](#extendpolar): Extends polars to the full range of $`\alpha`$ ([-180, 180] deg). - [Airfoil generation](#airfoil-generation)
- [nacacamber](#nacacamber): Generates the coordinates of the camberline for a NACA 4 or 5 digits airfoil. - [nacacamber](#nacacamber): Generates the coordinates of the camberline for a NACA 4 or 5 digits airfoil.
- [nacaairfoil](#nacaairfoil): Generates the full coordinates of a NACA 4 or 5 digits airfoil. - [nacaairfoil](#nacaairfoil): Generates the full coordinates of a NACA 4 or 5 digits airfoil.
- [plotpolars](#plotpolars): Plot various polars. - [Polar manipulation](#polar-manipulation)
- [findstall](#findstall): Finds the stall point and returns the corresponding $`\alpha`$, $`C_l`$ and $`C_d`$. - [extendpolar](#extendpolar): Extends polars to the full range of $`\alpha`$ ([-180, 180] deg).
- [findzerolift](#findzerolift): Finds the zero-lift angle and the associate $`C_d`$. - [findstall](#findstall): Finds the stall point and returns the corresponding $`\alpha`$, $`C_l`$ and $`C_d`$.
- [findcllinearrange](#findcllinearrange): Finds the linear range of the lift coefficient and returns the range and lift slope. - [findzerolift](#findzerolift): Finds the zero-lift angle and the associate $`C_d`$.
- [findcllinearrange](#findcllinearrange): Finds the linear range of the lift coefficient and returns the range and lift slope.
- [plotpolars](#plotpolars): Plot various polars.
### xf2mat ### xf2mat
...@@ -104,15 +106,18 @@ data into a Matlab-ready structure. ...@@ -104,15 +106,18 @@ data into a Matlab-ready structure.
```matlab ```matlab
import af_tools.xf2mat import af_tools.xf2mat
Polar = xf2mat Polar = xf2mat
Polar = xf2mat(autosave, trimAoas, inputDir, inputFiles) Polar = xf2mat(inputDir, inputFiles, 'autosave', true)
Polar = xf2mat(inputDir, inputFiles, 'trimAoas', true)
Polar = xf2mat(inputDir, inputFiles, 'autosave', true, 'trimAoas', true)
``` ```
| Input | Example | Default | | Input | Example | Default |
|------------- | ---------------------------------------------- | --------| |------------- | ---------------------------------------------- | --------|
| `autosave` | `false`, `true` | `false` |
| `trimAoas` | `false`, `true` | - |
| `inputDir` | `'.'`, `'xf_results'` | - | | `inputDir` | `'.'`, `'xf_results'` | - |
| `inputFiles` | `'*'`, `'*0012*'`, `'{'*0012_1*', '*0012_2*'}` | `'*'` | | `inputFiles` | `'*'`, `'*0012*'`, `'{'*0012_1*', '*0012_2*'}` | `'*'` |
| | | |
| 'autosave' | `false`, `true` | `false` |
| 'trimAoas' | `false`, `true` | `false` |
The output is a structure with the following fields, where M is the number of The output is a structure with the following fields, where M is the number of
angles of attack and N is the number of input files. angles of attack and N is the number of input files.
...@@ -129,61 +134,78 @@ angles of attack and N is the number of input files. ...@@ -129,61 +134,78 @@ angles of attack and N is the number of input files.
| `cd` | Drag coefficient | [M x N] | | `cd` | Drag coefficient | [M x N] |
| `cm` | Moment coefficient | [M x N] | | `cm` | Moment coefficient | [M x N] |
### extendpolar ### Airfoil generation
This function extends known $`C_l`$ and $`C_d`$ polars to the full range of
angle of attacks [-180; 180]. This is especially useful when studying rotors and
propellers in off-design configuration (with the Blade Element Momentum Theory
for instance).
```matlab The following functions use the same two main input arguments.
import af_tools.extendpolar
[alphaExt, clExt, cdExt] = extendpolar
[alphaExt, clExt, cdExt] = extendpolar(method, limit, Polar)
[alphaExt, clExt, cdExt] = extendpolar(method, limit, alpha, cl, cd)
```
| Input | Example | Default | | Input | Example | Default |
|-------------- | ---------------------------------- | ----------- | |---------- | ---------------------------------- | -------------- |
| `method` | `'viterna'` | `'viterna'` | | `digits` | `'0012'`, `'24012'` | - |
| `limit` | `'stall','limit'` | `'last'` | | `nPoints` | `100`, `130` | `100` |
| `Polar` | `MyPolar` | - |
| `alpha` | `1:10` | - |
| `cl` | `1:10`, `rand(10,2)` | - |
| `cd` | `1:10`, `rand(10,2)` | - |
### nacacamber #### nacacamber
Determines the camber line of a NACA 4 or 5 digits airfoil. Determines the camber line of a NACA 4 or 5 digits airfoil.
```matlab ```matlab
import af_tools.nacacamber import af_tools.nacacamber
[xc, yc, gradY] = nacacamber [xc, yc, gradY] = nacacamber
[xc, yc, gradY] = nacacamber(digits, nPoints, spacing) [xc, yc, gradY] = nacacamber(digits)
[xc, yc, gradY] = nacacamber(digits, nPoints)
[xc, yc, gradY] = nacacamber(digits, nPoints, 'spacing', 'halfcosine')
``` ```
| Input | Example | Default | | Options | Example | Default |
|---------- | ---------------------------------- | -------------- | |---------- | ---------------------------------- | -------------- |
| `digits` | `'0012'`, `'24012'` | - | | 'spacing' | `halfcosine`, `cosine`, `linear` | `'halfcosine'` |
| `nPoints` | `100`, `130` | `100` |
| `spacing` | `halfcosine`, `cosine`, `linear` | `'halfcosine'` |
### nacaairfoil #### nacaairfoil
Generates the full coordinates of a NACA 4 or 5 digits airfoil. Generates the full coordinates of a NACA 4 or 5 digits airfoil.
```matlab ```matlab
import af_tools.nacaairfoil import af_tools.nacaairfoil
[x, y] = nacaairfoil [x, y] = nacaairfoil
[x, y] = nacaairfoil(digits, nPoints, spacing, finiteTrail) [x, y] = nacaairfoil(digits)
[x, y] = nacaairfoil(digits, nPoints)
[x, y] = nacaairfoil(digits, nPoints, 'spacing', spacing, 'zerote', true)
``` ```
| Input | Example | Default | | Options | Example | Default |
|-------------- | ---------------------------------- | -------------- | |---------- | ---------------------------------- | -------------- |
| `digits` | `'0012'`, `'24012'` | - | | 'spacing' | `halfcosine`, `cosine`, `linear` | `'halfcosine'` |
| `nPoints` | `100`, `130` | `100` | | 'zerote' | `true`, `false` | `true` |
| `spacing` | `halfcosine`, `cosine`, `linear` | `'halfcosine'` |
| `finiteTrail` | `true`, `false` | `false` | ### Polar manipulation
The following functions all share the same main inputs arguments in the exact
same order. These arguments can be of two types:
1. `Polar`: A Polar structure, as the one given by [xf2mat][xf2mat];
2. `alpha`, `cl`, `cd`, `cm`: Arrays representing the different polars. _Some functions only allow the first two or three arrays._
Some functions then extend these inputs by using various optional arguments.
### extendpolar
This function extends known $`C_l`$ and $`C_d`$ polars to the full range of
angle of attacks [-180; 180]. This is especially useful when studying rotors and
propellers in off-design configuration (with the Blade Element Momentum Theory
for instance).
```matlab
import af_tools.extendpolar
[alphaExt, clExt, cdExt] = extendpolar
[alphaExt, clExt, cdExt] = extendpolar(Polar)
[alphaExt, clExt, cdExt] = extendpolar(Polar, 'method', 'Viterna')
[alphaExt, clExt, cdExt] = extendpolar(Polar, 'limit', 'stall')
[alphaExt, clExt, cdExt] = extendpolar(alpha, cl, cd, 'method', 'Viterna')
```
| Options | Example | Default |
|--------- | ------------------ | ----------- |
| 'method' | `'Viterna'` | `'Viterna'` |
| 'limit' | `'stall','limit'` | `'last'` |
### plotpolars ### plotpolars
...@@ -198,14 +220,6 @@ plotpolars(Polar) ...@@ -198,14 +220,6 @@ plotpolars(Polar)
plotpolars(alpha, cl, cd, cm) plotpolars(alpha, cl, cd, cm)
``` ```
| Input | Example | Default |
|-------------- | ---------------------------------- | ------- |
| `Polar` | `MyPolar` | - |
| `alpha` | `1:10` | - |
| `cl` | `1:10`, `rand(10,2)` | - |
| `cd` | `1:10`, `rand(10,2)` | - |
| `cm` | `1:10`, `rand(10,2)` | - |
### findstall ### findstall
Finds the stall angle of attack and the associated $`C_l`$ and $`C_d`$. Finds the stall angle of attack and the associated $`C_l`$ and $`C_d`$.
...@@ -217,13 +231,6 @@ import af_tools.findstall ...@@ -217,13 +231,6 @@ import af_tools.findstall
[alpha_s, cl_s, cd_s] = findstall(alpha, cl, cd) [alpha_s, cl_s, cd_s] = findstall(alpha, cl, cd)
``` ```
| Input | Example | Default |
|-------------- | ---------------------------------- | ------- |
| `Polar` | `MyPolar` | - |
| `alpha` | `1:10` | - |
| `cl` | `1:10`, `rand(10,2)` | - |
| `cd` | `1:10`, `rand(10,2)` | - |
### findzerolift ### findzerolift
Finds the zero-lift angle of attack and the associated $`C_d`$. Finds the zero-lift angle of attack and the associated $`C_d`$.
...@@ -235,13 +242,6 @@ import af_tools.findzerolift ...@@ -235,13 +242,6 @@ import af_tools.findzerolift
[alpha_zeroL, cd_zeroL] = findzerolift(alpha, cl, cd) [alpha_zeroL, cd_zeroL] = findzerolift(alpha, cl, cd)
``` ```
| Input | Example | Default |
|-------------- | ---------------------------------- | ------- |
| `Polar` | `MyPolar` | - |
| `alpha` | `1:10` | - |
| `cl` | `1:10`, `rand(10,2)` | - |
| `cd` | `1:10`, `rand(10,2)` | - |
### findcllinearrange ### findcllinearrange
Finds the range of angles of attack for which the $`C_l`$ can be considered Finds the range of angles of attack for which the $`C_l`$ can be considered
...@@ -254,12 +254,6 @@ import af_tools.findcllinearrange ...@@ -254,12 +254,6 @@ import af_tools.findcllinearrange
[alphaRange, clRange, clSlope] = findcllinearrange(alpha,cl) [alphaRange, clRange, clSlope] = findcllinearrange(alpha,cl)
``` ```
| Input | Example | Default |
|-------------- | ---------------------------------- | ------- |
| `Polar` | `MyPolar` | - |
| `alpha` | `1:10` | - |
| `cl` | `1:10`, `rand(10,2)` | - |
## Licence ## Licence
Copyright (c) 2022 [Thomas Lambert][tlambert], University of Liège. Copyright (c) 2022 [Thomas Lambert][tlambert], University of Liège.
......
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