@@ -148,27 +148,38 @@ function load_polar_data(csv_file_path::String)
148148end
149149
150150"""
151- # Module: yaml_geometry.jl
151+ Wing(geometry_file::String; n_panels=20, n_groups=1, spanwise_distribution=LINEAR,
152+ spanwise_direction=[0.0, 1.0, 0.0], remove_nan=true, prn=false)
152153
153- This module provides functionality for parsing and handling geometry data from YAML files.
154- It is intended for use within the VortexStepMethod.jl package to facilitate the import,
155- validation, and manipulation of geometric configurations specified in YAML format.
154+ Constructs a `Wing` object from a YAML geometry file.
156155
157- Functions and types in this module allow users to:
158- - Load geometry definitions from YAML files.
159- - Convert YAML data into Julia-native structures.
160- - Validate the integrity and consistency of imported geometry data.
156+ # Arguments
157+ - `geometry_file::String`: Path to a YAML file describing the wing geometry and airfoils.
158+
159+ # Keyword Arguments
160+ - `n_panels::Int`: Number of spanwise panels (default: 20).
161+ - `n_groups::Int`: Number of grouped sections across the span (default: 1). Must divide `n_panels`.
162+ - `spanwise_distribution`: Spanwise panel distribution type (default: `LINEAR`).
163+ - `spanwise_direction::Vector{Float64}`: Direction of the spanwise axis (default: `[0.0, 1.0, 0.0]`). Must be the global Y axis.
164+ - `remove_nan::Bool`: Remove NaN values from the geometry (default: `true`).
165+ - `prn::Bool`: Print informational messages during construction (default: `false`).
166+
167+ # Returns
168+ - `Wing`: A fully constructed and initialized `Wing` object.
161169
162- Typical use cases include reading wing or blade geometry for aerodynamic simulations.
170+ # Description
171+ This function reads a YAML configuration file to define the geometry and airfoil data for a multi-section wing.
172+ Each section and corresponding airfoil is parsed from the YAML file, polar data is loaded, and each section is added
173+ to the wing. The geometry logic currently assumes the spanwise direction is `[0.0, 1.0, 0.0]` (aligned with the global Y axis).
163174
164- # Example
165- ```julia
166- geometry = load_yaml_geometry("geometry.yaml")
167- ```
175+ # Errors
176+ - Throws an `ArgumentError` if `n_panels` is not divisible by `n_groups`.
177+ - Throws an `ArgumentError` if `spanwise_direction` is not `[0.0, 1.0, 0.0]`.
168178
169- # See Also
170- - [`YAML`](@ref)
171- - [`VortexStepMethod`](@ref)
179+ # Example
180+ ```julia
181+ wing = Wing("wing_geometry.yaml"; n_panels=30, n_groups=2, prn=true)
182+ ```
172183"""
173184function Wing (
174185 geometry_file:: String ;
0 commit comments