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/)
-   -   Incompatible field operations (https://www.cfd-online.com/Forums/openfoam-programming-development/120960-incompatible-field-operations.html)

RaghavendraRohith July 18, 2013 04:27

Incompatible field operations
 
Hi

I am Actually trying to solve enthalpy equation using a logic but i am in need to add a source term to it.

But it delivers a message called Incompatible field operations, however i know that it is trying to solve two variables in one equation which should be an error.

1. But i have even tried to solve it in a different set and including the variable value here

2. I have aldready tried an explicit approach but doesnt work.

Here is the Code

Code:


{
  fvScalarMatrix hbEqn
        (
            fvm::div(phib, hb)
              - fvm::Sp(fvc::div(phib), hb)
              - fvm::laplacian(turbulenceb->alphaEff(), hb)
            ==
              - fvc::div(phib, 0.5*magSqr(Ub), "div(phib,K)")+ activBereichb*(alphab*Ts-fvm::Sp(alphab,Tb))     
        );

        hbEqn.relax();
        hbEqn.solve();

    pZonesb.addEnthalpySource(thermob, rhob, hbEqn);

    hbEqn.relax();

    hbEqn.solve();

    thermob.correct();


}

Ts is the temperature of solid and Tb is of fluid. There is a heat transfer between them which is to be included as an additional source term.


Thank you in Advance

KlasJ July 19, 2013 08:49

Hi,

Without having tested your code I guess the problem comes from the part:

Code:

activBereichb*(alphab*Ts-fvm::Sp(alphab,Tb))
In general fvm is used for the implicit discretization and fvc for the explicit discretization. Just as you say, and as is stated by the error message, you are not allowed to solve for more than one variable in each equation. In the first part of your equation your using hb as your implicit variable and in the right hand side you are trying to use implicit discretization also for Tb.

I guess you want to use the explicit name space (fvc) for all the factors in the right hand side.

I hope this was giving some clarity.

Best regards,

Klas

RaghavendraRohith July 19, 2013 08:52

Hi Klas

I have solved the problem with this aspect . Actually it was due to the same reason.

I tried to figure it out.

Thanks a lot

Rohith


All times are GMT -4. The time now is 22:30.