View Issue Details

IDProjectCategoryView StatusLast Update
0000261OpenFOAMBugpublic2012-01-03 17:37
Reporteruser231Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
PlatformLinuxOSUbuntuOS Version10.04
Summary0000261: Incorrect sorting of eigenvalues for lambda2-based vortex eduction
DescriptionIn the eigenvalue calculation for tensors, the eigenvalues are sorted with increasing absolute value:

00185 // Sort the eigenvalues into ascending order
00186 if (mag(i) > mag(ii))
00187 {
00188 Swap(i, ii);
00189 }
00190
00191 if (mag(ii) > mag(iii))
00192 {
00193 Swap(ii, iii);
00194 }
00195
00196 if (mag(i) > mag(ii))
00197 {
00198 Swap(i, ii);
00199 }
00200
00201 return vector(i, ii, iii);

whereas, by definition in Jeong and Hussain [1], the lambda2 criterion for vortex eduction is based on the existence of two negative eigenvalues. The proper way to detect this is to sort the eigenvalues by increasing/decreasing value (not absolute value) and test the sign of the second eigenvalue. This is done in Lambda2.C, with the y-component (second eigenvalue) written out to file:

-eigenValues(SSplusWW)().component(vector::Y)

However, for this to follow the vortex eduction technique of Jeong and Hussain [1], the eigenvalues should be sorted by increasing/decreasing value (not absolute value). Assuming the the Lambda2 utility is indeed designed for vortex eduction, I suggest that the mag() operators be taken out of the above eigenValue code or an appropriate re-sorting be added to the Lambda2 code be added if sorting by absolute value is needed elsewhere in FOAM.
Additional Information[1] Jeong, J., and Hussain, F., 1995, "On the Identification of a Vortex," J. Fluid Mech., vol. 285, pp. 69-94.
TagsNo tags attached.

Activities

henry

2011-07-21 22:30

manager   ~0000582

Many/most uses of eigenvalues require the ordering based on magnitude which is why that is hard-coded in eigenValues function but as you say the requirement for Lambda2 is unusual in this respect and the eigenvalues should be reordered. We will consider the best code structuring for this.

henry

2012-01-03 17:37

manager   ~0000892

Thanks for the bug-report. After careful consideration it appears that the other current uses of eigenvalues either are not sensitive to ordering or all the eigenvalues are positive and hence insensitive to the method of ordering and hence your proposal is fair and is applied to OpenFOAM-2.1.x by
commit abc79c09d672a93ab7272755fbe277908bc3c579

Issue History

Date Modified Username Field Change
2011-07-21 21:41 user231 New Issue
2011-07-21 22:30 henry Note Added: 0000582
2012-01-03 17:37 henry Note Added: 0000892
2012-01-03 17:37 henry Status new => resolved
2012-01-03 17:37 henry Resolution open => fixed
2012-01-03 17:37 henry Assigned To => henry