Skip to content
Snippets Groups Projects
Commit 96658c52 authored by Lars Hubatsch's avatar Lars Hubatsch
Browse files

Uniform mesh, eq. temporarily changed to client. Uniform IC.

parent 01ca53ec
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,7 @@ function create_mesh(T)
% % ceil((T.x(ind+20)-T.x(ind-20))*200)),...
% % T.x(ind+21:end)];
% % end
T.x = [linspace(3, 5.7, 500), linspace(5.705, 6.05, 16000),...
linspace(6.06, 7.1, 1500), linspace(7.15, 10, 750)];
% T.x = [linspace(3, 5., 500), linspace(5.05, 6.05, 3000),...
% linspace(6.06, 7.1, 500), linspace(7.15, 20, 3000)];
T.x = linspace(0, 20, 10000);
end
......@@ -11,7 +11,7 @@ if strcmp(mode, 'mov')
figure(20); hold on;
for i = 1:nth:length(T.t)
cla; xlim([-T.a-1, -T.a+3]); ylim([0, 1.2]);
xlim([3, 10]);
xlim([0, 20]);
ax = gca;
ax.FontSize = 12;
xlabel('position'); ylabel('probability [not normalized]');
......@@ -21,7 +21,7 @@ if strcmp(mode, 'mov')
text(abs(-T.a+2), 0.7, num2str(T.t(i)));
shg
% pause();
% print([num2str(i),'.png'],'-dpng')
print([num2str(i),'.png'],'-dpng')
end
elseif strcmp(mode, 'plot')
figure(20);
......
......@@ -20,7 +20,8 @@ gra_a = Ternary_model.gradient_analytical(x, a, b, e, v*t);
% g0 = Ternary_model.gamma0(x, a+t*v, b, e_g0, u_g0, v*t);
g0 = 1;
c = 1;
f = g0*(1-pt)/pt*(pt*dudx-u*gra_a);
% f = g0*(1-pt)/pt*(pt*dudx-u*gra_a);
f = g0*(dudx-5*u*gra_a);
s = 0;
end
......@@ -46,6 +47,9 @@ elseif strcmp(ic, 'Gauss')
else
u = 0;
end
elseif strcmp(ic, 'Uniform')
% Uniform concentration
u = u0-e;
elseif isnumeric(ic)
% use ic as initial condition by interpolating the given values between
% 0 and a
......
......@@ -42,10 +42,10 @@ p_in = @(D_p, D_m, ga, x0, x, t) 1./(sqrt(pi*t)*(sqrt(D_m)+...
x_left = linspace(-4, 0, 1000);
x_right = linspace(0, 4, 1000);
%% Moving boundary
t = linspace(0, 1, 300);
t = linspace(0, 15, 300);
tic
T_mov = Ternary_model(0, 'Gauss', [-6, b(7/3, 10^-15), 0.5, e(7/3),...
0, 1, 300, 7, 0.2], t, 0.02);
T_mov = Ternary_model(0, 'Uniform', [-20, b(7/3, 10^-6), 0.5, e(7/3),...
0, 1, 20, 7, 0.5], t, 0.02);
T_mov.solve_tern_frap()
toc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment