linearRadial.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "linearRadial.H"
30 
31 namespace Foam
32 {
33 namespace extrudeModels
34 {
35 
36 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 
38 defineTypeNameAndDebug(linearRadial, 0);
39 
40 addToRunTimeSelectionTable(extrudeModel, linearRadial, dictionary);
41 
42 
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 
46 :
47  extrudeModel(typeName, dict),
48  R_(coeffDict_.get<scalar>("R")),
49  Rsurface_(coeffDict_.lookupOrDefault<scalar>("Rsurface", -1))
50 {}
51 
52 
53 // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
54 
55 point linearRadial::operator()
56 (
57  const point& surfacePoint,
58  const vector& surfaceNormal,
59  const label layer
60 ) const
61 {
62  // radius of the surface
63  scalar rs = mag(surfacePoint);
64  vector rsHat = surfacePoint/rs;
65 
66  if (Rsurface_ >= 0) rs = Rsurface_;
67 
68  scalar r = rs + (R_ - rs)*sumThickness(layer);
69  return r*rsHat;
70 }
71 
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 } // End namespace extrudeModels
76 } // End namespace Foam
77 
78 // ************************************************************************* //
Foam::extrudeModels::defineTypeNameAndDebug
defineTypeNameAndDebug(cyclicSector, 0)
Foam::extrudeModel
Top level extrusion model class.
Definition: extrudeModel.H:76
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::extrudeModels::linearRadial::linearRadial
linearRadial(const dictionary &dict)
Construct from dictionary.
Definition: linearRadial.C:45
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::extrudeModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(extrudeModel, cyclicSector, dictionary)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Vector< scalar >
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
linearRadial.H