# Homework Help: Finite Difference method to solve diffusion equation

1. Aug 23, 2014

1. The problem statement, all variables and given/known data
Plot the transient conduction of a material with k = 210 w/m K, Cp = 350 J/kg K, ρ = 6530 kg/m3

Where the material is a cylinder, with constant cross sectional area and is well insulated. The boundary conditions for the cylinder:
T(0,t) = 330K
T(l,t) = 299K
$\frac{∂T}{∂t}(x,17)=0$

2. Relevant equations
Diffusion equation:
$\frac{∂T}{∂t}=\alpha\frac{∂^{2}T}{∂x^{2}}$

rearranged diffusion equation in finite difference form
$T(x,t+Δt)=\frac{\alphaΔt}{Δx^{2}}[T(x+Δx, t)-2T(x,t)+T(x-Δx,t)]$

3. The attempt at a solution
Hi all

I've never used the finite difference equation before to solve a PDE and I'm unsure how to use it. I know how to find values such as α (thermal diffusivity), but I'm unsure on how to sub in my initial and boundary conditions. And which values would I use for T(x+Δx, t) or T(x-Δx,t)? Since I'm trying to find change in temperature over time at a fixed distance x, I would assume that Δx = 0? (which I know is incorrect).

I've tried looking online for PDE finite analysis techniques, but they're all either ODE examples or mesh analysis (something we haven't covered).

2. Aug 23, 2014

### AlephZero

Try Googling the Crank-Nicholson method for the 1D heat conduction equation (or the diffusion equation). This is a standard example in courses on finite difference, numerical method, and PDEs.

I don't understand your boundary condition $\frac { \partial T} {\partial t}(x,17) = 0$. Why t= 17? If the time derivative is constant everywhere at one time, isn't it constant everywhere at all times - i.e. the solution is steady state heat conduction along a uniform rod with the end temperatures given, so there is nothing to solve for numerically!

3. Aug 23, 2014

Sorry I made a mistake with that, I was meant to say that the system reaches steady state at approximately t = 17.

We haven't yet covered the Crank-Nicholson method, so I have a feeling we may have to stick with the explicit method.

4. Aug 24, 2014

### AlephZero

If you want an explicit method you could use http://en.wikipedia.org/wiki/FTCS_scheme

With the constant temperatures at T(0,t) and T(l,t) the solution will converge to steady state as t increases for any starting temperature distribution T(x,0). It seems a bit strange that the question doesn't specify the starting temperature, so you can have something to check your results against. Just saying that it approximately converges by t = 17 doesn't tell you much.