Governing Equations and BCs attached.
Problem: I am trying to model 1D mass and heat transfer for sublimation with a porous,dried media (region I) through which gas flows and a frozen, solid section (region II), with a sublimation front at the interface. This imposes Stefan condition at the moving boundary. I understand the derivation and math, but I am new to MATLAB, and get so confused when I try to convert equations to it. The code I have attached here is garbage, but I wanted to show in case it better illustrates where my confusion lies.
I have performed coordinate transformation on the governing equations using a non-dimensionalized scaling factor, discretized in space using finite difference method, and tried to couple the equations for the 2 regions with the boundary equation (Stefan condition). I really could use some guidance from someone well-versed in MATLAB!
*I would use the following code as a function and then in command window use: [t,y]=ode15s(@solid_process,[0 100],[0 0 0]).*
L = 8;
N = 51;
dx = L/N;
rho = 1;
del = 0.001;
kl = .0004;
alphal = 1e-8;
dTk/dt = alphal*[(T(k+1)-2*T(k)+T(k-1))/(dx^2)];
dTi/dt = alphal*[(T(m)-2*T(i)+T(i-2))/(dx^2)] + alphal/kl*[(1-del)*rho*L/dx*ds/dt];
ds/dt = -kl/rho/L*[(T(i)-T(i-2))/2/dx + (1+del)*(T(i-2)-2*T(i-2)+T(I))/dx];
y(0) = dTk/dt;
y(1) = dTi/dt;
y(2) = ds/dt;
systemofodes = [y];