1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "sigmaRadial.H"
27 #include "addToRunTimeSelectionTable.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 namespace extrudeModels
36 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38 defineTypeNameAndDebug(sigmaRadial, 0);
40 addToRunTimeSelectionTable(extrudeModel, sigmaRadial, dictionary);
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 sigmaRadial::sigmaRadial(const dictionary& dict)
47 extrudeModel(typeName, dict),
48 RTbyg_(readScalar(coeffDict_.lookup("RTbyg"))),
49 pRef_(readScalar(coeffDict_.lookup("pRef"))),
50 pStrat_(readScalar(coeffDict_.lookup("pStrat")))
52 if (mag(expansionRatio() - 1.0) > SMALL)
54 WarningIn("sigmaRadial::sigmaRadial(const dictionary&)")
55 << "Ignoring expansionRatio setting." << endl;
60 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
62 sigmaRadial::~sigmaRadial()
66 // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
68 point sigmaRadial::operator()
70 const point& surfacePoint,
71 const vector& surfaceNormal,
75 // radius of the surface
76 scalar rs = mag(surfacePoint);
77 vector rsHat = surfacePoint/rs;
79 scalar p = pRef_ - layer*(pRef_ - pStrat_)/nLayers_;
80 scalar r = rs - RTbyg_*log(p/pRef_);
86 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 } // End namespace extrudeModels
89 } // End namespace Foam
91 // ************************************************************************* //