From 8cabc8b543808ad9230e5a0bbe617ac1a19410e3 Mon Sep 17 00:00:00 2001
From: andy <a.heather@opencfd.co.uk>
Date: Tue, 19 Oct 2010 11:06:37 +0100
Subject: [PATCH] ENH: Added particle non-sphere drag model

---
 .../parcels/include/makeParcelDragModels.H    |   2 +
 .../Kinematic/DragModel/DragModel/DragModel.C |  20 ++-
 .../Kinematic/DragModel/DragModel/DragModel.H |  12 +-
 .../Kinematic/DragModel/NoDrag/NoDrag.C       |   2 +-
 .../DragModel/NonSphereDrag/NonSphereDrag.C   |  84 +++++++++++
 .../DragModel/NonSphereDrag/NonSphereDrag.H   | 142 ++++++++++++++++++
 .../DragModel/SphereDrag/SphereDrag.C         |   4 +-
 7 files changed, 261 insertions(+), 5 deletions(-)
 create mode 100644 src/lagrangian/intermediate/submodels/Kinematic/DragModel/NonSphereDrag/NonSphereDrag.C
 create mode 100644 src/lagrangian/intermediate/submodels/Kinematic/DragModel/NonSphereDrag/NonSphereDrag.H

diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelDragModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelDragModels.H
index a4c5e5f0981..d849b7833e8 100644
--- a/src/lagrangian/intermediate/parcels/include/makeParcelDragModels.H
+++ b/src/lagrangian/intermediate/parcels/include/makeParcelDragModels.H
@@ -31,6 +31,7 @@ License
 #include "KinematicCloud.H"
 
 #include "NoDrag.H"
+#include "NonSphereDrag.H"
 #include "SphereDrag.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -40,6 +41,7 @@ License
     makeDragModel(KinematicCloud<ParcelType>);                               \
                                                                              \
     makeDragModelType(NoDrag, KinematicCloud, ParcelType);                   \
+    makeDragModelType(NonSphereDrag, KinematicCloud, ParcelType);            \
     makeDragModelType(SphereDrag, KinematicCloud, ParcelType);
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C
index 28e0cef24c4..7bfc75ea28f 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C
@@ -27,14 +27,25 @@ License
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
+template<class CloudType>
+Foam::DragModel<CloudType>::DragModel(CloudType& owner)
+:
+    dict_(dictionary::null),
+    coeffDict_(dictionary::null),
+    owner_(owner)
+{}
+
+
 template<class CloudType>
 Foam::DragModel<CloudType>::DragModel
 (
     const dictionary& dict,
-    CloudType& owner
+    CloudType& owner,
+    const word& type
 )
 :
     dict_(dict),
+    coeffDict_(dict.subDict(type + "Coeffs")),
     owner_(owner)
 {}
 
@@ -62,6 +73,13 @@ const Foam::dictionary& Foam::DragModel<CloudType>::dict() const
 }
 
 
