From 86f753b7bcce346df2fd5284e8dcf6cbf6d34814 Mon Sep 17 00:00:00 2001
From: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
Date: Wed, 23 Jun 2021 17:49:33 +0100
Subject: [PATCH] DOC: turbulenceFields: improve header documentation

---
 .../field/turbulenceFields/turbulenceFields.H | 46 +++++++++++++------
 .../turbulenceFieldsTemplates.C               |  7 +--
 2 files changed, 36 insertions(+), 17 deletions(-)

diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFields.H b/src/functionObjects/field/turbulenceFields/turbulenceFields.H
index 60d1b0263de..98cdacbfdd9 100644
--- a/src/functionObjects/field/turbulenceFields/turbulenceFields.H
+++ b/src/functionObjects/field/turbulenceFields/turbulenceFields.H
@@ -52,6 +52,15 @@ Description
 
     where \c \<Type\>=Scalar/SymmTensor.
 
+    References:
+    \verbatim
+        Estimation expressions for L (tag:P), Eq. 10.37:
+            Pope, S. B. (2000).
+            Turbulent flows.
+            Cambridge, UK: Cambridge Univ. Press
+            DOI:10.1017/CBO9780511840531
+    \endverbatim
+
 Usage
     Minimal example by using \c system/controlDict.functions:
     \verbatim
@@ -62,22 +71,26 @@ Usage
         libs        (fieldFunctionObjects);
 
         // Mandatory entries (runtime modifiable)
-        // Either field or fields entries
-        fields      (R devRhoReff);
-        field       R;
 
-        // Optional (inherited) entries
+            // Either of the below
+            // Option-1
+            fields      (R devRhoReff);
+
+            // Option-2
+            field       R;
+
+        // Inherited entries
         ...
     }
     \endverbatim
 
     where the entries mean:
     \table
-      Property     | Description                           | Type | Req'd | Dflt
-      type         | Type name: turbulenceFields           | word |  yes  | -
-      libs         | Library name: fieldFunctionObjects    | word |  yes  | -
+      Property     | Description                           | Type | Reqd | Deflt
+      type         | Type name: turbulenceFields           | word | yes  | -
+      libs         | Library name: fieldFunctionObjects    | word | yes  | -
       fields       | Names of fields to store (see below)  | wordList | yes | -
-      field        | Name of a field to store (see below)  | word | yes | -
+      field        | Name of a field to store (see below)  | word | yes  | -
     \endtable
 
     where \c fields can include:
@@ -107,10 +120,15 @@ Usage
         <solver> -postProcess -func turbulenceFields
     \endverbatim
 
+Note
+  - Multiphase applications are not supported.
+  - The governing expression of \c nuTilda is
+    an approximation based on a dimensional analysis.
+
 See also
-    - Foam::functionObject
-    - Foam::functionObjects::fvMeshFunctionObject
-    - ExtendedCodeGuide::functionObjects::field::turbulenceFields
+  - Foam::functionObject
+  - Foam::functionObjects::fvMeshFunctionObject
+  - ExtendedCodeGuide::functionObjects::field::turbulenceFields
 
 SourceFiles
     turbulenceFields.C
@@ -153,8 +171,8 @@ public:
             cfEpsilon,      //!< "Turbulent kinetic energy dissipation rate"
             cfOmega,        //!< "Specific dissipation rate"
             cfNuTilda,      //!< "Modified turbulent viscosity"
-            cfMut,          //!< "Turbulent viscosity"
-            cfMuEff,        //!< "Effective turbulent viscosity"
+            cfMut,          //!< "Turbulent dynamic viscosity"
+            cfMuEff,        //!< "Effective turbulent dynamic viscosity"
             cfAlphat,       //!< "Turbulence thermal diffusivity"
             cfAlphaEff,     //!< "Effective turbulence thermal diffusivity"
             cfR,            //!< "Reynolds stress tensor"
@@ -184,7 +202,7 @@ public:
         //- Names for incompressibleField turbulence fields
         static const Enum<incompressibleField> incompressibleFieldNames_;
 
-        //- Turbulence closure model name
+        //- Name of the turbulence properties dictionary
         static const word modelName_;
 
 
diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C b/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C
index e87440b46ef..90d0630e1d3 100644
--- a/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C
+++ b/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C
@@ -99,7 +99,7 @@ Foam::functionObjects::turbulenceFields::L
     const Model& model
 ) const
 {
-    // Assume k and epsilon are available
+    // (P:Eq. 10.37)
     const scalar Cmu = 0.09;
     const dimensionedScalar eps0(sqr(dimVelocity)/dimTime, SMALL);
 
@@ -118,9 +118,10 @@ Foam::functionObjects::turbulenceFields::I
     const Model& model
 ) const
 {
-    // Assume k is available
+    // (P:p. 183)
+    // root-mean-square of velocity fluctuations - isotropic turbulence
     const volScalarField uPrime(sqrt((2.0/3.0)*model.k()));
-    const dimensionedScalar U0("U0", dimVelocity, SMALL);
+    const dimensionedScalar U0(dimVelocity, SMALL);
 
     return tmp<volScalarField>::New
     (
-- 
GitLab