Diffusion equation and a system of equations with reciprocal unknowns?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
Hypatio
Messages
147
Reaction score
1
TL;DR
Need to find an implicit numerical solution to a diffusion equation with concentration replaced with the derivative of a function of the concentration
So the normal diffusion equation looks like
[tex]\frac{\partial c}{\partial t} = k\frac{\partial}{\partial x}\left(\frac{\partial c}{\partial x}\right)[/tex]
I know how to get explicit and implicit solutions to this equation using finite differences. However, I am trying to do the same for an equation of the following form:
[tex]\frac{\partial c}{\partial t} = k\frac{\partial}{\partial x}\left(\frac{\partial}{\partial x}\frac{\delta G}{\delta c}\right)[/tex]
So, the term [tex]\delta G/ \delta c[/tex] is a variational derivative of some function G. Spatial variation of this, instead of the concentration itself, acts as the force for diffusion. In my application, I need to find a solution in which G and [tex]\delta G/ \delta c[/tex] are arbitrarily complicated, so I can probably settle for a solution in which it is a constant in time for each solve.

A 1D, forward in time, centered in space, finite-difference equation for an implicit solve might be:
[tex]c^1_i=c^0_i + \Delta t \frac{k}{\Delta x^2}\left(\phi^1_{i-1}-2\phi^1_{i}+\phi^1_{i+1}\right)[/tex]
where superscript 0 indicates the old/reference time, and superscript 1 indicates the forward time being solved for, subscripts indicate position in space, and
[tex]\phi_i= \left(\partial G/ \partial c\right)_i[/tex]
But maybe this is incorrect. I'm not sure how to write the equations so that the unknowns are the concentrations, c, and not phi, which is known. One approach I've tried is to write
[tex]\phi= \left(\delta G/ \delta c\right) = \frac{G-G_0}{c-c_0}= \frac{\Delta G}{c-c_0} =\frac{\Delta G}{c}[/tex]
but this results in
[tex]c^1_i-\Delta t \frac{k}{\Delta x^2}\left(\Delta G_{i-1}\frac{1}{c^1_{i-1}}-2\Delta G_{i}\frac{1}{c^1_{i}}+\Delta G_{i+1}\frac{1}{c^1_{i+1}}\right) = c^0_i[/tex]
which would result in a matrix of reciprocal and non-reciprocal unknowns, which I'm not sure how to solve for or rewrite to solve normally.

Any ideas about how to solve this type of equation implicitly?

Thanks for any help.
 
Last edited:
Physics news on Phys.org
I've realized I may have made a mistake and I should have wrote the approximation of the derivative in a different way. For example
[tex]\phi_i = x_i+y_ic_i[/tex]
for a first order approximation
[tex]\phi_i = x_i+y_ic_i+z_ic_i^2[/tex]
for a second order approximation, or
[tex]\phi_i = x_i \ln (c)+y_i[/tex]
for a logarithmic approximation.

because of the way c appears in the terms I can manage to write the coefficients that will go into the stiffness matrix. Does this make sense now?

On the other hand, I don't know how to deal with the squared term in the second order approximation, and even less how to deal with the logarithmic term in the third approximation. Any ideas?