- #1
Hypatio
- 151
- 1
- TL;DR Summary
- 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.
[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: