CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   problem in eigenValues (https://www.cfd-online.com/Forums/openfoam-bugs/143713-problem-eigenvalues.html)

huangxianbei November 1, 2014 04:26

problem in eigenValues
 
Hi,
I checked the way calculating eigenValues in OF 2.1.1and found a problem.

In OF,
Code:

scalar a = -t.xx() - t.yy() - t.zz();
00106
00107        scalar b = t.xx()*t.yy() + t.xx()*t.zz() + t.yy()*t.zz()
00108            - t.xy()*t.yx() - t.xz()*t.zx() - t.yz()*t.zy();
00109
00110        scalar c = - t.xx()*t.yy()*t.zz() - t.xy()*t.yz()*t.zx()
00111            - t.xz()*t.yx()*t.zy() + t.xz()*t.yy()*t.zx()
00112            + t.xy()*t.yx()*t.zz() + t.xx()*t.yz()*t.zy();

So a=-I_1=tr(T),b=I_2, c=-I_3

The eigenValues can be calculated as following:
http://www.brown.edu/Departments/Eng...s/eq0158MP.gif

huangxianbei November 1, 2014 04:33

let check it:
scalar Q = (a*a - 3*b)/9; 00137 scalar R = (2*a*a*a - 9*a*b + 27*c)/54;
scalar sqrtQ = sqrt(Q); 00146 scalar theta = acos(R/(Q*sqrtQ)); 00147 00148 scalar m2SqrtQ = -2*sqrtQ; 00149 scalar aBy3 = a/3;

So R=q/2;Q=-p/3;sqrtQ=sqrt(-p/3);theta=acos(R/(Q*sqrtQ))=acos(-3q*sqrt(-3/p)/(2p))
Then, the problem comes that theta is not equal to acos(3q*sqrt(-3/p)/2p) as in the above formulations in the picture
Is it a bug?

PS: why in OF, -lambda is returned instead of lambda?


Xianbei

huangxianbei November 1, 2014 07:00

after a further calculation, I found that it's right in OF if we list all the eigenValues.

for simplification, take 3q*sqrt(-3/p)/2p =x, in OF, theta = -x,
so according to OF, lambda (only the cosin term)should be:
1\ cos(1/3*arccos(theta)+2*pi/3)
2\ cos(1/3*arccos(theta))
3\ cos(1/3*arccos(theta)-2*pi/3)

if we use x instead
1\ cos(1/3*arccos(x)+2*pi/3)
2\ cos(1/3*arccos(x)-2*pi/3)
3\ cos(1/3*arccos(theta))

which is the same as in the original form.

So it's not a bug , but a misunderstanding of mine.

But I still want to ask: why is -lambda returned instead of lambda?

Xianbei

wyldckat January 31, 2015 10:26

Hi Xianbei,

Quote:

Originally Posted by huangxianbei (Post 516898)
But I still want to ask: why is -lambda returned instead of lambda?

Note sure why, but you might want to revisit this topic by checking the source code for OpenFOAM 2.3.x: https://github.com/OpenFOAM/OpenFOAM...ensor/tensor.C
I say this because of this bug report and subsequent fixes: http://www.openfoam.org/mantisbt/view.php?id=1373

Best regards,
Bruno


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