cpro 
March 17, 2013 21:19 
Trouble adding a directional derivative source term
Hi everyone. Thanks for checking this.
I am a new OpenFOAM user, and I have been trying to create my own solver to model ferrofluid motion. In the model that I am using, there is a directional derivative source term (i.e. which I plan to approximate as where M and B are vectors).
I have M and B set up as volVectorFields, and I want multiply the entire thing by a the volume of each cell over the (constant) density. It looks like the fvc::div function needs one surface scalar field, so I created a phiB in a similar way to the phi for velocity using
Code:
(fvc::interpolate(B) & mesh.Sf())
Next, I try to modify phiB by the constant. Here is some relevant code:
Code:
phiB=phiB*mesh.V()/rho;
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
 fvm::laplacian(nu, U)
);
solve(UEqn == fvc::grad(p) + fvc::div(phiB, M));
When I try to compile it, it lists a large number of errors that were not there before attempting to multiply by volume. So, I think the problem occurs when I multiply by the volume of each cell (using mesh.V), but I'm lost as to how to fix it. Any tips or suggestions? Is there a better way to do this?
I really appreciate your help.
