CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   adding div(phi) (

bluemind May 31, 2012 08:11

adding div(phi)
Hello everybody,

I'm currently working on the implementation of the some equations within the twoLiquidMixingFoam solver and I am facing some trouble when I try to add (in bold) an extra term in this transport equation :

fvScalarMatrix fracVolLVEqn
+ fvm::div(phi, fracVolLV)
- fvm::laplacian
Dab + alphatab*turbulence->nut(), fracVolLV,
== fvm::div(phi, fracVolTot)



(fracVolLV =alpha1 (volumetric fraction of liquid) + alpha2 (volumetric fraction of vapor)
fracVolTot=alpha1 + alpha2+ alpha3 (volumetric fraction of air) ) equal to 1

When I compile, I don't have any errors however when I run the program I have the following error message :

incompatible fields for operation
[fracVolLV] == [fracVolTot]

Does anyone know how can I solve the problem ?

Thank you for the help,

akidess May 31, 2012 08:22

Try using fvc::div.

bluemind May 31, 2012 08:48

Thank you for the answer, I have already tried to use fvc :: div (), and the program works (even if the calculation diverge at some point). But I'm confused about using an explicit resolution for this term whereas the other terms are resolved implicitly.

akidess May 31, 2012 08:54

You can only have one solution variable per equation. If you use fvm, the solver will see fracVolLV and fracVolTot as solution variables which cannot work.

bluemind May 31, 2012 08:58

Thank you for the explanation I understand better now

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