Going Further#

Crank-Nicolson#

The Crank-Nicolson method uses a time-centered discretization of the diffusion term:

ϕin+1ϕinΔx=k2(ϕi+1n2ϕin+ϕi1nΔx2+ϕi+1n+12ϕin+1+ϕi1n+1Δx2)

This is still an implicit update, but the coefficients and righthand side in the linear system will be different

State-dependent transport coefficients#

If we have a non-constant conductivity that depends on ϕ itself, then our discretization is more complicated:

ϕin+1ϕinΔt={kϕ}i+1/2{kϕ}i1/2Δx

Now we need k at the interfaces. There are several ways to do this, which should be motivated by the physics of what the coefficient k represents:

ki+1/2=12(ki+ki+1)

or

1ki+1/2=12(1ki+1ki+1)

Then a C-N update appears as:

ϕin+1ϕinΔt=12{[k(ϕn)ϕn]i+[k(ϕn+1)ϕn+1]i}

We can update this using a predictor-corrector scheme:

ϕiϕinΔt=12{[k(ϕn)ϕn]i+[k(ϕn)ϕ]i}
ϕin+1ϕinΔt=12{[k(ϕn)ϕn]i+[k(ϕ)ϕn+1]i}

This will be second-order accurate in time.