Skip to content

Commit

Permalink
Merge branch 'hotfix-2.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
camUrban committed Apr 11, 2022
2 parents 56c9bbe + ebf6a4b commit 291a0d2
Show file tree
Hide file tree
Showing 23 changed files with 319 additions and 219 deletions.
1 change: 1 addition & 0 deletions .idea/dictionaries/camer.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
14 changes: 7 additions & 7 deletions examples/steady_horseshoe_vortex_lattice_method_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@
# airfoil directory or a NACA four series airfoil, unless you
# are passing in your own coordinates.
name="naca2412",
# If you wish to pass in coordinates, set this to a N x 2
# If you wish to pass in coordinates, set this to an N x 2
# array of the airfoil's coordinates, where N is the number
# of coordinates. Treat this as an immutable, don't edit
# directly after initialization. If you wish to load
# coordinates from the airfoil directory, leave this as None.
# The default is None. Make sure that any airfoil coordinates
# used range in x from 0 to 1.
coordinates=None,
# This is the variable that determines whether or not you
# would like to repanel the airfoil coordinates. This applies
# to coordinates passed in by the user or to the directory
# coordinates. It is highly recommended to set this to True.
# The default is True.
# This is the variable that determines whether you would like
# to repanel the airfoil coordinates. This applies to
# coordinates passed in by the user or to the directory
# coordinates. I highly recommended setting this to True. The
# default is True.
repanel=True,
# This is number of points to use if repaneling the airfoil.
# It is ignored if the repanel is False. The default is 400.
Expand Down Expand Up @@ -239,7 +239,7 @@
# Tell the draw function to not show any wake vortices. As this is a steady
# solver, no vortices have been shed into the wake. This value defaults to false.
show_wake_vortices=False,
# The the draw function to not save the drawing as an image file. This way,
# Tell the draw function to not save the drawing as an image file. This way,
# the drawing will still be displayed but not saved. This value defaults to false.
save=False,
)
Expand Down
14 changes: 7 additions & 7 deletions examples/steady_ring_vortex_lattice_method_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@
# airfoil directory or a NACA four series airfoil, unless you
# are passing in your own coordinates.
name="naca2412",
# If you wish to pass in coordinates, set this to a N x 2
# If you wish to pass in coordinates, set this to an N x 2
# array of the airfoil's coordinates, where N is the number
# of coordinates. Treat this as an immutable, don't edit
# directly after initialization. If you wish to load
# coordinates from the airfoil directory, leave this as None.
# The default is None. Make sure that any airfoil coordinates
# used range in x from 0 to 1.
coordinates=None,
# This is the variable that determines whether or not you
# would like to repanel the airfoil coordinates. This applies
# to coordinates passed in by the user or to the directory
# coordinates. It is highly recommended to set this to True.
# The default is True.
# This is the variable that determines whether you would like
# to repanel the airfoil coordinates. This applies to
# coordinates passed in by the user or to the directory
# coordinates. I highly recommended setting this to True. The
# default is True.
repanel=True,
# This is number of points to use if repaneling the airfoil.
# It is ignored if the repanel is False. The default is 400.
Expand Down Expand Up @@ -267,7 +267,7 @@
# Tell the draw function to not show any wake vortices. As this is a steady
# solver, no vortices have been shed into the wake. This value defaults to false.
show_wake_vortices=False,
# The the draw function to not save the drawing as an image file. This way,
# Tell the draw function to not save the drawing as an image file. This way,
# the drawing will still be displayed but not saved. This value defaults to false.
save=False,
)
Expand Down
39 changes: 19 additions & 20 deletions examples/unsteady_ring_vortex_lattice_method_solver_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,19 @@
# airfoil directory or a NACA four series airfoil, unless you
# are passing in your own coordinates.
name="naca2412",
# If you wish to pass in coordinates, set this to a N x 2
# If you wish to pass in coordinates, set this to an N x 2
# array of the airfoil's coordinates, where N is the number
# of coordinates. Treat this as an immutable, don't edit
# directly after initialization. If you wish to load
# coordinates from the airfoil directory, leave this as None.
# The default is None. Make sure that any airfoil coordinates
# used range in x from 0 to 1.
coordinates=None,
# This is the variable that determines whether or not you
# would like to repanel the airfoil coordinates. This applies
# to coordinates passed in by the user or to the directory
# coordinates. It is highly recommended to set this to True.
# The default is True.
# This is the variable that determines whether you would like
# to repanel the airfoil coordinates. This applies to
# coordinates passed in by the user or to the directory
# coordinates. I highly recommended setting this to True. The
# default is True.
repanel=True,
# This is number of points to use if repaneling the airfoil.
# It is ignored if the repanel is False. The default is 400.
Expand Down Expand Up @@ -392,12 +392,11 @@
operating_point_movement=operating_point_movement,
# Leave the number of time steps and the length of each time step unspecified.
# The solver will automatically set the length of the time steps so that the wake
# ring vortices and the bound ring vortices have the approximately the same area.
# The solver will also determine if the geometry is static or not. If it is
# static, the number of steps will be set such that the wake extends ten chord
# lengths back from the main wing. If the geometry isn't static, the number of
# steps will be set such that three periods of the slowest movement oscillation
# complete.
# ring vortices and the bound ring vortices have approximately the same area. The
# solver will also determine if the geometry is static or not. If it is static,
# the number of steps will be set such that the wake extends ten chord lengths
# back from the main wing. If the geometry isn't static, the number of steps will
# be set such that three periods of the slowest movement oscillation complete.
num_steps=None,
delta_time=None,
)
Expand Down Expand Up @@ -444,13 +443,13 @@
# "side force", or "lift".
scalar_type="lift",
# Tell the draw function to show the calculated streamlines. This value defaults
# to false.
# to False.
show_streamlines=True,
# Tell the draw function to not show the wake vortices. This value defaults to
# false.
# False.
show_wake_vortices=False,
# The the draw function to not save the drawing as an image file. This way,
# the drawing will still be displayed but not saved. This value defaults to false.
# Tell the draw function to not save the drawing as an image file. This way,
# the drawing will still be displayed but not saved. This value defaults to False.
save=False,
)

