API Reference
This page provides the automatically generated API documentation for the lightaero library.
lightaero
aerodynamics
Aerodynamics discipline subpackage for lightaero.
Provides VLM and aeroelastic solvers. See: docs/theory/aerodynamics.md
AerostructDiscipline
Bases: DisciplineBase
Static aeroelastic discipline: VLM coupled to Euler-Bernoulli beam.
See: docs/theory/aerodynamics.md
Source code in src/lightaero/aerodynamics/aeroelastic.py
__call__(**inputs)
Evaluate the coupled aerostructural discipline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**inputs
|
Any
|
Named physical quantities in SI units. wing (WingGeometry): Undeformed wing geometry. alpha_rad (float): Angle of attack in radians. altitude_m (float): Altitude in metres. MTOW_kg (float): Maximum take-off weight in kg. V_ms (float) | M (float): Freestream speed or Mach number (not both). |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
AerostructOutput |
AerostructOutput
|
Combined results including aero, struct, n_iter, and converged status. |
Source code in src/lightaero/aerodynamics/aeroelastic.py
AerostructOutput
dataclass
Combined aerostructural result from AerostructDiscipline.
Attributes:
| Name | Type | Description |
|---|---|---|
aero |
AeroOutput
|
Final AeroOutput (CL, CDi, CM, lift_N, drag_N, span_cl, span_load, span_drag) from the last VLM evaluation. |
struct |
StructuralOutput
|
Final StructuralOutput (tip_deflection_m, root_stress_Pa, wing_mass_kg, oew_kg, span_deflection, tip_twist_rad, span_twist) from the last structural evaluation. |
n_iter |
int
|
Number of coupling iterations performed. |
converged |
bool
|
True if convergence criterion was met before _MAX_ITER. |
Source code in src/lightaero/aerodynamics/aeroelastic.py
VLMDiscipline
Bases: DisciplineBase
Low-fidelity VLM aerodynamics discipline.
See: docs/theory/aerodynamics.md
Note
Inputs: wing (WingGeometry), alpha_rad (float), V_ms (float), altitude_m (float). Returns: AeroOutput TypedDict. AIC matrix is cached based on geometry hash.
Source code in src/lightaero/aerodynamics/solver.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
__call__(**inputs)
Evaluate VLM aerodynamics at the given flight condition.
See: docs/theory/aerodynamics.md
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**inputs
|
Any
|
wing, alpha_rad, V_ms (or M), altitude_m. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
AeroOutput |
AeroOutput
|
Validated results. |
Source code in src/lightaero/aerodynamics/solver.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
aeroelastic
Aeroelastic discipline: coupled VLM + Euler-Bernoulli beam iteration.
Iterates VLM and structural solvers to predict spanwise deflection and twist. See: docs/theory/aerodynamics.md
AerostructDiscipline
Bases: DisciplineBase
Static aeroelastic discipline: VLM coupled to Euler-Bernoulli beam.
See: docs/theory/aerodynamics.md
Source code in src/lightaero/aerodynamics/aeroelastic.py
__call__(**inputs)
Evaluate the coupled aerostructural discipline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**inputs
|
Any
|
Named physical quantities in SI units. wing (WingGeometry): Undeformed wing geometry. alpha_rad (float): Angle of attack in radians. altitude_m (float): Altitude in metres. MTOW_kg (float): Maximum take-off weight in kg. V_ms (float) | M (float): Freestream speed or Mach number (not both). |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
AerostructOutput |
AerostructOutput
|
Combined results including aero, struct, n_iter, and converged status. |
Source code in src/lightaero/aerodynamics/aeroelastic.py
AerostructOutput
dataclass
Combined aerostructural result from AerostructDiscipline.
Attributes:
| Name | Type | Description |
|---|---|---|
aero |
AeroOutput
|
Final AeroOutput (CL, CDi, CM, lift_N, drag_N, span_cl, span_load, span_drag) from the last VLM evaluation. |
struct |
StructuralOutput
|
Final StructuralOutput (tip_deflection_m, root_stress_Pa, wing_mass_kg, oew_kg, span_deflection, tip_twist_rad, span_twist) from the last structural evaluation. |
n_iter |
int
|
Number of coupling iterations performed. |
converged |
bool
|
True if convergence criterion was met before _MAX_ITER. |
Source code in src/lightaero/aerodynamics/aeroelastic.py
aic
AIC matrix assembly for VLM with Rankine core regularisation.
See: docs/theory/aerodynamics.md
assemble_aic(mesh, epsilon)
Assemble the AIC matrix for a PanelMesh.
See: docs/theory/aerodynamics.md
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mesh
|
PanelMesh
|
PanelMesh object. |
required |
epsilon
|
float
|
Rankine core fraction. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
AIC |
ndarray
|
Aerodynamic Influence Coefficient matrix. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If condition number of AIC exceeds 1e8. |
Source code in src/lightaero/aerodynamics/aic.py
assemble_aic_kernel(xA, yA, zA, xB, yB, zB, xC, yC, zC, nx, ny, nz, epsilon, u_inf_x, u_inf_y, u_inf_z)
Assemble AIC matrix kernel via explicit double loop.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xA
|
ndarray
|
Inboard bound vortex x-endpoints, shape (n,). |
required |
yA
|
ndarray
|
Inboard bound vortex y-endpoints, shape (n,). |
required |
zA
|
ndarray
|
Inboard bound vortex z-endpoints, shape (n,). |
required |
xB
|
ndarray
|
Outboard bound vortex x-endpoints, shape (n,). |
required |
yB
|
ndarray
|
Outboard bound vortex y-endpoints, shape (n,). |
required |
zB
|
ndarray
|
Outboard bound vortex z-endpoints, shape (n,). |
required |
xC
|
ndarray
|
Control point x-coordinates, shape (n,). |
required |
yC
|
ndarray
|
Control point y-coordinates, shape (n,). |
required |
zC
|
ndarray
|
Control point z-coordinates, shape (n,). |
required |
nx
|
ndarray
|
Unit normal x-components, shape (n,). |
required |
ny
|
ndarray
|
Unit normal y-components, shape (n,). |
required |
nz
|
ndarray
|
Unit normal z-components, shape (n,). |
required |
epsilon
|
float
|
Rankine core fraction. |
required |
u_inf_x
|
float
|
Freestream unit direction x-component. |
required |
u_inf_y
|
float
|
Freestream unit direction y-component. |
required |
u_inf_z
|
float
|
Freestream unit direction z-component. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: AIC matrix of shape (n, n). |
Source code in src/lightaero/aerodynamics/aic.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | |
build_rhs(mesh, alpha_rad, V_ms=1.0)
Build the right-hand side vector for the VLM linear system.
See: docs/theory/aerodynamics.md
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mesh
|
PanelMesh
|
PanelMesh with unit normals. |
required |
alpha_rad
|
float | ndarray
|
Angle of attack (radians). |
required |
V_ms
|
float
|
Freestream speed (m/s). |
1.0
|
Returns:
| Name | Type | Description |
|---|---|---|
RHS |
ndarray
|
shape (n_panels,). |
Source code in src/lightaero/aerodynamics/aic.py
force
Aerodynamic force integration for VLM.
See: docs/theory/aerodynamics.md
near_field_forces(mesh, gamma, rho, V_ms, S_ref, alpha_rad)
Compute near-field aerodynamic forces and coefficients.
See: docs/theory/aerodynamics.md
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mesh
|
PanelMesh
|
Panel mesh object. |
required |
gamma
|
ndarray
|
Circulation strengths. |
required |
rho
|
float
|
Air density. |
required |
V_ms
|
float
|
Freestream speed. |
required |
S_ref
|
float
|
Reference area. |
required |
alpha_rad
|
float | ndarray
|
Angle of attack in radians. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple
|
(CL, CDi_kj, CM, lift_N, drag_N, span_cl, span_load, span_drag) |
Source code in src/lightaero/aerodynamics/force.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
profile_drag_cd0(rho, V_ms, T_K, S_ref, y_cp_half, chord_cp_half, tc_cp_half)
Profile drag coefficient via turbulent flat-plate strip theory.
See: docs/theory/aerodynamics.md
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rho
|
float
|
Air density (kg/m³). |
required |
V_ms
|
float
|
Freestream speed (m/s). |
required |
T_K
|
float
|
Static temperature (K) for Sutherland viscosity. |
required |
S_ref
|
float
|
Reference wing area (m²). |
required |
y_cp_half
|
ndarray
|
Spanwise CP positions for the right semi-span, shape (n_half,). |
required |
chord_cp_half
|
ndarray
|
Chord at each CP, shape (n_half,). |
required |
tc_cp_half
|
ndarray
|
Thickness-to-chord ratio at each CP, shape (n_half,). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
CD0 |
float
|
Total zero-lift profile drag coefficient (dimensionless). |
Source code in src/lightaero/aerodynamics/force.py
trefftz_cdi(mesh, gamma, V_ms, S_ref)
Compute induced drag in the Trefftz plane.
See: docs/theory/aerodynamics.md
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mesh
|
PanelMesh
|
Panel mesh object. |
required |
gamma
|
ndarray
|
Circulation strengths. |
required |
V_ms
|
float
|
Freestream speed. |
required |
S_ref
|
float
|
Reference area. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
CDi_tp |
float
|
Induced drag coefficient. |
Source code in src/lightaero/aerodynamics/force.py
panel_mesh
Panel mesh generation for VLM aerodynamic analysis.
See: docs/theory/aerodynamics.md
PanelMesh
dataclass
3D panel mesh for VLM analysis.
See: docs/theory/aerodynamics.md
Attributes:
| Name | Type | Description |
|---|---|---|
n_panels |
int
|
Total panel count (int). |
xA, |
(yA, zA)
|
Bound vortex A-endpoint (inboard node) at quarter-chord. |
xB, |
(yB, zB)
|
Bound vortex B-endpoint (outboard node) at quarter-chord. |
xC, |
(yC, zC)
|
Control point (collocation point) at three-quarter-chord. |
nx, |
(ny, nz)
|
Unit normal at each control point. |
chord_cp |
ndarray
|
Chord length at each control-point. |
y_cp |
ndarray
|
Spanwise CP coordinate. |
S_ref |
float
|
Full planform reference area. |
Note
All computation here is pure Python/NumPy. No @numba.njit functions are used in panel geometry. Extract array fields explicitly if passing to compiled functions.
Source code in src/lightaero/aerodynamics/panel_mesh.py
build_panel_mesh(wing)
Convert WingGeometry into a full-span 3D PanelMesh.
See: docs/theory/aerodynamics.md
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wing
|
WingGeometry
|
Frozen WingGeometry from build_wing_geometry(). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PanelMesh |
PanelMesh
|
The generated mesh. |
Source code in src/lightaero/aerodynamics/panel_mesh.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | |
solver
VLM discipline wrapper: VLMDiscipline.
See: docs/theory/aerodynamics.md
VLMDiscipline
Bases: DisciplineBase
Low-fidelity VLM aerodynamics discipline.
See: docs/theory/aerodynamics.md
Note
Inputs: wing (WingGeometry), alpha_rad (float), V_ms (float), altitude_m (float). Returns: AeroOutput TypedDict. AIC matrix is cached based on geometry hash.
Source code in src/lightaero/aerodynamics/solver.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
__call__(**inputs)
Evaluate VLM aerodynamics at the given flight condition.
See: docs/theory/aerodynamics.md
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**inputs
|
Any
|
wing, alpha_rad, V_ms (or M), altitude_m. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
AeroOutput |
AeroOutput
|
Validated results. |
Source code in src/lightaero/aerodynamics/solver.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
atmosphere
isa
ISA atmosphere model (ISO 2533 / ICAO Doc 7488).
See: docs/theory/atmosphere.md
isa(altitude_m)
ISA atmosphere at the given altitude above MSL.
See: docs/theory/atmosphere.md
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
altitude_m
|
float
|
Geometric altitude in metres. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[float, float, float, float]
|
(rho, T, p, a) |
Source code in src/lightaero/atmosphere/isa.py
geometry
build_crm_geometry(n_panels=40)
Build NASA CRM wing geometry (trapezoidal approximation).
Source code in src/lightaero/geometry/crm.py
build_dlrf4_geometry(n_panels=40)
Return the DLR-F4 isolated wing as a WingGeometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_panels
|
int
|
Number of semi-span VLM panels. |
40
|
Returns:
| Type | Description |
|---|---|
WingGeometry
|
Frozen WingGeometry with DLR-F4 trapezoidal planform. |
Source code in src/lightaero/geometry/dlrf4.py
build_dlrf6_geometry(n_panels=40)
Return the DLR-F6 isolated wing as a WingGeometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_panels
|
int
|
Number of semi-span VLM panels. |
40
|
Returns:
| Type | Description |
|---|---|
WingGeometry
|
Frozen WingGeometry with DLR-F6 cranked trapezoidal planform. |
Source code in src/lightaero/geometry/dlrf6.py
build_ucrm_geometry(n_panels=40)
Build uCRM geometry (jig/unmodified).
Source code in src/lightaero/geometry/ucrm.py
airfoil
Airfoil section primitives for Foundation.
See: docs/theory/index.md for detailed NACA equations and interpolation logic.
AirfoilSection
dataclass
Airfoil section with camber and thickness query methods.
See: docs/theory/index.md for theoretical background and NACA parsing details.
Source code in src/lightaero/geometry/airfoil.py
camber_at(x_over_c)
Camberline ordinate z_c/c at chordwise positions x/c.
Source code in src/lightaero/geometry/airfoil.py
from_naca4(designation)
classmethod
Construct from NACA 4-digit string, e.g. '2412'.
Source code in src/lightaero/geometry/airfoil.py
get_profile(n_points=50)
Return (x, z) coordinates for a closed profile, normalized to chord=1.
Source code in src/lightaero/geometry/airfoil.py
thickness_at(x_over_c)
Full thickness t/c at chordwise positions x/c.
Source code in src/lightaero/geometry/airfoil.py
blended_profile(y_query, y_stations, sections, n_points)
Linearly blend normalized airfoil profiles between two spanwise stations.
Source code in src/lightaero/geometry/airfoil.py
interpolate_camber(y_query, y_stations, sections, x_over_c)
Linear interpolation of camberline ordinates between spanwise stations.
See: docs/theory/index.md for the blending formula.
Source code in src/lightaero/geometry/airfoil.py
load_uiuc_dat(path)
Load airfoil coordinates from a UIUC .dat file (Selig or Lednicer format).
See: docs/theory/index.md for format details.
Source code in src/lightaero/geometry/airfoil.py
naca4_camber(x, M, P)
NACA 4-digit camberline ordinate z_c/c.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
ndarray
|
Chordwise stations x/c in [0, 1]. |
required |
M
|
float
|
Maximum camber as fraction of chord. |
required |
P
|
float
|
Chordwise position of maximum camber. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Camberline ordinate z_c/c. |
Source code in src/lightaero/geometry/airfoil.py
naca4_thickness(x, T)
NACA 4-digit half-thickness distribution t/c.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
ndarray
|
Chordwise stations x/c in [0, 1]. |
required |
T
|
float
|
Maximum thickness as fraction of chord. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Half-thickness t/c. Full thickness = 2 * returned value. |
Source code in src/lightaero/geometry/airfoil.py
crm
NASA Common Research Model (CRM) isolated wing geometry builder.
See: docs/theory/index.md for CRM planform parameters and references.
build_crm_geometry(n_panels=40)
Build NASA CRM wing geometry (trapezoidal approximation).
Source code in src/lightaero/geometry/crm.py
dlrf4
DLR-F4 isolated wing geometry builder.
See: docs/theory/index.md for DLR-F4 planform parameters and references.
build_dlrf4_geometry(n_panels=40)
Return the DLR-F4 isolated wing as a WingGeometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_panels
|
int
|
Number of semi-span VLM panels. |
40
|
Returns:
| Type | Description |
|---|---|
WingGeometry
|
Frozen WingGeometry with DLR-F4 trapezoidal planform. |
Source code in src/lightaero/geometry/dlrf4.py
dlrf6
DLR-F6 isolated wing geometry builder.
See: docs/theory/index.md for DLR-F6 planform parameters and references.
build_dlrf6_geometry(n_panels=40)
Return the DLR-F6 isolated wing as a WingGeometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_panels
|
int
|
Number of semi-span VLM panels. |
40
|
Returns:
| Type | Description |
|---|---|
WingGeometry
|
Frozen WingGeometry with DLR-F6 cranked trapezoidal planform. |
Source code in src/lightaero/geometry/dlrf6.py
ucrm
NASA uCRM isolated wing geometry builder.
See: docs/theory/index.md for uCRM planform parameters and references.
build_ucrm_geometry(n_panels=40)
Build uCRM geometry (jig/unmodified).
Source code in src/lightaero/geometry/ucrm.py
wing
Parametric wing geometry.
See: docs/theory/index.md for parametric wing construction and cosine spacing details.
WingGeometry
dataclass
Parametric wing geometry with cosine-spaced panel arrays.
See: docs/theory/index.md for detailed field descriptions and mathematical foundations.
Attributes:
| Name | Type | Description |
|---|---|---|
half_span |
float
|
Semi-span in metres. |
n_panels |
int
|
Number of spanwise panels. |
y_stations |
ndarray
|
Spanwise break positions. |
chord |
ndarray
|
Chord lengths at each station. |
sweep_le |
ndarray
|
Leading-edge sweep angles (rad). |
taper |
ndarray
|
Local taper ratios. |
twist |
ndarray
|
Geometric twist angles (rad). |
airfoil_sections |
tuple
|
Tuple of AirfoilSection objects. |
deflection_z |
ndarray
|
Transverse nodal displacements (m). |
Source code in src/lightaero/geometry/wing.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
__post_init__()
Compute derived arrays and lock all arrays as read-only.
Source code in src/lightaero/geometry/wing.py
get_wing_coordinates(n_profile_points=50)
Return scaled and twisted airfoil coordinates at each control point.
plot_wing_3d(n_profile_points=50, alpha_deg=0.0, colorscale='Blues', show_sections=True, show_panels=False, save_dir=None, show_grid=False, pov=None)
Render a 3D visualization of the wing using Plotly.
Source code in src/lightaero/geometry/wing.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
build_wing_geometry(half_span, n_panels, y_stations, chord, sweep_le, taper, twist, airfoil_sections, deflection_z=None)
Factory for WingGeometry with input validation.
See: docs/theory/index.md for geometric constraints and validation rules.
Source code in src/lightaero/geometry/wing.py
registry
Fidelity plugin registry subpackage for lightaero.
Exposes DISCIPLINE_REGISTRY, register, get_discipline, and DisciplineBase so that discipline modules can import from lightaero.registry directly:
from lightaero.registry import register, DisciplineBase, DISCIPLINE_REGISTRY
DisciplineBase
Bases: ABC
Abstract base class for all lightaero discipline implementations.
Enforces the black-box callable interface: discipline(inputs: dict) -> TypedDict
See: docs/theory/index.md
Source code in src/lightaero/registry/registry.py
__call__(**inputs)
abstractmethod
Evaluate the discipline at the given inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**inputs
|
Any
|
Named physical quantities in SI units. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
Results of the evaluation (e.g. AeroOutput, StructuralOutput). |
Source code in src/lightaero/registry/registry.py
get_discipline(family, key)
Retrieve a discipline class from the registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
family
|
str
|
Discipline family (e.g. 'aero'). |
required |
key
|
str
|
Implementation key (e.g. 'vlm'). |
required |
Returns:
| Type | Description |
|---|---|
type
|
The registered class. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If family or key is not found. |
Source code in src/lightaero/registry/registry.py
register(family, key)
Decorator factory for two-level namespace registration.
Registers the decorated class into DISCIPLINE_REGISTRY[family][key].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
family
|
str
|
Discipline family string (e.g. 'aero', 'structures'). |
required |
key
|
str
|
Fidelity/implementation key (e.g. 'vlm', 'low_fi'). |
required |
Returns:
| Type | Description |
|---|---|
Callable[[type], type]
|
Callable[[type], type]: Decorator that registers the class and returns it unchanged. |
Source code in src/lightaero/registry/registry.py
registry
Fidelity plugin registry for lightaero disciplines.
Provides a two-level namespace registry (family -> key -> class) so that discipline implementations can be swapped by string key without modifying coupling logic.
See: docs/theory/index.md
DisciplineBase
Bases: ABC
Abstract base class for all lightaero discipline implementations.
Enforces the black-box callable interface: discipline(inputs: dict) -> TypedDict
See: docs/theory/index.md
Source code in src/lightaero/registry/registry.py
__call__(**inputs)
abstractmethod
Evaluate the discipline at the given inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**inputs
|
Any
|
Named physical quantities in SI units. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
Results of the evaluation (e.g. AeroOutput, StructuralOutput). |
Source code in src/lightaero/registry/registry.py
get_discipline(family, key)
Retrieve a discipline class from the registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
family
|
str
|
Discipline family (e.g. 'aero'). |
required |
key
|
str
|
Implementation key (e.g. 'vlm'). |
required |
Returns:
| Type | Description |
|---|---|
type
|
The registered class. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If family or key is not found. |
Source code in src/lightaero/registry/registry.py
register(family, key)
Decorator factory for two-level namespace registration.
Registers the decorated class into DISCIPLINE_REGISTRY[family][key].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
family
|
str
|
Discipline family string (e.g. 'aero', 'structures'). |
required |
key
|
str
|
Fidelity/implementation key (e.g. 'vlm', 'low_fi'). |
required |
Returns:
| Type | Description |
|---|---|
Callable[[type], type]
|
Callable[[type], type]: Decorator that registers the class and returns it unchanged. |
Source code in src/lightaero/registry/registry.py
schemas
types
Output schemas and companion runtime spec dicts.
These schemas define the inter-discipline data contract for lightaero.
See: docs/theory/index.md
validation
Runtime validator for discipline output dicts.
See: docs/theory/index.md
check_regime_validity(mach, aoa_rad)
Check if flight condition is within standard VLM validity bounds.
Issues UserWarning if: - Mach > 0.3 (incompressible limit) - |AoA| > 10 degrees (linear lift limit)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mach
|
float
|
Mach number. |
required |
aoa_rad
|
float
|
Angle of attack in radians. |
required |
Source code in src/lightaero/schemas/validation.py
validate_discipline_output(output, spec)
Runtime validation of a discipline output dict against a spec.
Checks key presence, type correctness, array shape, and plausibility bounds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
Any
|
Object (dataclass) returned by a discipline's call method. |
required |
spec
|
dict
|
Companion spec dict (e.g. AERO_OUTPUT_SPEC). |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
Missing required key, wrong array shape, or out-of-bounds value. |
TypeError
|
Wrong Python type for a field. |
Source code in src/lightaero/schemas/validation.py
structures
Structural discipline subpackage for lightaero.
See: docs/theory/structures.md
beam
Euler-Bernoulli beam FEM kernel.
See: docs/theory/structures.md
beam_section_properties(y_nodes, chord_nodes, tc_ratio_nodes, E_Pa=73100000000.0, G_Pa=28000000000.0, t_sk_array=None)
Thin-walled wingbox section properties via numerical integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y_nodes
|
ndarray
|
Spanwise node positions (m). |
required |
chord_nodes
|
ndarray
|
Chord at each node (m). |
required |
tc_ratio_nodes
|
ndarray
|
t/c ratio at each node. |
required |
E_Pa
|
float
|
Young's modulus (Pa). |
73100000000.0
|
G_Pa
|
float
|
Shear modulus (Pa). |
28000000000.0
|
t_sk_array
|
ndarray | None
|
Optional skin thickness at each node (m). |
None
|
Returns:
| Type | Description |
|---|---|
(EI_xx, EI_zz, GJ, h_max, w_box, I_xx, I_zz, A_e, x_sc)
|
each shape (n,). |
Source code in src/lightaero/structures/beam.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | |
build_bending_loads(y_nodes, q_nodes)
Build FEM load vector for bending.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y_nodes
|
ndarray
|
Spanwise node positions (m). |
required |
q_nodes
|
ndarray
|
Distributed transverse load (N/m). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
F |
ndarray
|
Load vector (N and N·m). |
Source code in src/lightaero/structures/beam.py
build_torsion_loads(y_nodes, t_nodes)
Build FEM load vector for torsion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y_nodes
|
ndarray
|
Spanwise node positions (m). |
required |
t_nodes
|
ndarray
|
Distributed torque (N·m/m). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
T |
ndarray
|
Load vector (N·m). |
Source code in src/lightaero/structures/beam.py
compute_combined_stress(y_nodes, w_full, u_full, EI_xx, EI_zz, h, w, I_xx, I_zz, phi_full=None, GJ=None, A_e=None, t_sk=None)
Von Mises stress at each spanwise node.
See: docs/theory/structures.md
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y_nodes
|
ndarray
|
Spanwise node positions (m). |
required |
w_full
|
ndarray
|
Bending DOF vector (vertical). |
required |
u_full
|
ndarray
|
Bending DOF vector (lateral). |
required |
EI_xx
|
ndarray
|
Bending stiffness array about xx. |
required |
EI_zz
|
ndarray
|
Bending stiffness array about zz. |
required |
h
|
ndarray
|
Section height at each node (m). |
required |
w
|
ndarray
|
Section width at each node (m). |
required |
I_xx
|
ndarray
|
Second moment of area about xx (m^4). |
required |
I_zz
|
ndarray
|
Second moment of area about zz (m^4). |
required |
phi_full
|
ndarray | None
|
Torsion DOF vector. Optional. |
None
|
GJ
|
ndarray | None
|
Torsional stiffness array. Optional. |
None
|
A_e
|
ndarray | None
|
Enclosed wingbox area at each node (m²). Optional. |
None
|
t_sk
|
ndarray | None
|
Skin thickness at each node (m). Optional. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: Von Mises stress at each node (Pa). |
Source code in src/lightaero/structures/beam.py
size_skin_thickness(y_nodes, chord_nodes, tc_ratio_nodes, q_z_nodes, sigma_yield=324000000.0, SF=1.5, t_sk_min=0.001)
Size wing skin thickness to satisfy bending stress allowable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y_nodes
|
ndarray
|
Spanwise node positions (m). |
required |
chord_nodes
|
ndarray
|
Chord length at each node (m). |
required |
tc_ratio_nodes
|
ndarray
|
t/c ratio at each node. |
required |
q_z_nodes
|
ndarray
|
Distributed vertical load (N/m) at each node. |
required |
sigma_yield
|
float
|
Tensile yield stress (Pa). |
324000000.0
|
SF
|
float
|
Safety factor. |
1.5
|
t_sk_min
|
float
|
Minimum skin thickness (m). |
0.001
|
Returns:
| Name | Type | Description |
|---|---|---|
t_sk |
ndarray
|
Sized skin thickness at each node (m). |
Source code in src/lightaero/structures/beam.py
solve_bending_beam(y_nodes, EI, F)
Solve FEM beam bending equations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y_nodes
|
ndarray
|
Spanwise node positions (m). |
required |
EI
|
ndarray
|
Bending stiffness at nodes (N·m²). |
required |
F
|
ndarray
|
Load vector. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
d |
ndarray
|
Displacement vector (m and rad). |
Source code in src/lightaero/structures/beam.py
solve_torsion_beam(y_nodes, GJ, T)
Solve FEM beam torsion equations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y_nodes
|
ndarray
|
Spanwise node positions (m). |
required |
GJ
|
ndarray
|
Torsional stiffness at nodes (N·m²). |
required |
T
|
ndarray
|
Torque load vector (N·m). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
phi |
ndarray
|
Twist angle vector (rad). |
Source code in src/lightaero/structures/beam.py
mass
Wing structural mass integration and OEW empirical estimation.
See: docs/theory/structures.md
estimate_oew(MTOW_kg, wing_mass_kg, S_ref_m2=None)
Estimate operating empty weight using Roskam log-linear regression.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
MTOW_kg
|
float
|
Maximum take-off weight (kg). |
required |
wing_mass_kg
|
float
|
Wing structural mass (kg). |
required |
S_ref_m2
|
float | None
|
Reference wing area (m²). |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
OEW |
float
|
Estimated operating empty weight (kg). |
Source code in src/lightaero/structures/mass.py
wing_structural_mass(y_nodes, t_sk, h, w, rho_mat=2780.0, k_struct=1.5)
Integrated wing structural mass.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y_nodes
|
ndarray
|
Spanwise node positions (m). |
required |
t_sk
|
ndarray
|
Skin thickness at each node (m). |
required |
h
|
ndarray
|
Section height at each node (m). |
required |
w
|
ndarray
|
Section width at each node (m). |
required |
rho_mat
|
float
|
Material density (kg/m³). |
2780.0
|
k_struct
|
float
|
Structural mass factor. |
1.5
|
Returns:
| Name | Type | Description |
|---|---|---|
mass |
float
|
Total wing mass (kg). |
Source code in src/lightaero/structures/mass.py
solver
StructuralDiscipline: compose beam.py and mass.py into a single discipline call.