Skip to content

Foam::eigenValues wrong behaviour for complex eigenvalues

The Foam::eigenValues(const tensor&) function sets an eigenvalue to 0 if it is complex:

https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/src/OpenFOAM/primitives/Tensor/tensor/tensor.C#L105

This is fundamentally flawed behaviour.

It should either return the complex eigenvalue or a FatalError.

I suggest a reimplementation of Foam::eigenValues which does not use cubicEqn::roots.

See e.g. here