Functions for creating the geometry

VortexStepMethod.add_section!Function
add_section!(wing::Wing, LE_point::PosVector, TE_point::PosVector, 
             aero_model, aero_data::AeroData=nothing)

Add a new section to the wing.

Arguments:

  • wing::Wing: The Wing to which a section shall be added
  • LE_point::PosVector: PosVector of the point on the side of the leading edge
  • TE_point::PosVector: PosVector of the point on the side of the trailing edge
  • aero_model::AeroModel: AeroModel
  • aero_data::AeroData: See AeroData
source

Setting the inflow conditions and solving

VortexStepMethod.set_va!Function
set_va!(body_aero::BodyAerodynamics, va::VelVector, omega=zeros(MVec3))

Set velocity array and update wake filaments.

Arguments

  • body_aero::BodyAerodynamics: The BodyAerodynamics struct to modify
  • va::VelVector: Velocity vector of the apparent wind speed [m/s]
  • omega::VelVector: Turn rate vector around x y and z axis [rad/s]
source
CommonSolve.solveFunction
solve(solver::Solver, body_aero::BodyAerodynamics, gamma_distribution=nothing; 
      log=false, reference_point=zeros(MVec3))

Main solving routine for the aerodynamic model. Reference point is in the kite body (KB) frame. See also: solve!

Arguments:

  • solver::Solver: The solver to use, could be a VSM or LLT solver. See: Solver
  • body_aero::BodyAerodynamics: The aerodynamic body. See: BodyAerodynamics
  • gamma_distribution: Initial circulation vector or nothing; Length: Number of segments. [m²/s]

Keyword Arguments:

  • log=false: If true, print the number of iterations and other info.
  • reference_point=zeros(MVec3)

Returns

A dictionary with the results.

source
CommonSolve.solve!Function
solve!(solver::Solver, body_aero::BodyAerodynamics, gamma_distribution=solver.sol.gamma_distribution; 
      log=false, reference_point=zeros(MVec3), moment_frac=0.1)

Main solving routine for the aerodynamic model. Reference point is in the kite body (KB) frame. This version is modifying the solver.sol struct and is faster than the solve function which returns a dictionary.

Arguments:

  • solver::Solver: The solver to use, could be a VSM or LLT solver. See: Solver
  • body_aero::BodyAerodynamics: The aerodynamic body. See: BodyAerodynamics
  • gamma_distribution: Initial circulation vector or nothing; Length: Number of segments. [m²/s]

Keyword Arguments:

  • log=false: If true, print the number of iterations and other info.
  • reference_point=zeros(MVec3)
  • moment_frac=0.1: X-coordinate of normalized panel around which the moment distribution should be calculated.

Returns

The solution of type VSMSolution

source
VortexStepMethod.init!Method
init!(body_aero::BodyAerodynamics; init_aero, va, omega)

Initialize a BodyAerodynamics struct in-place by setting up panels and coefficients.

Arguments

  • body_aero::BodyAerodynamics: The structure to initialize

Keyword Arguments

  • init_aero::Bool: Wether to initialize the aero data or not
  • va=[15.0, 0.0, 0.0]: Apparent wind vector
  • omega=zeros(3): Turn rate in kite body frame x y and z

Returns

nothing

source
VortexStepMethod.linearizeFunction
linearize(solver::Solver, body_aero::BodyAerodynamics, wing::RamAirWing, y::Vector{T}; 
    theta_idxs=1:4, delta_idxs=nothing, va_idxs=nothing, omega_idxs=nothing, kwargs...) where T

Compute the Jacobian matrix for a ram air wing around an operating point using finite differences.

Arguments

  • solver: VSM solver instance (must be initialized)
  • body_aero: Aerodynamic body representation
  • wing: RamAirWing model to linearize
  • y: Input vector at operating point, containing a combination of control angles and velocities

Keyword Arguments

  • theta_idxs: Indices of twist angles in input vector (default: 1:4)
  • delta_idxs: Indices of trailing edge deflection angles (default: nothing)
  • va_idxs: Indices of velocity components [vx, vy, vz] (default: nothing)
  • omega_idxs: Indices of angular velocity components [ωx, ωy, ωz] (default: nothing)
  • kwargs...: Additional arguments passed to the solve! function

Returns

  • jac: Jacobian matrix (∂outputs/∂inputs)
  • results: Output vector at the operating point [Fx, Fy, Fz, Mx, My, Mz, group_moments...]