+template<class CloudType>
+const Foam::dictionary& Foam::DragModel<CloudType>::coeffDict() const
+{
+    return coeffDict_;
+}
+
+
 template<class CloudType>
 Foam::scalar Foam::DragModel<CloudType>::utc
 (
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H
index e60126e1d06..e4fa349f8dc 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H
@@ -57,6 +57,9 @@ class DragModel
         //- The cloud dictionary
         const dictionary& dict_;
 
+        //- The model coefficients dictionary
+        const dictionary& coeffDict_;
+
         //- Reference to the owner cloud class
         CloudType& owner_;
 
@@ -82,11 +85,15 @@ public:
 
     // Constructors
 
+        //- Construct null from owner
+        DragModel(CloudType& owner);
+
         //- Construct from components
         DragModel
         (
             const dictionary& dict,
-            CloudType& owner
+            CloudType& owner,
+            const word& type
         );
 
 
@@ -110,6 +117,9 @@ public:
         //- Return the dictionary
         const dictionary& dict() const;
 
+        //- Return the coefficients dictionary
+        const dictionary& coeffDict() const;
+
 
     // Member Functions
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/NoDrag/NoDrag.C b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/NoDrag/NoDrag.C
index d76a5bb8c36..584abfbac22 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/NoDrag/NoDrag.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/NoDrag/NoDrag.C
@@ -30,7 +30,7 @@ License
 template <class CloudType>
 Foam::NoDrag<CloudType>::NoDrag(const dictionary& dict, CloudType& owner)
 :
-    DragModel<CloudType>(dict, owner)
+    DragModel<CloudType>(owner)
 {}
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/NonSphereDrag/NonSphereDrag.C b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/NonSphereDrag/NonSphereDrag.C
new file mode 100644
index 00000000000..a106e307a3a
--- /dev/null
+++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/NonSphereDrag/NonSphereDrag.C
@@ -0,0 +1,84 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2010-2010 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 "NonSphereDrag.H"
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+template<class CloudType>
+Foam::NonSphereDrag<CloudType>::NonSphereDrag
+(
+    const dictionary& dict,
+    CloudType& owner
+)
+:
+    DragModel<CloudType>(dict, owner, typeName),
+    phi_(readScalar(this->coeffDict().lookup("phi"))),
+    a_(exp(2.3288 - 6.4581*phi_ + 2.4486*sqr(phi_))),
+    b_(0.0964 + 0.5565*phi_),
+    c_(exp(4.9050 - 13.8944*phi_ + 18.4222*sqr(phi_) - 10.2599*pow3(phi_))),
+    d_(exp(1.4681 + 12.2584*phi_ - 20.7322*sqr(phi_) + 15.8855*pow3(phi_)))
+{
+    if (phi_ <= 0 || phi_ > 1)
+    {
+        FatalErrorIn
+        (
+            "NonSphereDrag<CloudType>::NonSphereDrag"
+            "("
+                "const dictionary&, "
+                "CloudType&"
+            ")"
+        )   << "Ratio of surface of sphere having same volume as particle to "
+            << "actual surface area of particle (phi) must be greater than 0 "
+            << "and less than or equal to 1" << exit(FatalError);
+    }
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+template<class CloudType>
+Foam::NonSphereDrag<CloudType>::~NonSphereDrag()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
+template<class CloudType>
+bool Foam::NonSphereDrag<CloudType>::active() const
+{
+    return true;
+}
+
+
+template<class CloudType>
+Foam::scalar Foam::NonSphereDrag<CloudType>::Cd(const scalar Re) const
+{
+    return 24.0/(Re + ROOTVSMALL)*(1.0 + a_*pow(Re, b_)) + Re*c_/(Re + d_);
+}
+
+
+// ************************************************************************* //
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/NonSphereDrag/NonSphereDrag.H b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/NonSphereDrag/NonSphereDrag.H
new file mode 100644
index 00000000000..095805d5e51
--- /dev/null
+++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/NonSphereDrag/NonSphereDrag.H
@@ -0,0 +1,142 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2010-2010 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::NonSphereDrag
+
+Description
+    Drag model for non-spherical particles.
+
+    Takes the form of
+
+        24.0/Re*(1.0 + a_*pow(Re, b_)) + Re*c_/(Re + d_);
+
+    Where a(phi), b(phi), c(phi) and d(phi) are model coefficients, with phi
+    defined as:
+
+              area of sphere with same volume as particle
+        phi = -------------------------------------------
+                       actual particle area
+
+    Equation used is Eqn (11) of reference below - good to within 2 to 4 % of
+    RMS values from experiment.
+
+    H and L also give a simplified model with greater error compared to
+    results from experiment - Eqn 12 - but since phi is presumed
+    constant, it offers little benefit.
+
+    Reference:
+    @verbatim
+        "Drag coefficient and terminal velocity of spherical and nonspherical
+        particles"
+        A. Haider and O. Levenspiel,
+        Powder Technology
+        Volume 58, Issue 1, May 1989, Pages 63-70
+    @endverbatim
+
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef NonSphereDrag_H
+#define NonSphereDrag_H
+
+#include "DragModel.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+/*---------------------------------------------------------------------------*\
+                        Class NonSphereDrag Declaration
+\*---------------------------------------------------------------------------*/
+
+template<class CloudType>
+class NonSphereDrag
+:
+    public DragModel<CloudType>
+{
+protected:
+
+    // Protected Data
+
+        //- Flag to indicate `Simple model'
+        bool simpleModel_;
+
+        //- Ratio of surface of sphere having same volume as particle to
+        //  actual surface area of particle (0 < phi <= 1)
+        scalar phi_;
+
+
+        // Model coefficients
+
+            scalar a_;
+
+            scalar b_;
+
+            scalar c_;
+
+            scalar d_;
+
+
+public:
+
+    //- Runtime type information
+    TypeName("NonSphereDrag");
+
+
+    // Constructors
+
+        //- Construct from dictionary
+        NonSphereDrag(const dictionary& dict, CloudType& owner);
+
+
+    //- Destructor
+    virtual ~NonSphereDrag();
+
+
+    // Member Functions
+
+        //- Flag to indicate whether model activates drag model
+        bool active() const;
+
+        //- Return drag coefficient
+        scalar Cd(const scalar Re) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+#   include "NonSphereDrag.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/SphereDrag/SphereDrag.C b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/SphereDrag/SphereDrag.C
index fafc2e3cb74..ba4253bfc95 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/SphereDrag/SphereDrag.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/SphereDrag/SphereDrag.C
@@ -30,11 +30,11 @@ License
 template <class CloudType>
 Foam::SphereDrag<CloudType>::SphereDrag
 (
-    const dictionary& dict,
+    const dictionary&,
     CloudType& owner
 )
 :
-    DragModel<CloudType>(dict, owner)
+    DragModel<CloudType>(owner)
 {}
 
 
-- 
GitLab