2

I'm trying to implement a changing domain into my Matlab code which solves a pde numerically. In the given problem, I am modelling the baking of bread. It is a 1D problem where there is a single heat source from above. I am using the heat diffusion equation and for a fixed domain, I have provided my code below which solves it. However, I need to also model the rising of the bread, so over time my domain, 'L' in my code, changes. I am told that I can assume it changes linearly over an hour and that the bread initially fills 80% of the tin. What suggestions do you guys have for how I can account for the rising?

close all
clear all
clc


Tend = 3600; %Time to end after
dt = 1; %Time step size
Nstep = (Tend/dt)+1; %Number of time points
M = 1000; %Number of x points
dx = 1/M; %Size of the x steps
L = 1; %Length of domain
x = [0:dx:L]; %Creating the x points
kdiff = 2.7e-4; %Diffusion constant value
R = kdiff*dt/(dx*dx);

for i = 1:M+1
  u(i,1) = 20;
end 

for n = 1:Nstep
    DIG(1) = 1;
    b(1) = 200; %Boundry condition
    DIG(M+1) = 1;
    LF(1) = 0;
    RT(1) = 0; 
    LF(M+1) = -1; %Insulated boundry
    RT(M+1) = 0;
    b(M+1) = 0; %Boundry condition
    for m = 2:M
        DIG(m) = 2+(2/R);
        LF(m) = -1;
        RT(m) = -1;
        b(m) = u(m+1,n) + u(m-1,n) + (-2 + (2/R))*u(m,n);
    end
    u(:,n+1) = tdma(LF,DIG,RT,b,M+1);
end

plot(x,u(:,1:600:end)
Dedavond
  • 21
  • 2
  • I think we need to know the relationship between the temperature and the growing rate to solve this, dont we? If it would be known, L could be updated every timestep regardingly. As you were told you can (generally) assume a linear growth of the bread, the temperature must be kind of a prefactor which influences the speed of the growth. For higher temperatures I would expect a faster growth. The max L remains constant I guess independently of the Temperature. In order to learn the relationship of temperature and growth I would measure the time it takes to reach max L for different temperatures – Marcus Oct 16 '17 at 21:55

0 Answers0