CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   Possible bug in UEqn for raslescavitatingFoam (

henry November 11, 2008 06:05

Yes in principle you are corre
Yes in principle you are correct, "dev2" should be used instead of "dev". However numerically there are problems because while the implementation of divU is consistent with fvc::grad(U) and hence a consistent "dev" can be formulated, if "dev2" is used, part of the 2/3 I divU is being used to make the grad(U) buried in the fvm::laplacian(muEfff, U) deviatoric. This is not numerically consistent. While there are no problems with this for most variable density flows, cavitation is a special case as it introduces extreme dilatation in the flow. Try the alternatives and see what happens.

Another option is to implement the stress directly as

div( muEfff * ( gradU + transpose( gradU ) - 2/3 I divU ) )

and then add the stabilising term

- fvm::laplacian(muEfff, U) + fvc::laplacian(muEfff, U)

but while this is more consistent we have seen numerical problems with it in the past.


richpaj November 11, 2008 13:42

on reflection I don't think th
on reflection I don't think the above helps. I'll test some of the alternatives you mentioned before



henry November 11, 2008 14:41 is effectively the same is effectively the same as using "dev2". The consistency issue arises because "laplacian" uses a compact molecule and "grad(div" has to use an extended molecule. The only numerically consistent approach is to use the extended molecule for all three terms but then you loose the advantage of the compact molecule for "laplacian".


richpaj November 14, 2008 00:13

for the flow under considerati
for the flow under consideration, there does indeed appear to be some difference implementing "dev2" instead of "dev", most notably though the collapse of the pressure.

I've reverted to using "dev" for the duration but will attempt one of your alternative formulations if numerical difficulties persist.

Many thanks,


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