Commit 0f789684 authored by Gidon Lucian Bauer's avatar Gidon Lucian Bauer 🏳
Browse files

---

parent 1fbf8747
%% multidimensional Finite Volume method
%% 3D Finite Volume method
function [U] = FVM_3D(u0, flux, f, xspan, tspan, N)
U = zeros(N, N, 3); % NxNx3
......
......@@ -3,9 +3,9 @@ function [F] = HLL_flux(func, ul, ur)
al = min_eig(func, ul, ur);
ar = max_eig(func, ul, ur);
if (0 <= al)
if (al >= 0)
F = func(ul);
elseif ((al <= 0) && (0 <= ar))
elseif ((al <= 0) && (ar >= 0))
F = (ar * func(ul) - al * func(ur) + al * ar * (ur - ul)) / (ar - al);
else
F = func(ur);
......
%% Set 3D inititial conditions with discontinuity at x = 0.5
% Note: this ul and ur contains [rho, v, p], while all other u further in
% this programm will contain [rho, v, E]
function [u0] = init_cond(ul, ur, N)
u0 = zeros(N,3);
......
......@@ -14,4 +14,5 @@ function [jac] = jacobi(func, u, h)
jac(i,j) = (f_plus_h(i) - f_minus_h(i)) / (2*h);
end
end
% disp(jac);
end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment