FreeFOAM The Cross-Platform CFD Toolkit
standardDragModel.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include <OpenFOAM/error.H>
27 
28 #include "standardDragModel.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 
36 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 
39 
41 (
42  dragModel,
45 );
46 
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 
49 // Construct from components
51 (
52  const dictionary& dict
53 )
54 :
55  dragModel(dict),
56  dragDict_(dict.subDict(typeName + "Coeffs")),
57  preReFactor_(readScalar(dragDict_.lookup("preReFactor"))),
58  ReExponent_(readScalar(dragDict_.lookup("ReExponent"))),
59  ReLimiter_(readScalar(dragDict_.lookup("ReLimiter"))),
60  CdLimiter_(readScalar(dragDict_.lookup("CdLimiter"))),
61  Cdistort_(readScalar(dragDict_.lookup("Cdistort")))
62 {}
63 
64 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
65 
67 {}
68 
69 
70 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
71 
73 (
74  const scalar Re,
75  const scalar dev
76 ) const
77 {
78  scalar drag = CdLimiter_;
79 
80  if (Re < ReLimiter_)
81  {
82  drag = 24.0*(1.0 + preReFactor_*pow(Re, ReExponent_))/Re;
83  }
84 
85  // correct for deviation from sphericity
86  drag *= (1.0 + Cdistort_*dev);
87 
88  return drag;
89 
90 }
91 
92 
94 (
95  const vector& URel,
96  const scalar diameter,
97  const scalar rho,
98  const scalar liquidDensity,
99  const scalar nu,
100  const scalar dev
101 ) const
102 {
103 
104  scalar time = GREAT;
105  scalar Re = mag(URel)*diameter/nu;
106 
107  if (Re > 0.1)
108  {
109  time = 4.0*liquidDensity*diameter /
110  (
111  3.0*rho*Cd(Re, dev)*mag(URel)
112  );
113  }
114  else
115  {
116  // for small Re number, the relative velocity is both in
117  // the nominator and denominator
118  // use Cd = 24/Re and remove the SMALL/SMALL
119  // expression for the velocities
120  time = liquidDensity*diameter*diameter/(18*rho*nu*(1.0 + Cdistort_*dev));
121  }
122  return time;
123 }
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // ************************ vim: set sw=4 sts=4 et: ************************ //