Expand All @@ -465,12 +464,12 @@
# "side force", or "lift".
scalar_type="lift",
# Tell the animate function to show the wake vortices. This value defaults to
# false.
# False.
show_wake_vortices=True,
# The the animate function to not save the animation as file. This way,
# Tell the animate function to not save the animation as file. This way,
# the animation will still be displayed but not saved. This value defaults to
# false.
save=False,
# False.
save=True,
)

# Call the software's plotting function on the solver. This produces graphs of the
Expand Down
29 changes: 14 additions & 15 deletions examples/unsteady_ring_vortex_lattice_method_solver_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,19 @@
# airfoil directory or a NACA four series airfoil, unless you
# are passing in your own coordinates.
name="naca2412",
# If you wish to pass in coordinates, set this to a N x 2
# If you wish to pass in coordinates, set this to an N x 2
# array of the airfoil's coordinates, where N is the number
# of coordinates. Treat this as an immutable, don't edit
# directly after initialization. If you wish to load
# coordinates from the airfoil directory, leave this as None.
# The default is None. Make sure that any airfoil coordinates
# used range in x from 0 to 1.
coordinates=None,
# This is the variable that determines whether or not you
# would like to repanel the airfoil coordinates. This applies
# to coordinates passed in by the user or to the directory
# coordinates. It is highly recommended to set this to True.
# The default is True.
# This is the variable that determines whether you would like
# to repanel the airfoil coordinates. This applies to
# coordinates passed in by the user or to the directory
# coordinates. I highly recommended setting this to True. The
# default is True.
repanel=True,
# This is number of points to use if repaneling the airfoil.
# It is ignored if the repanel is False. The default is 400.
Expand Down Expand Up @@ -396,12 +396,11 @@
operating_point_movement=operating_point_movement,
# Leave the number of time steps and the length of each time step unspecified.
# The solver will automatically set the length of the time steps so that the wake
# ring vortices and the bound ring vortices have the approximately the same area.
# The solver will also determine if the geometry is static or not. If it is
# static, the number of steps will be set such that the wake extends ten chord
# lengths back from the main wing. If the geometry isn't static, the number of
# steps will be set such that three periods of the slowest movement oscillation
# complete.
# ring vortices and the bound ring vortices have approximately the same area. The
# solver will also determine if the geometry is static or not. If it is static,
# the number of steps will be set such that the wake extends ten chord lengths
# back from the main wing. If the geometry isn't static, the number of steps will
# be set such that three periods of the slowest movement oscillation complete.
num_steps=None,
delta_time=None,
)
Expand Down Expand Up @@ -449,11 +448,11 @@
# "side force", or "lift".
scalar_type="lift",
# Tell the animate function to show the wake vortices. This value defaults to
# false.
# False.
show_wake_vortices=True,
# The the animate function to not save the animation as file. This way,
# Tell the animate function to not save the animation as file. This way,
# the animation will still be displayed but not saved. This value defaults to
# false.
# False.
save=False,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""This is script is an example of how to run Ptera Software's unsteady ring vortex
lattice method solver on a three airplanes, flying in formation, each with custom
lattice method solver on three airplanes, flying in formation, each with custom
geometry and motion. Note, I will comment this example less rigorously than the
single-airplane examples for readability. I recommend you read and understand those
examples before reading this example. """
Expand Down Expand Up @@ -303,17 +303,17 @@
prescribed_wake=False,
)

# Call the software's animate function on the solver. This produces a GIF of the wake
# being shed. The GIF is saved in the same directory as this script. Press "q",
# after orienting the view, to begin the animation.
# Call the software's animate function on the solver. This produces a WebP animation
# of the wake being shed. The animation is saved in the same directory as this
# script. Press "q", after orienting the view, to begin the animation.
ps.output.animate(
unsteady_solver=solver,
scalar_type="lift",
show_wake_vortices=True,
# The the animate function to not save the animation as file. This way,
# Tell the animate function to not save the animation as file. This way,
# the animation will still be displayed but not saved. This value defaults to
# false.
save=False,
save=True,
)

# Compare the output you see with the expected outputs saved in the "docs/examples
Expand Down
45 changes: 26 additions & 19 deletions formation flight/unsteady.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# ToDo: Document this script.
import pterasoftware as ps

# Known Converged Values (prescribed wake, 0.5% convergence, 0 degrees angle of attack):
# 1 Airplane:
# 2, 8
# 3 Airplanes:
# 3, 11
# 5 Airplanes:
# 3, 11
num_airplanes = 5
num_flaps = 3
num_chord = 11
# Known Converged Values (0.5% convergence, 0 degrees angle of attack):
# 1 Airplane (flaps, chordwise panels, prescribed wake):
# 2, 7, False
# 3 Airplanes (flaps, chordwise panels, prescribed wake):
# 3, 7, False
# 5 Airplanes (flaps, chordwise panels, prescribed wake):
# 3, 7, False
num_airplanes = 1
num_flaps = 2
num_chord = 7
prescribed_wake = False

aspect_ratio = 5.0
speed = 1.0
alpha = 5.0
alpha = 0.0
x_spacing = 0.5
y_spacing = 0.5
root_to_mid_span = 0.2275
Expand Down Expand Up @@ -158,7 +158,7 @@

this_problem = ps.problems.UnsteadyProblem(
movement=this_movement,
only_final_results=True,
only_final_results=False,
)

del this_movement
Expand All @@ -178,11 +178,18 @@

ps.output.print_unsteady_results(unsteady_solver=this_solver)

# ps.output.plot_results_versus_time(unsteady_solver=this_solver)
ps.output.plot_results_versus_time(unsteady_solver=this_solver, save=True)

# ps.output.animate(
# unsteady_solver=this_solver,
# scalar_type="lift",
# show_wake_vortices=True,
# keep_file=True,
# )
ps.output.draw(
solver=this_solver,
scalar_type="lift",
show_wake_vortices=True,
save=True,
)

ps.output.animate(
unsteady_solver=this_solver,
scalar_type="lift",
show_wake_vortices=True,
save=True,
)
31 changes: 15 additions & 16 deletions formation flight/unsteady_converge.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@

start_time = time.time()

# Known Converged Values (prescribed wake, 0.5% convergence, 0 degrees angle of attack):
# 1 Airplane:
# 2, 8
# 3 Airplanes:
# 3, 11
# 5 Airplanes:
# 3, 11
# Known Converged Values (0.5% convergence, 0 degrees angle of attack):
# 1 Airplane (flaps, chordwise panels, prescribed wake):
# 2, 7, False
# 3 Airplanes (flaps, chordwise panels, prescribed wake):
# 3, 7, False
# 5 Airplanes (flaps, chordwise panels, prescribed wake):
# 3, 7, False
convergence = 0.5
num_airplanes = 1
num_airplanes = 5
min_num_flaps = 1
max_num_flaps = 6
min_num_chord = 2
max_num_chord = 12
prescribed_wake = True
max_num_flaps = 4
min_num_chord = 5
max_num_chord = 13
wake_state_list = [True, False]

aspect_ratio = 5.0
speed = 1.0
alpha = 5.0
alpha = 0.0
x_spacing = 0.5
y_spacing = 0.5
root_to_mid_span = 0.2275
Expand All @@ -39,7 +39,6 @@
root_to_mid_chord = root_chord
mid_to_tip_chord = (root_chord + tip_chord) / 2

wake_state_list = [prescribed_wake]
num_flaps_list = [i for i in range(min_num_flaps, max_num_flaps + 1)]
num_chord_list = [i for i in range(min_num_chord, max_num_chord + 1)]

Expand Down Expand Up @@ -255,8 +254,8 @@
these_ms_drags = np.mean(these_s_drags, axis=-1)
these_ms_lifts = np.mean(these_s_lifts, axis=-1)

these_rms_drags = these_ms_drags ** 0.5
these_rms_lifts = these_ms_lifts ** 0.5
these_rms_drags = these_ms_drags**0.5
these_rms_lifts = these_ms_lifts**0.5

rms_drags[wake_state_id, num_flaps_id, num_chord_id, :] = these_rms_drags
rms_lifts[wake_state_id, num_flaps_id, num_chord_id, :] = these_rms_lifts
Expand Down
Loading

0 comments on commit 291a0d2

Please sign in to comment.