1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "cubeRootVolDelta.H"
28 #include "addToRunTimeSelectionTable.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 defineTypeNameAndDebug(cubeRootVolDelta, 0);
38 addToRunTimeSelectionTable(LESdelta, cubeRootVolDelta, dictionary);
41 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
43 void cubeRootVolDelta::calcDelta()
45 label nD = mesh().nGeometricD();
49 delta_.internalField() = deltaCoeff_*pow(mesh().V(), 1.0/3.0);
53 WarningIn("cubeRootVolDelta::calcDelta()")
54 << "Case is 2D, LES is not strictly applicable\n"
57 const Vector<label>& directions = mesh().geometricD();
59 scalar thickness = 0.0;
60 for (direction dir=0; dir<directions.nComponents; dir++)
62 if (directions[dir] == -1)
64 thickness = mesh().bounds().span()[dir];
69 delta_.internalField() = deltaCoeff_*sqrt(mesh().V()/thickness);
73 FatalErrorIn("cubeRootVolDelta::calcDelta()")
74 << "Case is not 3D or 2D, LES is not applicable"
80 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
82 cubeRootVolDelta::cubeRootVolDelta
90 deltaCoeff_(readScalar(dd.subDict(type() + "Coeffs").lookup("deltaCoeff")))
96 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98 void cubeRootVolDelta::read(const dictionary& dd)
100 dd.subDict(type() + "Coeffs").lookup("deltaCoeff") >> deltaCoeff_;
105 void cubeRootVolDelta::correct()
107 if (mesh_.changing())
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 } // End namespace Foam
118 // ************************************************************************* //