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)

Apply deformation angles defined per unrefined section.

Refined-section twist and TE-deflection values are computed by linear interpolation from the unrefined-section inputs using the precomputed refined_section_left_idx / refined_section_weight cache built at refinement time. Endpoint refined sections take the unrefined endpoint values exactly. The panel-level theta_dist / delta_dist arrays are then filled by averaging adjacent refined-section values, so downstream consumers (solver, body aerodynamics) see a per-panel value.

Arguments

  • wing::Wing: Wing to deform (must have nondeformedsections, populated by refine! for manual/YAML wings or by OBJ refinement for OBJ-based wings).
  • theta_angles::AbstractVector: Twist angles in radians, one per unrefined section. Pass nothing to leave twist unchanged.
  • delta_angles::AbstractVector: TE deflection angles in radians, one per unrefined section. Pass nothing to leave deflection unchanged.

Keyword arguments

  • smooth, smooth_window: accepted for backwards compatibility with callers of deform!, but ignored here — the linear interpolation between unrefined sections is already smooth, so no post-hoc smoothing is applied.
source