Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ jobs:
arch: x64
version: 1
- os: macOS-latest
arch: x64
arch: aarch64
version: 1
steps:
- name: Install matplotlib
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get install -y python3-matplotlib; fi
shell: bash
- name: Install LaTeX
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get -qq install texlive-full texlive-fonts-extra cm-super; fi
run: if [ "$RUNNER_OS" = "Linux" ]; then sudo apt-get -qq install texlive-full cm-super; fi
shell: bash
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
Expand Down
23 changes: 20 additions & 3 deletions test/test_plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using VortexStepMethod
using ControlPlots
using Test

function result_vsm()
function create_wa()
# Step 1: Define wing parameters
n_panels = 20 # Number of panels
span = 20.0 # Wing span [m]
Expand Down Expand Up @@ -43,7 +43,7 @@ plt.ioff()
@test isfile("/tmp/plot.pdf")
rm("/tmp/plot.pdf")
show_plot(fig)
wa = result_vsm()
wa = create_wa()
if Sys.islinux()
fig = plot_geometry(
wa,
Expand All @@ -61,6 +61,23 @@ plt.ioff()
rm("/tmp/Rectangular_wing_geometry_side_view.pdf")
@test isfile("/tmp/Rectangular_wing_geometry_top_view.pdf")
rm("/tmp/Rectangular_wing_geometry_top_view.pdf")
# Step 5: Initialize the solvers
vsm_solver = Solver(aerodynamic_model_type="VSM")
llt_solver = Solver(aerodynamic_model_type="LLT")
# Step 6: Solve the VSM and LLT
results_vsm = solve(vsm_solver, wa)
results_llt = solve(llt_solver, wa)
# Step 7: Plot spanwise distributions
y_coordinates = [panel.aerodynamic_center[2] for panel in wa.panels]

fig = plot_distribution(
[y_coordinates, y_coordinates],
[results_vsm, results_llt],
["VSM", "LLT"],
title="Spanwise Distributions"
)
@test fig isa plt.PyPlot.Figure
end
end
plt.ion()
plt.ion()
nothing