# How to declare diffusion function

Hi,

I have two questions.

I have a complicated set of 1D equations. The diffusion coefficient of the
1st is dependent on the derivative of the 2nd's variable, and the 2nd has a
source term of the first. In addition, the initial condition of one of the
variables is dependent on this diffusion coefficient. This is what I mean,
in TeX:

\alpha \frac{\partial \phi}{\partial t} = \frac{\partial}{\partial x}
\left(D \frac{\partial \phi}{\partial x}\right) \\
\beta \frac{\partial \psi}{\partial t} = m \frac{\partial^2 \psi}{\partial
x^2} + \delta\phi \\
D = \gamma \left(\frac{\partial \psi}{\partial x}\right)^{-1} \\
\phi_0 = \frac{1 + x}{D}

alpha, beta, gamma, delta, and m are constants, and phi and psi are the
Cell Variables. How can properly write and implement the diffusion
coefficient D?

So far, I've been trying to implement it by declaring D as a CellVariable,
but as it's a diffusion function, it would seem natural to have it as a
FaceVariable. The problem arises when I try to use it for the initial
condition, as I cannot make phi_0 a function of D as a face variable.

In addition, one of the boundary conditions is this (at x=0):

\frac{\partial \psi^2}{\partial x^2} = 0

I've been implementing it as the following, but I am not sure if it works
properly:


_______________________________________________