initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / turbulenceModels / LES / LESdeltas / PrandtlDelta / PrandtlDelta.C
blobc7bf1c4740a2ae555c4e73d821759ed4d66bf4f9
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 "PrandtlDelta.H"
28 #include "wallDist.H"
29 #include "addToRunTimeSelectionTable.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 namespace Foam
36 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38 defineTypeNameAndDebug(PrandtlDelta, 0);
39 addToRunTimeSelectionTable(LESdelta, PrandtlDelta, dictionary);
42 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
44 void PrandtlDelta::calcDelta()
46     delta_ = min
47     (
48         static_cast<const volScalarField&>(geometricDelta_()),
49         (kappa_/Cdelta_)*wallDist(mesh_).y()
50     );
54 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
56 PrandtlDelta::PrandtlDelta
58     const word& name,
59     const fvMesh& mesh,
60     const dictionary& dd
63     LESdelta(name, mesh),
64     geometricDelta_(LESdelta::New(name, mesh, dd.subDict(type() + "Coeffs"))),
65     kappa_(dimensionedScalar(dd.lookup("kappa")).value()),
66     Cdelta_
67     (
68         dimensionedScalar(dd.subDict(type() + "Coeffs").lookup("Cdelta"))
69        .value()
70     )
72     calcDelta();
76 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
78 void PrandtlDelta::read(const dictionary& d)
80     const dictionary& dd(d.subDict(type() + "Coeffs"));
82     geometricDelta_().read(dd);
83     kappa_ = dimensionedScalar(d.lookup("kappa")).value();
84     Cdelta_ = dimensionedScalar(dd.lookup("Cdelta")).value();
85     calcDelta();
89 void PrandtlDelta::correct()
91     geometricDelta_().correct();
93     if (mesh_.changing())
94     {
95         calcDelta();
96     }
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 } // End namespace Foam
104 // ************************************************************************* //