Help for Vortex Lattice Method

7 views (last 30 days)
Mert
Mert on 3 Dec 2024
Commented: Mert on 5 Dec 2024
Hello, I am working on the vortex lattice method code. I have now solved it up to DeltaV speed. But when I run it from the test function, I find DeltaV (0,0,0.1125) and this is the correct answer. But when I run it in the main file, I get a different value. After finding DeltaV, I need to find downwash, CL and CD. I need help from here.
  2 Comments
Mert
Mert on 3 Dec 2024
Edited: Walter Roberson on 4 Dec 2024
function Vor3D
global PC P1 P2 Gamma NJ NI
global DeltaV
r1 = PC - P1;
r2 = PC - P2;
r0 = P2 - P1;
Cross_r1r2 = cross(r1, r2);
r1r2 = Cross_r1r2 / (norm(Cross_r1r2))^2;
Term2 = (r1 / norm(r1)) - (r2 / norm(r2));
r0Term2 = dot(r0, Term2);
DeltaV = Gamma / (4*pi) * r1r2 * r0Term2;
end
Mert
Mert on 3 Dec 2024
Edited: Walter Roberson on 4 Dec 2024
clc; clear all; close all
global PC P1 P2 Gamma DeltaV
% Test Verileri
PC = [1, 1, 0];
P1 = [0, 0, 0];
P2 = [2, 0, 0];
Gamma = 1.0;
Vor3D();
% Beklenen Değer
expected_DeltaV = [0, 0, 0.1125];
% Beklenen ve Hesaplanan Değerleri Ekranda Göster
fprintf('Hesaplanan Değer DeltaV: [%f, %f, %f]\n', DeltaV(1,1,1), DeltaV(1,1,2), DeltaV(1,1,3));
fprintf('Beklenen Değer DeltaV: [%f, %f, %f]\n', expected_DeltaV(1), expected_DeltaV(2), expected_DeltaV(3));
% Tolerans
tolerance = 1e-4;
if all(abs(squeeze(DeltaV(i,j,:)) - expected_DeltaV') < tolerance)
disp('Test Başarılı!');
else
disp('Test Başarısız!');
end

Sign in to comment.

Accepted Answer

Altaïr
Altaïr on 5 Dec 2024
Edited: Altaïr on 5 Dec 2024
Hi @Mert,
The issue appears to be in the calculation of the 'G' and 'C' matrices within the 'Panel' function. The values of 'PC', 'P1', and 'P2' in the test script result in the following vectors:
  • r0 = [2; 0; 0]
  • r1 = [1; 1; 0]
  • r2 = [-1; 1; 0]
However, when the 'Main.m' file is called, the vectors are:
  • r0 = [0; 1; 0]
  • r1 = [0.5; 0.5; 0]
  • r2 = [0.5; -0.5; 0]
Looking at the plot of the 'P', 'G', and 'C' matrices, the control points seem to be positioned at midpoints between the chords along the span.
Please verify if this is the intended location for the control points. The method for calculating the points in the 'G' matrix, i.e. the vortex endpoints, is unclear.
Debugging the calculation of the 'G' matrix should help resolve the issue.
I believe this will assist you!
  1 Comment
Mert
Mert on 5 Dec 2024
Hello @Ashok,
thank you for your help. My problem was caused by manually calculating the panel points incorrectly. When I correctly determined and solved the P1, P2 and PC points on my panel, I found the value to be 0.2251. When I implemented it in my code, the minus answer appeared. The reason for the negative result is the cross_r1r2 vector product. When I did r2xr1, I reached the positive value. Now I will try to move on to aerodynamic coefficients. If you would like to guide me, I am open to your suggestions.

Sign in to comment.

More Answers (0)

Categories

Find more on Dynamic System Models in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!