FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include <OpenFOAM/error.H>
00027 
00028 #include "standardDragModel.H"
00029 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00030 
00031 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00032 
00033 namespace Foam
00034 {
00035 
00036 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00037 
00038 defineTypeNameAndDebug(standardDragModel, 0);
00039 
00040 addToRunTimeSelectionTable
00041 (
00042     dragModel,
00043     standardDragModel,
00044     dictionary
00045 );
00046 
00047 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00048 
00049 // Construct from components
00050 standardDragModel::standardDragModel
00051 (
00052     const dictionary& dict
00053 )
00054 :
00055     dragModel(dict),
00056     dragDict_(dict.subDict(typeName + "Coeffs")),
00057     preReFactor_(readScalar(dragDict_.lookup("preReFactor"))),
00058     ReExponent_(readScalar(dragDict_.lookup("ReExponent"))),
00059     ReLimiter_(readScalar(dragDict_.lookup("ReLimiter"))),
00060     CdLimiter_(readScalar(dragDict_.lookup("CdLimiter"))),
00061     Cdistort_(readScalar(dragDict_.lookup("Cdistort")))
00062 {}
00063 
00064 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00065 
00066 standardDragModel::~standardDragModel()
00067 {}
00068 
00069 
00070 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00071 
00072 scalar standardDragModel::Cd
00073 (
00074     const scalar Re,
00075     const scalar dev
00076 ) const
00077 {
00078     scalar drag = CdLimiter_;
00079 
00080     if (Re < ReLimiter_)
00081     {
00082         drag =  24.0*(1.0 + preReFactor_*pow(Re, ReExponent_))/Re;
00083     }
00084 
00085     // correct for deviation from sphericity
00086     drag *= (1.0 + Cdistort_*dev);
00087 
00088     return drag;
00089 
00090 }
00091 
00092 
00093 scalar standardDragModel::relaxationTime
00094 (
00095     const vector& URel,
00096     const scalar diameter,
00097     const scalar rho,
00098     const scalar liquidDensity,
00099     const scalar nu,
00100     const scalar dev
00101 ) const
00102 {
00103 
00104     scalar time = GREAT;
00105     scalar Re = mag(URel)*diameter/nu;
00106 
00107     if (Re > 0.1)
00108     {
00109         time = 4.0*liquidDensity*diameter /
00110         (
00111             3.0*rho*Cd(Re, dev)*mag(URel)
00112         );
00113     }
00114     else
00115     {
00116         // for small Re number, the relative velocity is both in
00117         // the nominator and denominator
00118         // use Cd = 24/Re and remove the SMALL/SMALL
00119         // expression for the velocities
00120         time = liquidDensity*diameter*diameter/(18*rho*nu*(1.0 + Cdistort_*dev));
00121     }
00122     return time;
00123 }
00124 
00125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00126 
00127 } // End namespace Foam
00128 
00129 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines