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/)
-   -   Undefined keyword for divergence (https://www.cfd-online.com/Forums/openfoam-programming-development/142387-undefined-keyword-divergence.html)

Parisa_Khiabani September 29, 2014 16:53

Undefined keyword for divergence
 
Hello everyone,
The TEqn.H in my solver is as below:

surfaceScalarField kappaf = twoPhaseProperties->kappaf();

fvScalarMatrix TEqn
(
fvm::ddt(rhoCp, T)
+ fvm::div(rhoPhiCpf, T)
- fvm::laplacian(kappaf, T)
);

TEqn.solve();

in system/fvSchemes, I defined:
div (rhophiCpf,T) Gauss upwind;
However, after one iteration, I get a fatal error as: keyword div(rho*phi*Cpf,T) is undefined in dictionary.
I also change the initial form of div (rhophiCpf,T) to div(rho*phi*Cpf,T), but the same error happened. That's weird because I did define the divergence.
I really appreciate if you guys can help me.

Best,
Parisa

GerhardHolzinger September 30, 2014 03:53

Use

Code:

fvm::div(rhoPhiCpf, T, "div(rhoPhiCpf,T)")

in your code. This way you tell OpenFOAM - via the third argument - specifically what to look for in fvSchemes.

If you omit the string, then OpenFOAM creates an expression based on the operations and variables involved. If, you specify the expression, then OpenFOAM will look for exactly this expression.

If you then still have trouble, the error lies elsewhere.

Parisa_Khiabani September 30, 2014 07:57

Dear Gerhard,
Thanks a lot for your professional help. Now, the issue has been solved by your assistance.

Best,
Parisa

Quote:

Originally Posted by GerhardHolzinger (Post 512406)
Use

Code:

fvm::div(rhoPhiCpf, T, "div(rhoPhiCpf,T)")

in your code. This way you tell OpenFOAM - via the third argument - specifically what to look for in fvSchemes.

If you omit the string, then OpenFOAM creates an expression based on the operations and variables involved. If, you specify the expression, then OpenFOAM will look for exactly this expression.

If you then still have trouble, the error lies elsewhere.



All times are GMT -4. The time now is 08:01.