Example

# Initialize wing and solver
wing = RamAirWing("path/to/body.obj", "path/to/foil.dat")
body_aero = BodyAerodynamics([wing])
solver = Solver(body_aero)

# Define operating point with 4 control angles, velocity, and angular rates
y_op = [zeros(4);        # 4 twist control angles (rad)
       [15.0, 0.0, 0.0]; # Velocity vector (m/s)
       zeros(3)]         # Angular velocity (rad/s)

# Compute Jacobian
jac, results = linearize(
    solver, body_aero, wing, y_op;
    theta_idxs=1:4,      # Twist angles
    va_idxs=5:7,         # Velocity components
    omega_idxs=8:10      # Angular rates
)
source

Main Plotting Functions

The plotting functions are implemented as package extension. This means that they are only available if the package ControlPlots.jl was loaded BEFORE loading VortexStepMethod.jl.

VortexStepMethod.plot_geometryFunction
plot_geometry(body_aero::BodyAerodynamics, title; 
              data_type=".pdf", save_path=nothing, 
              is_save=false, is_show=false, 
              view_elevation=15, view_azimuth=-120, use_tex=false)

Plot wing geometry from different viewpoints and optionally save/show plots.

Arguments:

Keyword arguments:

  • data_type`: string with the file type postfix (default: ".pdf")
  • save_path: path for saving the graphic (default: nothing)
  • is_save: boolean value, indicates if the graphic shall be saved (default: false)
  • is_show: boolean value, indicates if the graphic shall be displayed (default: false)
  • view_elevation: initial view elevation angle (default: 15) [°]
  • view_azimuth: initial view azimuth angle (default: -120) [°]
  • use_tex: if the external pdflatex command shall be used (default: false)
source
VortexStepMethod.plot_distributionFunction
plot_distribution(y_coordinates_list, results_list, label_list;  
                  title="spanwise_distribution", data_type=".pdf",
                  save_path=nothing, is_save=false, is_show=true, use_tex=false)

Plot spanwise distributions of aerodynamic properties.

Arguments

  • y_coordinates_list: List of spanwise coordinates
  • results_list: List of result dictionaries
  • label_list: List of labels for different results

Keyword arguments

  • title: Plot title (default: "spanwise_distribution")
  • data_type: File extension for saving (default: ".pdf")
  • save_path: Path to save plots (default: nothing)
  • is_save: Whether to save plots (default: false)
  • is_show: Whether to display plots (default: true)
  • use_tex: if the external pdflatex command shall be used
source
VortexStepMethod.plot_polarsFunction
plot_polars(solver_list, body_aero_list, label_list;
            literature_path_list=String[], 
            angle_range=range(0, 20, 2), angle_type="angle_of_attack", 
            angle_of_attack=0.0, side_slip=0.0, v_a=10.0, 
            title="polar", data_type=".pdf", save_path=nothing, 
            is_save=true, is_show=true, use_tex=false)

Plot polar data comparing different solvers and configurations.

Arguments

  • solver_list: List of aerodynamic solvers
  • body_aero_list: List of wing aerodynamics objects
  • label_list: List of labels for each configuration

Keyword arguments

  • literature_path_list: Optional paths to literature data files
  • angle_range: Range of angles to analyze [°]
  • angle_type: "angle_of_attack" or "side_slip"; (default: angle_of_attack)
  • angle_of_attack: AoA to be used for plotting the polars (default: 0.0) [rad]
  • side_slip: side slip angle (default: 0.0) [rad]
  • v_a: norm of apparent wind speed (default: 10.0) [m/s]
  • title: plot title
  • data_type: File extension for saving (default: ".pdf")
  • save_path: Path to save plots (default: nothing)
  • is_save: Whether to save plots (default: true)
  • is_show: Whether to display plots (default: true)
  • use_tex: if the external pdflatex command shall be used (default: false)
source

Helper Functions

VortexStepMethod.save_plotFunction
save_plot(fig, save_path, title; data_type=".pdf")

Save a plot to a file.

Arguments

  • fig: Plots figure object
  • save_path: Path to save the plot
  • title: Title of the plot

Keyword arguments

  • data_type: File extension (default: ".pdf")
source
VortexStepMethod.show_plotFunction
show_plot(fig; dpi=130)

Display a plot at specified DPI.

Arguments

  • fig: Plots figure object

Keyword arguments

  • dpi: Dots per inch for the figure (default: 130)
source