-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I updated the Daniobot example and added a convergence example.
- Loading branch information
Showing
2 changed files
with
174 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
import pterasoftware as ps | ||
|
||
daniobot = ps.geometry.Airplane( | ||
name="Daniobot", | ||
x_ref=0.0, | ||
y_ref=0.0, | ||
z_ref=0.0, | ||
wings=[ | ||
ps.geometry.Wing( | ||
name="Tail", | ||
x_le=0.0, | ||
y_le=0.0, | ||
z_le=0.0, | ||
symmetric=True, | ||
num_chordwise_panels=16, | ||
chordwise_spacing="uniform", | ||
wing_cross_sections=[ | ||
ps.geometry.WingCrossSection( | ||
num_spanwise_panels=8, | ||
spanwise_spacing="cosine", | ||
chord=7e-3, | ||
airfoil=ps.geometry.Airfoil( | ||
name="naca0012", | ||
), | ||
), | ||
ps.geometry.WingCrossSection( | ||
num_spanwise_panels=8, | ||
spanwise_spacing="cosine", | ||
y_le=3e-3, | ||
chord=7e-3, | ||
airfoil=ps.geometry.Airfoil( | ||
name="naca0012", | ||
), | ||
), | ||
], | ||
), | ||
], | ||
) | ||
|
||
tail_root_wing_cross_section_movement = ps.movement.WingCrossSectionMovement( | ||
base_wing_cross_section=daniobot.wings[0].wing_cross_sections[0], | ||
pitching_amplitude=15.0, | ||
pitching_period=1 / 8, | ||
pitching_spacing="sine", | ||
) | ||
|
||
tail_tip_wing_cross_section_movement = ps.movement.WingCrossSectionMovement( | ||
base_wing_cross_section=daniobot.wings[0].wing_cross_sections[1], | ||
pitching_amplitude=15.0, | ||
pitching_period=1 / 8, | ||
pitching_spacing="sine", | ||
) | ||
|
||
tail_movement = ps.movement.WingMovement( | ||
base_wing=daniobot.wings[0], | ||
wing_cross_sections_movements=[ | ||
tail_root_wing_cross_section_movement, | ||
tail_tip_wing_cross_section_movement, | ||
], | ||
) | ||
|
||
del tail_root_wing_cross_section_movement | ||
del tail_tip_wing_cross_section_movement | ||
|
||
daniobot_movement = ps.movement.AirplaneMovement( | ||
base_airplane=daniobot, | ||
wing_movements=[tail_movement], | ||
) | ||
|
||
del daniobot | ||
del tail_movement | ||
|
||
operating_point = ps.operating_point.OperatingPoint( | ||
density=997, | ||
beta=0.0, | ||
velocity=10e-3, | ||
alpha=0, | ||
nu=1.00e-6, | ||
) | ||
|
||
operating_point_movement = ps.movement.OperatingPointMovement( | ||
base_operating_point=operating_point, | ||
) | ||
|
||
movement = ps.movement.Movement( | ||
airplane_movements=[daniobot_movement], | ||
operating_point_movement=operating_point_movement, | ||
delta_time=None, | ||
num_cycles=None, | ||
) | ||
|
||
del daniobot_movement | ||
del operating_point_movement | ||
|
||
problem = ps.problems.UnsteadyProblem( | ||
movement=movement, | ||
) | ||
|
||
ps.convergence.analyze_unsteady_convergence( | ||
ref_problem=problem, | ||
prescribed_wake=True, | ||
free_wake=True, | ||
num_cycles_bounds=(5 - 2, 5 + 2), | ||
panel_aspect_ratio_bounds=(4, 1), | ||
num_chordwise_panels_bounds=(16 - 2, 16 + 2), | ||
convergence_criteria=5, | ||
coefficient_mask=[True, False, False, False, False, False], | ||
) | ||
|
||
# INFO:convergence:The analysis found a converged mesh: | ||
# INFO:convergence: Wake type: prescribed | ||
# INFO:convergence: Cycles: 6 | ||
# INFO:convergence: Panel aspect ratio: 4 | ||
# INFO:convergence: Chordwise panels: 15 | ||
# INFO:convergence: Iteration time: 0.207 s | ||
|
||
# del movement | ||
# | ||
# solver = ps.unsteady_ring_vortex_lattice_method.UnsteadyRingVortexLatticeMethodSolver( | ||
# unsteady_problem=problem, | ||
# ) | ||
# | ||
# del problem | ||
# | ||
# solver.run( | ||
# prescribed_wake=True, | ||
# calculate_streamlines=False, | ||
# ) | ||
# | ||
# # ps.output.animate( | ||
# # unsteady_solver=solver, | ||
# # scalar_type="induced drag", | ||
# # show_wake_vortices=True, | ||
# # parallel_projection=True, | ||
# # save=True, | ||
# # ) | ||
# | ||
# ps.output.draw( | ||
# solver=solver, | ||
# scalar_type="induced drag", | ||
# show_wake_vortices=True, | ||
# parallel_projection=True, | ||
# save=True, | ||
# ) | ||
# | ||
# ps.output.plot_results_versus_time( | ||
# unsteady_solver=solver, | ||
# show=True, | ||
# save=False, | ||
# ) | ||
# | ||
# ps.output.print_unsteady_results( | ||
# unsteady_solver=solver, | ||
# ) |