CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Problem with a deposition equation (https://www.cfd-online.com/Forums/openfoam-programming-development/148842-problem-deposition-equation.html)

TulioVannu February 20, 2015 12:15

Problem with a deposition equation
 
Hello everyone
i'm trying to make a solver that can solve this deposition equation

Fm*rod* d(r1)/dt = r1*Dw0* d(c)/dx

Being Fm, rod and Dw0 constants, and r1 and c variables defined in all the mesh

In my solver i use this
Code:

{
    volVectorField gradienteC = fvc::grad(C);
    volScalarField dcdx = gradienteC.component(0);

  fvScalarMatrix depositionEqn
    (
      Fm * rod * fvm::ddt(r1)
    - r1 * fvm::Sp(Dw0, dcdx)
    );

    depositionEqn.relax();

    depositionEqn.solve();
}

It compiles well, but when i run it in my case this give me this error

Code:

--> FOAM FATAL ERROR:
incompatible fields for operation
    [r1] - [grad(C).component(0)]

    From function checkMethod(const fvMatrix<Type>&, const fvMatrix<Type>&)
    in file /opt/openfoam231/src/finiteVolume/lnInclude/fvMatrix.C at line 1319.

If anyone could help me, i want to know if the equation is writed right in my solvers, and if there is any solution for this error

Would be very glad to get any help on this! Thanks in advance.

Regards, Julian


All times are GMT -4. The time now is 07:44.