From ca460ffba2ce3bd9ab3bb5dcb4220c3375f940db Mon Sep 17 00:00:00 2001
From: Andrew Heather <a.heather@opencfd.co.uk>
Date: Fri, 27 Nov 2015 15:04:37 +0000
Subject: [PATCH] ENH: Turbulence - added new DESModel layer for DES models

---
 .../turbulenceModels/DES/DESModel/DESModel.C  |  76 ++++++++++++
 .../turbulenceModels/DES/DESModel/DESModel.H  | 117 ++++++++++++++++++
 .../DES/DESModel/DESModelBase.C               |  46 +++++++
 .../DES/DESModel/DESModelBase.H               |  81 ++++++++++++
 .../turbulenceModels/Make/files               |   4 +
 5 files changed, 324 insertions(+)
 create mode 100644 src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModel.C
 create mode 100644 src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModel.H
 create mode 100644 src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModelBase.C
 create mode 100644 src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModelBase.H

diff --git a/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModel.C b/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModel.C
new file mode 100644
index 00000000000..cd57c02597d
--- /dev/null
+++ b/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModel.C
@@ -0,0 +1,76 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2012-2015 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "DESModel.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace LESModels
+{
+
+// * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * * //
+
+template<class BasicTurbulenceModel>
+DESModel<BasicTurbulenceModel>::DESModel
+(
+    const word& type,
+    const alphaField& alpha,
+    const rhoField& rho,
+    const volVectorField& U,
+    const surfaceScalarField& alphaRhoPhi,
+    const surfaceScalarField& phi,
+    const transportModel& transport,
+    const word& propertiesName
+)
+:
+    LESeddyViscosity<BasicTurbulenceModel>
+    (
+        type,
+        alpha,
+        rho,
+        U,
+        alphaRhoPhi,
+        phi,
+        transport,
+        propertiesName
+    )
+{}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+template<class BasicTurbulenceModel>
+DESModel<BasicTurbulenceModel>::~DESModel()
+{}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace LESModels
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModel.H b/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModel.H
new file mode 100644
index 00000000000..1e27387650a
--- /dev/null
+++ b/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModel.H
@@ -0,0 +1,117 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2012-2015 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::DESModel
+
+Description
+    Templated abstract base class for DES models
+
+SourceFiles
+    DESModel.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef DESModel_H
+#define DESModel_H
+
+#include "DESModelBase.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace LESModels
+{
+
+/*---------------------------------------------------------------------------*\
+                          Class DESModel Declaration
+\*---------------------------------------------------------------------------*/
+
+template<class BasicTurbulenceModel>
+class DESModel
+:
+    public DESModelBase,
+    public LESeddyViscosity<BasicTurbulenceModel>
+{
+
+private:
+
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        DESModel(const DESModel&);
+
+        //- Disallow default bitwise assignment
+        DESModel& operator=(const DESModel&);
+
+
+public:
+
+    typedef typename BasicTurbulenceModel::alphaField alphaField;
+    typedef typename BasicTurbulenceModel::rhoField rhoField;
+    typedef typename BasicTurbulenceModel::transportModel transportModel;
+
+    // Constructors
+
+        //- Construct from components
+        DESModel
+        (
+            const word& type,
+            const alphaField& alpha,
+            const rhoField& rho,
+            const volVectorField& U,
+            const surfaceScalarField& alphaRhoPhi,
+            const surfaceScalarField& phi,
+            const transportModel& transport,
+            const word& propertiesName = turbulenceModel::propertiesName
+        );
+
+
+    //- Destructor
+    virtual ~DESModel();
+
+
+    // Public Member Functions
+
+        //- Return the LES field indicator
+        virtual tmp<volScalarField> LESRegion() const = 0;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace LESModels
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+    #include "DESModel.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModelBase.C b/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModelBase.C
new file mode 100644
index 00000000000..401c74a8684
--- /dev/null
+++ b/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModelBase.C
@@ -0,0 +1,46 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2015 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::DESModelBase
+
+Description
+    Base class for DES models providing an interfaces to the LESRegion
+    function.
+
+SourceFiles
+    DESModelBase.C
+
+\*---------------------------------------------------------------------------*/
+
+#include "DESModelBase.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+    defineTypeNameAndDebug(DESModelBase, 0);
+}
+
+
+// ************************************************************************* //
diff --git a/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModelBase.H b/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModelBase.H
new file mode 100644
index 00000000000..7378eab3062
--- /dev/null
+++ b/src/TurbulenceModels/turbulenceModels/DES/DESModel/DESModelBase.H
@@ -0,0 +1,81 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2015 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::DESModelBase
+
+Description
+    Base class for DES models providing an interfaces to the LESRegion
+    function.
+
+SourceFiles
+    DESModelBase.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef DESModelBase_H
+#define DESModelBase_H
+
+#include "className.H"
+#include "tmp.H"
+#include "volFieldsFwd.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+                        class DESModelBase Declaration
+\*---------------------------------------------------------------------------*/
+
+class DESModelBase
+{
+public:
+
+    //- Constructor
+    DESModelBase()
+    {}
+
+    //- Destructor
+    virtual ~DESModelBase()
+    {}
+
+    ClassName("DESModelBase");
+
+
+    // Public Member Functions
+
+        //- Return the LES field indicator
+        virtual tmp<volScalarField> LESRegion() const = 0;
+};
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/TurbulenceModels/turbulenceModels/Make/files b/src/TurbulenceModels/turbulenceModels/Make/files
index 028ed811b40..a22069a952d 100644
--- a/src/TurbulenceModels/turbulenceModels/Make/files
+++ b/src/TurbulenceModels/turbulenceModels/Make/files
@@ -20,6 +20,10 @@ $(LESfilters)/laplaceFilter/laplaceFilter.C
 $(LESfilters)/anisotropicFilter/anisotropicFilter.C
 
 
+/* Base class for DES models */
+DES/DESModel/DESModelBase.C
+
+
 /* Turbulence BCs */
 derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C
 derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C
-- 
GitLab