OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

standardDragModel.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "error.H"
00028 
00029 #include "standardDragModel.H"
00030 #include "addToRunTimeSelectionTable.H"
00031 
00032 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00033 
00034 namespace Foam
00035 {
00036 
00037 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00038 
00039 defineTypeNameAndDebug(standardDragModel, 0);
00040 
00041 addToRunTimeSelectionTable
00042 (
00043     dragModel,
00044     standardDragModel,
00045     dictionary
00046 );
00047 
00048 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00049 
00050 // Construct from components
00051 standardDragModel::standardDragModel
00052 (
00053     const dictionary& dict
00054 )
00055 :
00056     dragModel(dict),
00057     dragDict_(dict.subDict(typeName + "Coeffs")),
00058     preReFactor_(readScalar(dragDict_.lookup("preReFactor"))),
00059     ReExponent_(readScalar(dragDict_.lookup("ReExponent"))),
00060     ReLimiter_(readScalar(dragDict_.lookup("ReLimiter"))),
00061     CdLimiter_(readScalar(dragDict_.lookup("CdLimiter"))),
00062     Cdistort_(readScalar(dragDict_.lookup("Cdistort")))
00063 {}
00064 
00065 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00066 
00067 standardDragModel::~standardDragModel()
00068 {}
00069 
00070 
00071 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00072 
00073 scalar standardDragModel::Cd
00074 (
00075     const scalar Re,
00076     const scalar dev
00077 ) const
00078 {
00079     scalar drag = CdLimiter_;
00080 
00081     if (Re < ReLimiter_)
00082     {
00083         drag =  24.0*(1.0 + preReFactor_*pow(Re, ReExponent_))/Re;
00084     }
00085 
00086     // correct for deviation from sphericity
00087     drag *= (1.0 + Cdistort_*dev);
00088 
00089     return drag;
00090 
00091 }
00092 
00093 
00094 scalar standardDragModel::relaxationTime
00095 (
00096     const vector& URel,
00097     const scalar diameter,
00098     const scalar rho,
00099     const scalar liquidDensity,
00100     const scalar nu,
00101     const scalar dev
00102 ) const
00103 {
00104 
00105     scalar time = GREAT;
00106     scalar Re = mag(URel)*diameter/nu;
00107 
00108     if (Re > 0.1)
00109     {
00110         time = 4.0*liquidDensity*diameter /
00111         (
00112             3.0*rho*Cd(Re, dev)*mag(URel)
00113         );
00114     }
00115     else
00116     {
00117         // for small Re number, the relative velocity is both in
00118         // the nominator and denominator
00119         // use Cd = 24/Re and remove the SMALL/SMALL
00120         // expression for the velocities
00121         time = liquidDensity*diameter*diameter/(18*rho*nu*(1.0 + Cdistort_*dev));
00122     }
00123     return time;
00124 }
00125 
00126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00127 
00128 } // End namespace Foam
00129 
00130 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd