> But phi.getFaceGrad().dot((0,1)) is a scalar field. You can't take
> the divergence of a scalar. What I've done when I needed something
> like d2(phi)/dy2 (sorry that I missed that aspect of it before; I
> thought you wanted \nabla^2 \phi, or at least d2(phi)/dx2) is
>
> phi.getGrad().dot((0,1)).getFaceGrad().dot((0,1))
>
Apologies, I meant "*" when I used "dot". The expression then becomes.
surfaceFlux = mask * constant * (phi.getFaceGrad() * (0,
1)).getDivergence().getArithmeticFaceValue() * (1, 0)
I believe that will get the (phi_up + phi_down - 2 * phi_center) type
discretization
(if that matters) and cast it to vertical faces (flux in the x-direction).
> After that, if you multiply this scalar FaceVariable by the
> VectorFaceVariable mask that I showed in the last message, you should
> get the flux you want, and
>
> > Then add surfaceFlux.getDivergence() to the equation.
>
> then this will give you the proper source for the boundary condition.
>
>
>
--
Daniel Wheeler