View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000261 | OpenFOAM | Bug | public | 2011-07-21 21:41 | 2012-01-03 17:37 |
Reporter | Assigned To | henry | |||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Platform | Linux | OS | Ubuntu | OS Version | 10.04 |
Summary | 0000261: Incorrect sorting of eigenvalues for lambda2-based vortex eduction | ||||
Description | In 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. | ||||
Tags | No tags attached. | ||||
|
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. |
|
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 |