# problem in eigenValues

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

 November 1, 2014, 05:26 problem in eigenValues #1 Senior Member   Huang Xianbei Join Date: Sep 2013 Location: Yangzhou,China Posts: 283 Rep Power: 6 Sponsored Links 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

 November 1, 2014, 05:33 #2 Senior Member   Huang Xianbei Join Date: Sep 2013 Location: Yangzhou,China Posts: 283 Rep Power: 6 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

 November 1, 2014, 08:00 #3 Senior Member   Huang Xianbei Join Date: Sep 2013 Location: Yangzhou,China Posts: 283 Rep Power: 6 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.

January 31, 2015, 11:26
#4
Super Moderator

Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,978
Blog Entries: 39
Rep Power: 108
Hi Xianbei,

Quote:
 Originally Posted by huangxianbei 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
__________________

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43 JFDC FLUENT 1 July 11, 2011 05:59 Se-Hee CFX 2 June 10, 2007 06:29 ParodDav CFX 5 April 29, 2007 19:13 Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52