From a252677618928dff3b447478315255514f2aa02b Mon Sep 17 00:00:00 2001
From: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
Date: Mon, 25 Sep 2023 17:14:11 +0100
Subject: [PATCH] BUG: Lambda2: reverse the sign of the governing equation
 (fixes #2731)

---
 src/functionObjects/field/Lambda2/Lambda2.C |  5 ++--
 src/functionObjects/field/Lambda2/Lambda2.H | 31 +++++++++++----------
 2 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/src/functionObjects/field/Lambda2/Lambda2.C b/src/functionObjects/field/Lambda2/Lambda2.C
index f527212162f..a6ddc8b5970 100644
--- a/src/functionObjects/field/Lambda2/Lambda2.C
+++ b/src/functionObjects/field/Lambda2/Lambda2.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2013-2016 OpenFOAM Foundation
-    Copyright (C) 2019-2020 OpenCFD Ltd.
+    Copyright (C) 2019-2023 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -61,10 +61,11 @@ bool Foam::functionObjects::Lambda2::calc()
             )
         );
 
+        // (JH:p. 76-78)
         return store
         (
             resultName_,
-           -eigenValues(SSplusWW)().component(vector::Y)
+            eigenValues(SSplusWW)().component(vector::Y)
         );
     }
 
diff --git a/src/functionObjects/field/Lambda2/Lambda2.H b/src/functionObjects/field/Lambda2/Lambda2.H
index 65ee40d9f1b..934b52cfc2b 100644
--- a/src/functionObjects/field/Lambda2/Lambda2.H
+++ b/src/functionObjects/field/Lambda2/Lambda2.H
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2013-2016 OpenFOAM Foundation
-    Copyright (C) 2020 OpenCFD Ltd.
+    Copyright (C) 2020-2023 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -37,30 +37,39 @@ Description
     Operands:
     \table
       Operand          | Type           | Location
-      input            | volVectorField | $FOAM_CASE/\<time\>/\<inpField\>
+      input            | volVectorField | \<case\>/\<time\>/\<inpField\>
       output file      | -              | -
-      output field     | volScalarField | $FOAM_CASE/\<time\>/\<outField\>
+      output field     | volScalarField | \<case\>/\<time\>/\<outField\>
     \endtable
 
+    References:
+    \verbatim
+        Governing equation (tag:JH):
+            Jeong, J., & Hussain, F. (1995).
+            On the identification of a vortex.
+            Journal of Fluid Mechanics, 285, 69-94.
+            DOI:10.1017/S0022112095000462
+    \endverbatim
+
 Usage
     Minimal example by using \c system/controlDict.functions:
     \verbatim
     Lambda21
     {
-        // Mandatory entries (unmodifiable)
+        // Mandatory entries
         type            Lambda2;
         libs            (fieldFunctionObjects);
 
-        // Optional (inherited) entries
+        // Inherited entries
         ...
     }
     \endverbatim
 
     where the entries mean:
     \table
-      Property     | Description                        | Type | Req'd | Dflt
-      type         | Type name: Lambda2                 | word |  yes  | -
-      libs         | Library name: fieldFunctionObjects | word |  yes  | -
+      Property     | Description                        | Type | Reqd | Deflt
+      type         | Type name: Lambda2                 | word | yes  | -
+      libs         | Library name: fieldFunctionObjects | word | yes  | -
     \endtable
 
     The inherited entries are elaborated in:
@@ -72,12 +81,6 @@ Usage
         postProcess -func Lambda2
     \endverbatim
 
-See also
-    - Foam::functionObject
-    - Foam::functionObjects::fvMeshFunctionObject
-    - Foam::functionObjects::fieldExpression
-    - ExtendedCodeGuide::functionObjects::field::Lambda2
-
 SourceFiles
     Lambda2.C
 
-- 
GitLab