diff --git a/docs/Components/Aerodynamic/Flap.md b/docs/Components/Aerodynamic/Flap.md new file mode 100644 index 0000000..9cb9e81 --- /dev/null +++ b/docs/Components/Aerodynamic/Flap.md @@ -0,0 +1,29 @@ +# Flap + +The Flap class is intended to be a modifier for the lift and drag calculation on wings. Currently it only has height and width properties that can afterwards be used to calculate its correct aerodynamic behaviour. + +## Instantiation +To instantiate a Flap one can pass the same arguments used to instantiate an AttachedComponent plus its height and width: + +``` python +import math +from vec import Vector2 + +from adr.Components.Aerodynamic import Flap + +flap = Flap( + name='flap', + mass=0.05, + relative_position=Vector2(-0.34, 0), + relative_angle=math.radians(0), + width=0.25, + height=0.06 +) + +print(flap.type) +>>> flap +print(f'Flap dimensions are: {100*flap.width} x {100*flap.height} [cm].') +>>> Flap dimensions are: 25.0 x 6.0 [cm]. +``` + +Remember that a Flap component represents only one physical flap, so one probably wants to always have at least two simetrically positioned flap instances on each aerodynamic surface. \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 4992d03..8e20082 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -7,6 +7,8 @@ nav: BaseComponent: Components/BaseComponent.md FreeBody: Components/FreeBody.md AttachedComponent: Components/AttachedComponent.md + Aerodynamic: + Flap: Components/Aerodynamic/Flap.md World: Ambient: World/Ambient.md constants: World/constants.md diff --git a/tests/Components/Aerodynamic/test_Flap.py b/tests/Components/Aerodynamic/test_Flap.py new file mode 100644 index 0000000..763c74d --- /dev/null +++ b/tests/Components/Aerodynamic/test_Flap.py @@ -0,0 +1,24 @@ +import pytest +import math +from vec import Vector2 + +from adr.Components.Aerodynamic import Flap + + +@pytest.fixture +def flap(): + flap = Flap( + name='flap', + mass=0.05, + relative_position=Vector2(-0.34, 0), + relative_angle=math.radians(0), + width=0.25, + height=0.06 + ) + return flap + + +def test_instantiation(flap): + assert(flap.type == 'flap') + assert(flap.width == 0.25) + assert(flap.height == 0.06)