Skip to content

Commit 05b7ee6

Browse files
committed
Add horseshoe geometry to remorph!
1 parent 6f24e61 commit 05b7ee6

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

src/FLOWPanel_liftingline.jl

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ struct LiftingLine{ R<:Number,
5555
airfoil_distribution,
5656
args...;
5757
element_optargs=(),
58-
initial_aerocenters=1/4,
59-
initial_controlpoints=3/4,
58+
initial_aerodynamic_centers=1/4,
59+
initial_controlpoint_positions=3/4,
6060
initial_Vinf=[1, 0, 0],
6161
arraytype::Type=Array,
6262
optargs...
@@ -107,21 +107,18 @@ struct LiftingLine{ R<:Number,
107107
Gammas = VectorType(undef, nelements)
108108

109109
# ------------------ INITIALIZE SOLVER SETTINGS ------------------------
110-
aerocenters .= initial_aerocenters
110+
aerocenters .= initial_aerodynamic_centers
111111

112112
calc_horseshoes!(horseshoes, grid.nodes, linearindices, nelements,
113113
aerocenters)
114114

115115
calc_controlpoints!(controlpoints, grid.nodes, linearindices, nelements,
116-
initial_controlpoints)
116+
initial_controlpoint_positions)
117117

118118
calc_normals!(normals, controlpoints, horseshoes, nelements)
119119

120120
calc_Dinfs!(Dinfs, initial_Vinf, nelements)
121121

122-
# TODO: calc_Dinfs, and output horseshoes for verification, add normals for linear solver
123-
124-
125122

126123
new{R,
127124
eltype(elements),
@@ -143,13 +140,32 @@ end
143140
"""
144141
Morph the lifting-line wing geometry into a new geometry
145142
"""
146-
function remorph!(self::LiftingLine, args...; recenter=false, optargs...)
143+
function remorph!(self::LiftingLine, args...;
144+
recenter=false,
145+
aerodynamic_centers=1/4, controlpoint_positions=3/4,
146+
Vinf=[1, 0, 0],
147+
optargs...)
147148

149+
# Discretize parameterization
148150
(; b, ypositions, chords, twists,
149151
sweeps, dihedrals, spanaxiss, symmetric) = _discretize_wing_parameterization(args...; optargs...)
150152

153+
# Morph existing wing geometry into the new geometry
151154
_morph_grid_wing!(self.grid, b, ypositions, chords, twists, sweeps, dihedrals,
152155
spanaxiss, symmetric, self.linearindices; center=recenter)
156+
157+
# Update horseshoe geometries
158+
self.aerocenters .= aerocenters
159+
160+
calc_horseshoes!(self)
161+
162+
calc_controlpoints!(self, controlpoint_positions)
163+
164+
calc_normals!(self)
165+
166+
calc_Dinfs!(self, Vinf)
167+
168+
return nothing
153169
end
154170

155171

@@ -255,6 +271,7 @@ function calc_horseshoes!(self::LiftingLine, args...; optargs...)
255271
return calc_horseshoes!(self.horseshoes,
256272
self.grid.nodes, self.linearindices,
257273
self.nelements,
274+
self.aerocenters,
258275
args...; optargs...)
259276
end
260277

0 commit comments

Comments
 (0)