UBCSailbot / sailbot_workspace

UBC Sailbot's monorepo
https://ubcsailbot.github.io/sailbot_workspace/main/
Apache License 2.0
4 stars 1 forks source link

Create Fluid Force Computation class #307

Closed eomielan closed 5 months ago

eomielan commented 7 months ago

Purpose

To implement the Python classes that compute the lift and drag forces acting on a medium. See this confluence page for more details.

Description

You will be implementing the methods in a template class called MediumForceComputation located in boat_simulator/nodes/physics_engine/fluid_forces.py.

The class named MediumForceComputation has the following properties:

For reference, consider this diagram of an example medium (a sail) being acted on by an example fluid (wind):

Screenshot 2024-01-31 at 6 43 13 PM

Where $\vec{V_w}$ is the velocity of the true wind acting on the medium. $\vec{V_m}$ is the velocity of the medium. $\vec{V_a}$ is the velocity of the apparent wind acting on the medium. $\vec{F_L}$ is the lift force acting on the medium. $\vec{F_D}$ is the drag force acting on the medium.

With the formulas $F_L = f_L(\alpha) = \dfrac{1}{2}\rho ||v_A||^2 A(\alpha) C_L(\alpha)$, with direction perpendicular to the apparent velocity ($\vec{V_a}$) $F_D = f_D(\alpha)$, with direction parallel to the apparent velocity ($\vec{V_a}$)

Where $\rho$ is the fluid density. $A$ is the area on the medium affected by the fluid, and is a function of $\alpha$. $v_A$ is the apparent velocity between the fluid and the medium. $C_L$ is the lift coefficient of the medium, and is a function of $\alpha$. $\alpha$ is the angle of attack.

Tests

Add your unit tests to tests/unit/nodes/physics_engine/. You will use the pytest API for testing, which is already installed.

Once complete, make a pull request to the main branch.

Resources