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

Introduce possibility for constant D across entire domain. Not tested.

parent 17472f4a
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,8 @@ classdef Ternary_model < handle
end
T.create_mesh();
T.phi_t = Ternary_model.phi_tot(T.x, T.a, T.b, T.e, T.u0, 0);
T.ga0 = Ternary_model.gamma0(T.x, T.a, T.b, T.e_g0, T.u_g0, 0);
T.ga0 = Ternary_model.gamma0(T.x, T.a, T.b, T.e_g0, T.u_g0,...
0, T.e, T.u0);
T.calc_real_params;
end
create_mesh(T)
......@@ -62,6 +63,6 @@ classdef Ternary_model < handle
methods(Static)
pt = phi_tot(x, a, b, e, u0, vt)
g = gradient_analytical(x, a, b, e, vt)
g0 = gamma0(x, a, b, e_g0, u_g0, vt)
g0 = gamma0(x, a, b, e_g0, u_g0, vt, e, u0)
end
end
\ No newline at end of file
......@@ -7,9 +7,9 @@ T.real_params.partitioning = T.real_params.phi_in/T.real_params.phi_out;
if strcmp(T.mode, 'Constituent') || strcmp(T.mode, 'Client')
T.real_params.Gamma_in = Ternary_model.gamma0(-1000, T.a, T.b, T.e_g0,...
T.u_g0, 0);
T.u_g0, 0, T.e, T.u0);
T.real_params.Gamma_out = Ternary_model.gamma0(1000, T.a, T.b, T.e_g0,...
T.u_g0, 0);
T.u_g0, 0, T.e, T.u0);
T.real_params.D_in = (1-T.real_params.phi_in)*T.real_params.Gamma_in;
T.real_params.D_out = (1-T.real_params.phi_out)*T.real_params.Gamma_out;
......
function g0 = gamma0(x, a, b, e_g0, u_g0, vt)
function g0 = gamma0(x, a, b, e_g0, u_g0, vt, e, u0)
%GAMMA0 calculate spatially dependent mobility
% Based on a tanh profile.
g0 = e_g0*(tanh((x+a+vt)/b)+1)/2+u_g0;
if isnumeric(isnumeric(e_g0))
g0 = e_g0*(tanh((x+a+vt)/b)+1)/2+u_g0;
else
g0 = u_g0./Ternary_model.phi_tot(x, a, b, e, u0, vt);
end
end
\ No newline at end of file
......@@ -9,7 +9,7 @@ gra_a = Ternary_model.gradient_analytical(x, a, b, e, v*t);
s = 0;
c = 1;
if strcmp(mode, 'Constituent')
g0 = Ternary_model.gamma0(x, a+t*v, b, e_g0, u_g0, v*t);
g0 = Ternary_model.gamma0(x, a+t*v, b, e_g0, u_g0, v*t, e, u0);
f = g0.*(1-pt)./pt.*(pt.*dudx-u.*gra_a);
elseif strcmp(mode, 'Const_mob')
% Using Stefano's mobility ansatz (1-phi_tot+a*phi_tot^2) to obtain a
......
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