Private Functions

VortexStepMethod.calculate_inertia_tensorFunction
calculate_inertia_tensor(vertices, faces, mass, com)

Calculate the inertia tensor for a triangulated surface mesh, assuming a thin shell with uniform surface density.

Arguments

  • vertices: Vector of 3D point coordinates representing mesh vertices
  • faces: Vector of triangle indices, each defining a face of the mesh
  • mass: Total mass of the shell in kg
  • com: Center of mass coordinates [x,y,z]

Method

Uses the thin shell approximation where:

  1. Mass is distributed uniformly over the surface area
  2. Each triangle contributes to the inertia based on its area and position
  3. For each triangle vertex p, contribution to diagonal terms is: area * (sum(p²) - p_i²)
  4. For off-diagonal terms: area * (-p_i * p_j)
  5. Final tensor is scaled by mass/(3*total_area) to get correct units

Returns

  • 3×3 matrix representing the inertia tensor in kg⋅m²
source
VortexStepMethod.unrefined_deform!Function
unrefined_deform!(wing::Wing, theta_angles=nothing, delta_angles=nothing; smooth=false)

Apply deformation angles directly to unrefined wing sections.

For wings that support deformation (OBJ-based wings with nondeformedsections), this applies thetaangles and deltaangles directly to unrefined sections and then applies deformation. For wings without deformation support (YAML-based), this is a no-op that only succeeds if both angle inputs are nothing.

Arguments

  • wing::Wing: The wing to deform
  • theta_angles::AbstractVector: Twist angles in radians for each unrefined section (or nothing). Length must be n_unrefined_sections
  • delta_angles::AbstractVector: Trailing edge deflection angles in radians for each unrefined section (or nothing). Length must be n_unrefined_sections
  • smooth::Bool: DEPRECATED - no longer used. Apply smoothing to input angles if needed.

Algorithm

  1. Copies thetaangles and deltaangles directly to wing.thetadist and wing.deltadist
  2. Calls deform! to update wing geometry and propagate to refined sections

Errors

  • Throws ArgumentError if wing doesn't support deformation but angles are provided
  • Throws ArgumentError if angle vectors don't match nunrefinedsections

Returns

  • nothing (modifies wing in-place)
source