CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Bugs

problem in eigenValues

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By huangxianbei

Reply
 
LinkBack Thread Tools Display Modes
Old   November 1, 2014, 05:26
Default problem in eigenValues
  #1
Senior Member
 
Huang Xianbei
Join Date: Sep 2013
Location: CAU,China
Posts: 266
Rep Power: 4
huangxianbei is on a distinguished road
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:

Last edited by wyldckat; January 31, 2015 at 11:19. Reason: repaired code that was incorrectly copy-pasted into the [CODE] markers
huangxianbei is offline   Reply With Quote

Old   November 1, 2014, 05:33
Default
  #2
Senior Member
 
Huang Xianbei
Join Date: Sep 2013
Location: CAU,China
Posts: 266
Rep Power: 4
huangxianbei is on a distinguished road
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 is offline   Reply With Quote

Old   November 1, 2014, 08:00
Default
  #3
Senior Member
 
Huang Xianbei
Join Date: Sep 2013
Location: CAU,China
Posts: 266
Rep Power: 4
huangxianbei is on a distinguished road
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
Tushar@cfd likes this.
huangxianbei is offline   Reply With Quote

Old   January 31, 2015, 11:26
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,312
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Xianbei,

Quote:
Originally Posted by huangxianbei View Post
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
wyldckat is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 05:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


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