From 683465062ddf7e08dfdac0f8e8e35df58dc8f39c Mon Sep 17 00:00:00 2001
From: andy <a.heather@opencfd.co.uk>
Date: Tue, 24 Jun 2008 10:19:59 +0100
Subject: [PATCH] updated and relocated turbulence eps and omega boundary
 conditions

---
 src/finiteVolume/Make/files                   |   2 -
 .../RAS/compressible/Make/files               |   6 +
 .../RAS/compressible/RASModel/RASModel.H      |   2 +-
 ...thDissipationRateInletFvPatchScalarField.C |  14 +-
 ...thDissipationRateInletFvPatchScalarField.H |   0
 ...ngLengthFrequencyInletFvPatchScalarField.C |  14 +-
 ...ngLengthFrequencyInletFvPatchScalarField.H |   0
 .../RAS/incompressible/Make/files             |   6 +
 .../RAS/incompressible/RASModel/RASModel.H    |   2 +-
 ...thDissipationRateInletFvPatchScalarField.C | 149 ++++++++++++++++
 ...thDissipationRateInletFvPatchScalarField.H | 163 +++++++++++++++++
 ...ngLengthFrequencyInletFvPatchScalarField.C | 155 ++++++++++++++++
 ...ngLengthFrequencyInletFvPatchScalarField.H | 168 ++++++++++++++++++
 13 files changed, 657 insertions(+), 24 deletions(-)
 rename src/{finiteVolume/fields/fvPatchFields/derived => turbulenceModels/RAS/compressible/derivedFvPatchFields}/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C (93%)
 rename src/{finiteVolume/fields/fvPatchFields/derived => turbulenceModels/RAS/compressible/derivedFvPatchFields}/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H (100%)
 rename src/{finiteVolume/fields/fvPatchFields/derived => turbulenceModels/RAS/compressible/derivedFvPatchFields}/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C (93%)
 rename src/{finiteVolume/fields/fvPatchFields/derived => turbulenceModels/RAS/compressible/derivedFvPatchFields}/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H (100%)
 create mode 100644 src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
 create mode 100644 src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H
 create mode 100644 src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
 create mode 100644 src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H

diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files
index c899636dceb..d0e560c73b9 100644
--- a/src/finiteVolume/Make/files
+++ b/src/finiteVolume/Make/files
@@ -103,8 +103,6 @@ $(derivedFvPatchFields)/timeVaryingUniformTotalPressure/timeVaryingUniformTotalP
 $(derivedFvPatchFields)/totalTemperature/totalTemperatureFvPatchScalarField.C
 $(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C
 $(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C
-$(derivedFvPatchFields)/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
-$(derivedFvPatchFields)/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
 $(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
 $(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
 
diff --git a/src/turbulenceModels/RAS/compressible/Make/files b/src/turbulenceModels/RAS/compressible/Make/files
index a04a7a9c0bc..aab9098c3db 100644
--- a/src/turbulenceModels/RAS/compressible/Make/files
+++ b/src/turbulenceModels/RAS/compressible/Make/files
@@ -1,3 +1,4 @@
+/* RAS turbulence models */
 RASModel/RASModel.C
 RASModel/newRASModel.C
 laminar/laminar.C
@@ -10,6 +11,11 @@ realizableKE/realizableKE.C
 SpalartAllmaras/SpalartAllmaras.C
 kOmegaSST/kOmegaSST.C
 
+/* Wall functions */
 wallFunctions/mutWallFunctions/mutStandardRoughWallFunction/mutStandardRoughWallFunctionFvPatchScalarField.C
 
+/* Patch fields */
+derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
+derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
+
 LIB = $(FOAM_LIBBIN)/libcompressibleRASModels
diff --git a/src/turbulenceModels/RAS/compressible/RASModel/RASModel.H b/src/turbulenceModels/RAS/compressible/RASModel/RASModel.H
index f18bfe5cd4b..06e3b6b8fb7 100644
--- a/src/turbulenceModels/RAS/compressible/RASModel/RASModel.H
+++ b/src/turbulenceModels/RAS/compressible/RASModel/RASModel.H
@@ -245,7 +245,7 @@ public:
             }
 
             //- Const access to the coefficients dictionary
-            const dictionary& coeffDict()
+            const dictionary& coeffDict() const
             {
                 return coeffDict_;
             }
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
similarity index 93%
rename from src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
rename to src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
index b24240aeda8..100ce04fcbd 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
+++ b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
@@ -29,6 +29,7 @@ License
 #include "fvPatchFieldMapper.H"
 #include "surfaceFields.H"
 #include "volFields.H"
+#include "RASModel.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -105,17 +106,10 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs()
     }
 
     // Lookup Cmu corresponding to the turbulence model selected
-    const dictionary& RASProperties = db().lookupObject<IOdictionary>
-    (
-        "RASProperties"
-    );
+    const compressible::RASModel& RAS =
+        db().lookupObject<compressible::RASModel>("RASProperties");
+    scalar Cmu = readScalar(RAS.coeffDict().lookup("Cmu"));
 
-    const dictionary& RASCoeffs = RASProperties.subDict
-    (
-        word(RASProperties.lookup("RASModel")) + "Coeffs"
-    );
-
-    scalar Cmu = readScalar(RASCoeffs.lookup("Cmu"));
     scalar Cmu75 = pow(Cmu, 0.75);
 
     const fvPatchField<scalar>& k =
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H
similarity index 100%
rename from src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H
rename to src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
similarity index 93%
rename from src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
rename to src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
index b0949830f73..eb3d271709a 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
+++ b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
@@ -29,6 +29,7 @@ License
 #include "fvPatchFieldMapper.H"
 #include "surfaceFields.H"
 #include "volFields.H"
+#include "RASModel.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -110,17 +111,10 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs()
     }
 
     // Lookup Cmu corresponding to the turbulence model selected
-    const dictionary& RASProperties = db().lookupObject<IOdictionary>
-    (
-        "RASProperties"
-    );
+    const compressible::RASModel& RAS =
+        db().lookupObject<compressible::RASModel>("RASProperties");
+    scalar Cmu = readScalar(RAS.coeffDict().lookup("Cmu"));
 
-    const dictionary& RASCoeffs = RASProperties.subDict
-    (
-        word(RASProperties.lookup("RASModel")) + "Coeffs"
-    );
-
-    scalar Cmu = readScalar(RASCoeffs.lookup("Cmu"));
     scalar Cmu25 = pow(Cmu, 0.25);
 
     const fvPatchField<scalar>& kp =
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H
similarity index 100%
rename from src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H
rename to src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H
diff --git a/src/turbulenceModels/RAS/incompressible/Make/files b/src/turbulenceModels/RAS/incompressible/Make/files
index e1ee8f4c189..c7746e7fd2b 100644
--- a/src/turbulenceModels/RAS/incompressible/Make/files
+++ b/src/turbulenceModels/RAS/incompressible/Make/files
@@ -1,3 +1,4 @@
+/* RAS turbulence models */
 RASModel/RASModel.C
 RASModel/newRASModel.C
 laminar/laminar.C
@@ -16,8 +17,13 @@ NonlinearKEShih/NonlinearKEShih.C
 LienLeschzinerLowRe/LienLeschzinerLowRe.C
 LamBremhorstKE/LamBremhorstKE.C
 
+/* Wall functions */
 wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C
 wallFunctions/nutWallFunctions/nutStandardWallFunction/nutStandardWallFunctionFvPatchScalarField.C
 wallFunctions/nutWallFunctions/nutStandardRoughWallFunction/nutStandardRoughWallFunctionFvPatchScalarField.C
 
+/* Patch fields */
+derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
+derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
+
 LIB = $(FOAM_LIBBIN)/libincompressibleRASModels
diff --git a/src/turbulenceModels/RAS/incompressible/RASModel/RASModel.H b/src/turbulenceModels/RAS/incompressible/RASModel/RASModel.H
index 9944d6ffe03..77ed3a35a4d 100644
--- a/src/turbulenceModels/RAS/incompressible/RASModel/RASModel.H
+++ b/src/turbulenceModels/RAS/incompressible/RASModel/RASModel.H
@@ -232,7 +232,7 @@ public:
             }
 
             //- Const access to the coefficients dictionary
-            const dictionary& coeffDict()
+            const dictionary& coeffDict() const
             {
                 return coeffDict_;
             }
