Commit 191e5331 authored by Gidon Lucian Bauer's avatar Gidon Lucian Bauer 🏳
Browse files

mnwepkwm

parent e40b6b2f
%% HLL Flux function
%% HLL Flux function; works only for the euler function
function [F] = HLL_flux(func, ul, ur)
eigs = zeros(6,1);
eigs(1:3, 1) = eigs_euler(ul);
......
......@@ -7,9 +7,9 @@
function [y] = f_euler(u)
gamma = 1.4;
p = (gamma - 1) * (u(3) - 0.5 * (u(2)^2/u(1)));
p = (gamma - 1) * (u(3) - 0.5 * ((u(2)^2)/u(1)));
y(1) = u(2);
y(2) = u(2)^2/u(1) + p;
y(2) = (u(2)^2)/u(1) + p;
y(3) = (u(2)/u(1)) * (u(3) + p);
end
\ No newline at end of file
......@@ -19,7 +19,7 @@ N = 50;
xspan = [0;1];
tspan = [0;0.25];
courant_number = 0.8;
courant_number = 0.8; % from (0,1]
%% Set initial conditions
% Note: this ul and ur contains [rho, v, p], while all other u further in
......@@ -53,13 +53,14 @@ u0 = init_cond(ul, ur, N);
%% Plotting
x = linspace(xspan(1), xspan(2), N);
% t = linspace(tspan(1), tspan(2), N);
figure(1);
f = figure(1);
f.WindowState = 'maximized';
tiledlayout(2,2);
nexttile;
pcolor(t, x, U(:,:,1));
colorbar;
% surf(t, x, U(:,:,1));
title('Density');
xlabel('t');
......@@ -67,6 +68,7 @@ ylabel('x');
nexttile;
pcolor(t, x, U(:,:,2));
colorbar;
% surf(t, x, U(:,:,2));
title('Momentum');
xlabel('t');
......@@ -74,6 +76,7 @@ ylabel('x');
nexttile;
pcolor(t, x, U(:,:,3));
colorbar;
% surf(t, x, U(:,:,3));
title('Total energy');
xlabel('t');
......
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