Evaluates drag force on a moving body using quadratic and linear drag models.
More...
#include <drag_model.hpp>
Evaluates drag force on a moving body using quadratic and linear drag models.
The drag force is computed as quad + linear from Vector3::dragForce(). Useful for validating aerodynamic behavior and comparing against gravity.
◆ DragModel()
| frcsim::DragModel::DragModel |
( |
double | drag_coefficient, |
|
|
double | reference_area_m2, |
|
|
double | air_density_kgpm3 = 1.225, |
|
|
double | linear_drag_coefficient_n_per_mps = 0.0 ) |
|
inline |
Constructs a drag force model.
- Parameters
-
| drag_coefficient | Dimensionless drag coefficient (typically 0.1–2.0). |
| reference_area_m2 | Reference area in square meters (cross-section). |
| air_density_kgpm3 | Air density in kg/m^3 (default: 1.225 at sea level). |
| linear_drag_coefficient_n_per_mps | Optional linear drag term in N/(m/s). |
◆ apply()
| void frcsim::DragModel::apply |
( |
RigidBody & | body | ) |
const |
|
inline |
Applies computed drag force to a rigid body.
- Parameters
-
| body | Rigid body to apply drag force to; kinematic bodies are skipped. |
◆ compareToEffectiveGravity()
Compares drag force magnitude against an effective gravity vector.
- Parameters
-
| body | Rigid body to evaluate using world-space velocity. |
| effective_gravity_mps2 | World-space effective gravity vector in m/s^2 (e.g., gravity + Magnus). |
- Returns
- Diagnostic comparison showing drag-to-gravity ratio.
◆ computeForce() [1/2]
Computes drag force using body geometry.
- Parameters
-
| body | Rigid body to evaluate drag for using its world-space velocity. |
- Returns
- Drag force vector in newtons.
◆ computeForce() [2/2]
| Vector3 frcsim::DragModel::computeForce |
( |
const Vector3 & | velocity_mps | ) |
const |
|
inline |
Computes drag force vector for a world-space velocity.
- Parameters
-
| velocity_mps | World-space velocity in m/s. |
- Returns
- Drag force vector in newtons.
◆ computeForceDetailed() [1/2]
Computes detailed drag force using body geometry and motion.
- Parameters
-
| body | Rigid body supplying world-space velocity and drag area geometry. |
- Returns
- DragForceDetails with force, direction, and diagnostics.
◆ computeForceDetailed() [2/2]
Computes detailed drag force breakdown for a world-space velocity vector.
- Parameters
-
| velocity_mps | World-space velocity in m/s. |
- Returns
- DragForceDetails with force, direction, and diagnostic fields.
The documentation for this class was generated from the following file: