CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   zero and complex eigenvalues in symmTensor (

ngj June 16, 2010 08:37

zero and complex eigenvalues in symmTensor
Hi all

When I am trying to run my case with


    default        cellLimited fourth 1;

in stead of


    default        Gauss linear;

i get the following error:


zero and complex eigenvalues in symmTensor: (2 2.80132e-09 3.74154e-24 2 -5.74733e-16 2.09154e-31)

    From function eigenValues(const symmTensor&)
    in file primitives/tensor/tensor.C at line 331.

FOAM aborting


I have also tried without the limiting functionality and it appears that using a non-Gauss schemes causes a crash. Further, I have tried setting this scheme on the individual gradient terms one by one and they all produce the above error. Is it mesh related?

Any help or suggestions are highly appreciated.

Best regards,


P.S. I have cut down the problem to a bucket of water solved using interFoam. The 'bucket' has a sloping bed penetrating the water surface and the problem persists.

ngj June 16, 2010 10:52


A small update on this. I have a case, where the bed i moving, however it does not start moving until t = 10s. Everything runs smoothly until t = 10s, where the simulation aborts with the above error message.

Does this not suggest that it is mesh related? But how?

Best regards,


deepsterblue June 16, 2010 15:01

Which version are you using? Is it OF-dev?
You may be facing a situation where the symmTensor inverse is ill-behaved (in which case, the hinv function may be necessary). The fourth-order least-squares gradient uses this information.

ngj June 16, 2010 15:37

Hi Sandeep,

Thanks for your reply. Yes, I am using 1.5-dev.

I follow as far that the symmTensor is ill-behaved, however could you help me understand from what information the symmTensor is constructed?

I suppose I then need to change a couple of lines the appropriate places and recompile to use hinv?

Best regards,


deepsterblue June 16, 2010 15:44

I assume this is a moving-mesh simulation? How does the cell-skewness look?
OF-dev already uses hinv, so that may not be the problem.

ngj June 16, 2010 16:25


The maximum skewness is 0.013, however the maximum high aspect ratio is 3100, which I know is quite high (boundary layer resolved). Could this cause the problem? Otherwise the mesh is hex-structured.

It is a moving mesh simulation with wave generation, however I turned everything off and merely has a computation of the static pressure field, and the error still occurs.

Best regards,


ngj June 17, 2010 14:09


To follow up on my problem, I have isolated the problem. The eigenvalue problem solved using Matlab gives the eigenvalues:



however following the methods implemented in OF both yields



using those results obtained if if-sentences on the lines 320 and 344 in OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/primitives/tensor/tensor.C is evaluated. However they are not evaluated to true, as in this specific case

line 316:

if (mag(c) < 1e-100) // as mag(c) = 1.5e-30
and line 344

if (R2 < Q3) // as R2 == Q3
This means that the limits in the eigenvalue evaluation causes the problems. Tomorrow I will try changing any of the limits and see if things change, however any qualified suggestions are appreciated.

For the record: The test case is 2D and the problem persist in both 32 and 64 bit. The eigenvector related to the zero eigenvalue is in the direction of the empty-direction.

Thanks for the attention,


tcarrigan January 5, 2011 17:12

Hi Niels,

I ended up getting the same error you did: zero and complex eigenvalues in symmTensor...

My case is very simple, turbulent flow over a flat plate. After noticing your concern about a possible high aspect ratio issue, I decided to to do a little experiment. My original case that gave me an error had a maximum aspect ratio of 16,000. After reducing the aspect ratio to about 1000, the error went away and the case ran normally.

I've had issues in the past using OpenFOAM with high aspect ratio anisotropic tet elements in the boundary layer, but so far haven't come across a case that complains about high aspect ratio structured elements of this quality. It just seems that for a flow such as mine, where all the cells are perfectly orthogonal and flow aligned, the aspect ratio should not cause any issues.

Back to your original post. Have you solved the problem yet? Or come up with your own workaround?

ngj January 6, 2011 05:09

Hi Travis

My experience was that it was related to the solution of the eigenvalue problem and it is only a problem for 2D-computations. Do you experience the same?

I have not had the problem since I switched to cellMDLimited instead of cellLimited.

Hope it helps,


ngj January 6, 2011 05:11

B.T.W: The solution of the eigenvalue problem using the routine in 1.5-dev is the source of the problem, as switching to the previous version, which also floats around in 1.5.x remove the problem.



cnsidero January 24, 2011 01:46


I've run into the same problem as you in 1.6-ext running pimpleDyMFoam in 2D. It appears this issue is still there but I don't know the full consequences of adjusting the eigenvalue limits so I didn't change it (I also don't know what value to change it to). Interestingly, the same mesh had no issues with simpleFoam and MRFSimpleFoam.

I just re-extruded my grid in the third dimension so the aspect ratios were below a 1000 (max = 200 actually). I suppose it isn't a big deal to make sure the aspect ratio is below a 1000 when extruding in the third dimension but it's a lot nicer to work with it in the pre-processor because the patches are physically bigger and easier to select :-P


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