diff --git a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
new file mode 100644
index 00000000000..b84182c6367
--- /dev/null
+++ b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
@@ -0,0 +1,149 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2006-2007 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the
+    Free Software Foundation; either version 2 of the License, or (at your
+    option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM; if not, write to the Free Software Foundation,
+    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#include "turbulentMixingLengthDissipationRateInletFvPatchScalarField.H"
+#include "addToRunTimeSelectionTable.H"
+#include "fvPatchFieldMapper.H"
+#include "surfaceFields.H"
+#include "volFields.H"
+#include "RASModel.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+turbulentMixingLengthDissipationRateInletFvPatchScalarField::
+turbulentMixingLengthDissipationRateInletFvPatchScalarField
+(
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF
+)
+:
+    fixedValueFvPatchField<scalar>(p, iF),
+    mixingLength_(0.001)
+{}
+
+turbulentMixingLengthDissipationRateInletFvPatchScalarField::
+turbulentMixingLengthDissipationRateInletFvPatchScalarField
+(
+    const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf,
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF,
+    const fvPatchFieldMapper& mapper
+)
+:
+    fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
+    mixingLength_(ptf.mixingLength_)
+{}
+
+turbulentMixingLengthDissipationRateInletFvPatchScalarField::
+turbulentMixingLengthDissipationRateInletFvPatchScalarField
+(
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF,
+    const dictionary& dict
+)
+:
+    fixedValueFvPatchField<scalar>(p, iF, dict),
+    mixingLength_(readScalar(dict.lookup("mixingLength")))
+{}
+
+turbulentMixingLengthDissipationRateInletFvPatchScalarField::
+turbulentMixingLengthDissipationRateInletFvPatchScalarField
+(
+    const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf
+)
+:
+    fixedValueFvPatchField<scalar>(ptf),
+    mixingLength_(ptf.mixingLength_)
+{}
+
+turbulentMixingLengthDissipationRateInletFvPatchScalarField::
+turbulentMixingLengthDissipationRateInletFvPatchScalarField
+(
+    const turbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf,
+    const DimensionedField<scalar, volMesh>& iF
+)
+:
+    fixedValueFvPatchField<scalar>(ptf, iF),
+    mixingLength_(ptf.mixingLength_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs()
+{
+    if (updated())
+    {
+        return;
+    }
+
+    // Lookup Cmu corresponding to the turbulence model selected
+    const incompressible::RASModel& RAS =
+        db().lookupObject<incompressible::RASModel>("RASProperties");
+    scalar Cmu = readScalar(RAS.coeffDict().lookup("Cmu"));
+
+    scalar Cmu75 = pow(Cmu, 0.75);
+
+    const fvPatchField<scalar>& k =
+        patch().lookupPatchField<volScalarField, scalar>("k");
+
+    operator==(Cmu75*k*sqrt(k)/mixingLength_);
+
+    fixedValueFvPatchField<scalar>::updateCoeffs();
+}
+
+
+void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write
+(
+    Ostream& os
+) const
+{
+    fvPatchField<scalar>::write(os);
+    os.writeKeyword("mixingLength")
+        << mixingLength_ << token::END_STATEMENT << nl;
+    writeEntry("value", os);
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeField
+(
+    fvPatchScalarField,
+    turbulentMixingLengthDissipationRateInletFvPatchScalarField
+);
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H
new file mode 100644
index 00000000000..74991260159
--- /dev/null
+++ b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H
@@ -0,0 +1,163 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2006-2007 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the
+    Free Software Foundation; either version 2 of the License, or (at your
+    option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM; if not, write to the Free Software Foundation,
+    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Class
+    Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField
+
+Description
+    Calculate epsilon via the mixing length [m]
+
+    Example of the boundary condition specification:
+    @verbatim
+        inlet
+        {
+            type            turbulentMixingLengthDissipationRateInlet;
+            mixingLength    0.005;         // 5 mm
+            value           uniform 200;   // placeholder
+        }
+    @endverbatim
+
+SourceFiles
+    turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef turbulentMixingLengthDissipationRateInletFvPatchScalarField_H
+#define turbulentMixingLengthDissipationRateInletFvPatchScalarField_H
+
+#include "fixedValueFvPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+       Class turbulentMixingLengthDissipationRateInletFvPatch Declaration
+\*---------------------------------------------------------------------------*/
+
+class turbulentMixingLengthDissipationRateInletFvPatchScalarField
+:
+    public fixedValueFvPatchScalarField
+{
+    // Private data
+
+        //- turbulent length scale
+        scalar mixingLength_;
+
+public:
+
+    //- Runtime type information
+    TypeName("turbulentMixingLengthDissipationRateInlet");
+
+
+    // Constructors
+
+        //- Construct from patch and internal field
+        turbulentMixingLengthDissipationRateInletFvPatchScalarField
+        (
+            const fvPatch&,
+            const DimensionedField<scalar, volMesh>&
+        );
+
+        //- Construct from patch, internal field and dictionary
+        turbulentMixingLengthDissipationRateInletFvPatchScalarField
+        (
+            const fvPatch&,
+            const DimensionedField<scalar, volMesh>&,
+            const dictionary&
+        );
+
+        //- Construct by mapping given
+        //  turbulentMixingLengthDissipationRateInletFvPatchScalarField
+        //  onto a new patch
+        turbulentMixingLengthDissipationRateInletFvPatchScalarField
+        (
+            const turbulentMixingLengthDissipationRateInletFvPatchScalarField&,
+            const fvPatch&,
+            const DimensionedField<scalar, volMesh>&,
+            const fvPatchFieldMapper&
+        );
+
+        //- Construct as copy
+        turbulentMixingLengthDissipationRateInletFvPatchScalarField
+        (
+            const turbulentMixingLengthDissipationRateInletFvPatchScalarField&
+        );
+
+        //- Construct and return a clone
+        virtual tmp<fvPatchScalarField> clone() const
+        {
+            return tmp<fvPatchScalarField>
+            (
+                new turbulentMixingLengthDissipationRateInletFvPatchScalarField
+                (
+                    *this
+                )
+            );
+        }
+
+        //- Construct as copy setting internal field reference
+        turbulentMixingLengthDissipationRateInletFvPatchScalarField
+        (
+            const turbulentMixingLengthDissipationRateInletFvPatchScalarField&,
+            const DimensionedField<scalar, volMesh>&
+        );
+
+        //- Construct and return a clone setting internal field reference
+        virtual tmp<fvPatchScalarField> clone
+        (
+            const DimensionedField<scalar, volMesh>& iF
+        ) const
+        {
+            return tmp<fvPatchScalarField>
+            (
+                new turbulentMixingLengthDissipationRateInletFvPatchScalarField
+                (
+                    *this,
+                    iF
+                )
+            );
+        }
+
+
+    // Member functions
+
+        //- Update the coefficients associated with the patch field
+        virtual void updateCoeffs();
+
+        //- Write
+        virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
new file mode 100644
index 00000000000..2cb553c5c5c
--- /dev/null
+++ b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
@@ -0,0 +1,155 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2006-2007 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the
+    Free Software Foundation; either version 2 of the License, or (at your
+    option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM; if not, write to the Free Software Foundation,
+    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+\*---------------------------------------------------------------------------*/
+
+#include "turbulentMixingLengthFrequencyInletFvPatchScalarField.H"
+#include "addToRunTimeSelectionTable.H"
+#include "fvPatchFieldMapper.H"
+#include "surfaceFields.H"
+#include "volFields.H"
+#include "RASModel.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+turbulentMixingLengthFrequencyInletFvPatchScalarField::
+turbulentMixingLengthFrequencyInletFvPatchScalarField
+(
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF
+)
+:
+    fixedValueFvPatchField<scalar>(p, iF),
+    mixingLength_(0.0),
+    kName_("undefined-k")
+{}
+
+turbulentMixingLengthFrequencyInletFvPatchScalarField::
+turbulentMixingLengthFrequencyInletFvPatchScalarField
+(
+    const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf,
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF,
+    const fvPatchFieldMapper& mapper
+)
+:
+    fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
+    mixingLength_(ptf.mixingLength_),
+    kName_(ptf.kName_)
+{}
+
+turbulentMixingLengthFrequencyInletFvPatchScalarField::
+turbulentMixingLengthFrequencyInletFvPatchScalarField
+(
+    const fvPatch& p,
+    const DimensionedField<scalar, volMesh>& iF,
+    const dictionary& dict
+)
+:
+    fixedValueFvPatchField<scalar>(p, iF, dict),
+    mixingLength_(readScalar(dict.lookup("mixingLength"))),
+    kName_(dict.lookup("k"))
+{}
+
+turbulentMixingLengthFrequencyInletFvPatchScalarField::
+turbulentMixingLengthFrequencyInletFvPatchScalarField
+(
+    const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf
+)
+:
+    fixedValueFvPatchField<scalar>(ptf),
+    mixingLength_(ptf.mixingLength_),
+    kName_(ptf.kName_)
+{}
+
+turbulentMixingLengthFrequencyInletFvPatchScalarField::
+turbulentMixingLengthFrequencyInletFvPatchScalarField
+(
+    const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf,
+    const DimensionedField<scalar, volMesh>& iF
+)
+:
+    fixedValueFvPatchField<scalar>(ptf, iF),
+    mixingLength_(ptf.mixingLength_),
+    kName_(ptf.kName_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs()
+{
+    if (updated())
+    {
+        return;
+    }
+
+    // Lookup Cmu corresponding to the turbulence model selected
+    const incompressible::RASModel& RAS =
+        db().lookupObject<incompressible::RASModel>("RASProperties");
+    scalar Cmu = readScalar(RAS.coeffDict().lookup("Cmu"));
+
+    scalar Cmu25 = pow(Cmu, 0.25);
+
+    const fvPatchField<scalar>& kp =
+        patch().lookupPatchField<volScalarField, scalar>(kName_);
+
+    operator==(sqrt(kp)/(Cmu25*mixingLength_));
+
+    fixedValueFvPatchField<scalar>::updateCoeffs();
+}
+
+
+void turbulentMixingLengthFrequencyInletFvPatchScalarField::write
+(
+    Ostream& os
+) const
+{
+    fvPatchField<scalar>::write(os);
+    os.writeKeyword("mixingLength")
+        << mixingLength_ << token::END_STATEMENT << nl;
+    os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl;
+    writeEntry("value", os);
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeField
+(
+    fvPatchScalarField,
+    turbulentMixingLengthFrequencyInletFvPatchScalarField
+);
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H
new file mode 100644
index 00000000000..b5627099685
--- /dev/null
+++ b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H
@@ -0,0 +1,168 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2006-2007 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the
+    Free Software Foundation; either version 2 of the License, or (at your
+    option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM; if not, write to the Free Software Foundation,
+    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Class
+    Foam::turbulentMixingLengthFrequencyInletFvPatchScalarField
+
+Description
+    Calculate omega via the mixing length
+
+    Example of the boundary condition specification:
+    @verbatim
+        inlet
+        {
+            type            turbulentMixingLengthFrequencyInlet;
+            mixingLength    0.005;         // 5 mm
+            k               k;             // turbulent k field
+            value           uniform 5;     // initial value
+        }
+    @endverbatim
+
+SourceFiles
+    turbulentMixingLengthFrequencyInletFvPatchScalarField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef turbulentMixingLengthFrequencyInletFvPatchScalarField_H
+#define turbulentMixingLengthFrequencyInletFvPatchScalarField_H
+
+#include "fixedValueFvPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+    Class turbulentMixingLengthFrequencyInletFvPatchScalarField Declaration
+\*---------------------------------------------------------------------------*/
+
+class turbulentMixingLengthFrequencyInletFvPatchScalarField
+:
+    public fixedValueFvPatchScalarField
+{
+    // Private data
+
+        //- Turbulent length scale
+        scalar mixingLength_;
+
+        //- Name of the turbulent kinetic energy field
+        word kName_;
+
+
+public:
+
+    //- Runtime type information
+    TypeName("turbulentMixingLengthFrequencyInlet");
+
+
+    // Constructors
+
+        //- Construct from patch and internal field
+        turbulentMixingLengthFrequencyInletFvPatchScalarField
+        (
+            const fvPatch&,
+            const DimensionedField<scalar, volMesh>&
+        );
+
+        //- Construct from patch, internal field and dictionary
+        turbulentMixingLengthFrequencyInletFvPatchScalarField
+        (
+            const fvPatch&,
+            const DimensionedField<scalar, volMesh>&,
+            const dictionary&
+        );
+
+        //- Construct by mapping given
+        //  turbulentMixingLengthFrequencyInletFvPatchScalarField
+        //  onto a new patch
+        turbulentMixingLengthFrequencyInletFvPatchScalarField
+        (
+            const turbulentMixingLengthFrequencyInletFvPatchScalarField&,
+            const fvPatch&,
+            const DimensionedField<scalar, volMesh>&,
+            const fvPatchFieldMapper&
+        );
+
+        //- Construct as copy
+        turbulentMixingLengthFrequencyInletFvPatchScalarField
+        (
+            const turbulentMixingLengthFrequencyInletFvPatchScalarField&
+        );
+
+        //- Construct and return a clone
+        virtual tmp<fvPatchScalarField> clone() const
+        {
+            return tmp<fvPatchScalarField>
+            (
+                new turbulentMixingLengthFrequencyInletFvPatchScalarField
+                (
+                    *this
+                )
+            );
+        }
+
+        //- Construct as copy setting internal field reference
+        turbulentMixingLengthFrequencyInletFvPatchScalarField
+        (
+            const turbulentMixingLengthFrequencyInletFvPatchScalarField&,
+            const DimensionedField<scalar, volMesh>&
+        );
+
+        //- Construct and return a clone setting internal field reference
+        virtual tmp<fvPatchScalarField> clone
+        (
+            const DimensionedField<scalar, volMesh>& iF
+        ) const
+        {
+            return tmp<fvPatchScalarField>
+            (
+                new turbulentMixingLengthFrequencyInletFvPatchScalarField
+                (
+                    *this,
+                    iF
+                )
+            );
+        }
+
+
+    // Member functions
+
+        //- Update the coefficients associated with the patch field
+        virtual void updateCoeffs();
+
+        //- Write
+        virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
-- 
GitLab