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

layerParameters.H

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 Class
00025     Foam::layerParameters
00026 
00027 Description
00028     Simple container to keep together layer specific information.
00029 
00030 SourceFiles
00031     layerParameters.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef layerParameters_H
00036 #define layerParameters_H
00037 
00038 #include <OpenFOAM/dictionary.H>
00039 #include <OpenFOAM/scalarField.H>
00040 #include <OpenFOAM/labelList.H>
00041 #include <OpenFOAM/Switch.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 // Class forward declarations
00049 class polyBoundaryMesh;
00050 class refinementSurfaces;
00051 
00052 /*---------------------------------------------------------------------------*\
00053                            Class layerParameters Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class layerParameters
00057 {
00058     // Static data members
00059 
00060         //- Default angle for faces to be convcave
00061         static const scalar defaultConcaveAngle;
00062 
00063 
00064     // Private data
00065 
00066         // Per patch (not region!) information
00067 
00068             //- How many layers to add.
00069             labelList numLayers_;
00070 
00071             scalarField expansionRatio_;
00072 
00073             Switch relativeSizes_;
00074 
00075             scalarField finalLayerThickness_;
00076 
00077             scalarField minThickness_;
00078 
00079 
00080         scalar featureAngle_;
00081 
00082         scalar concaveAngle_;
00083 
00084         label nGrow_;
00085 
00086         label nSmoothSurfaceNormals_;
00087 
00088         label nSmoothNormals_;
00089 
00090         label nSmoothThickness_;
00091 
00092         scalar maxFaceThicknessRatio_;
00093 
00094         scalar layerTerminationCos_;
00095 
00096         scalar maxThicknessToMedialRatio_;
00097 
00098         scalar minMedianAxisAngleCos_;
00099 
00100         label nBufferCellsNoExtrude_;
00101 
00102         label nSnap_;
00103 
00104         label nLayerIter_;
00105 
00106         label nRelaxedIter_;
00107 
00108 
00109     // Private Member Functions
00110 
00111         //- Extract patch-wise number of layers
00112         static labelList readNumLayers
00113         (
00114             const PtrList<dictionary>& surfaceDicts,
00115             const refinementSurfaces& refineSurfaces,
00116             const labelList& globalToPatch,
00117             const polyBoundaryMesh& boundaryMesh
00118         );
00119 
00120         //- Disallow default bitwise copy construct
00121         layerParameters(const layerParameters&);
00122 
00123         //- Disallow default bitwise assignment
00124         void operator=(const layerParameters&);
00125 
00126 
00127 public:
00128 
00129     // Constructors
00130 
00131         //- Construct from dictionary - old syntax
00132         layerParameters
00133         (
00134             const PtrList<dictionary>& surfaceDicts,
00135             const refinementSurfaces& refineSurfaces,
00136             const labelList& globalToPatch,
00137             const dictionary& dict,
00138             const polyBoundaryMesh& boundaryMesh
00139         );
00140 
00141         //- Construct from dictionary - new syntax
00142         layerParameters(const dictionary& dict, const polyBoundaryMesh&);
00143 
00144 
00145     // Member Functions
00146 
00147         // Access
00148 
00149             // Per patch information
00150 
00151                 //- How many layers to add.
00152                 const labelList& numLayers() const
00153                 {
00154                     return numLayers_;
00155                 }
00156 
00157                 // Expansion factor for layer mesh
00158                 const scalarField& expansionRatio() const
00159                 {
00160                     return expansionRatio_;
00161                 }
00162 
00163                 //- Are size parameters relative to inner cell size or
00164                 //  absolute distances.
00165                 bool relativeSizes() const
00166                 {
00167                     return relativeSizes_;
00168                 }
00169 
00170                 //- Wanted thickness of final added cell layer. If multiple
00171                 //  layers is the thickness of the layer furthest away
00172                 //  from the wall (i.e. nearest the original mesh)
00173                 //  If relativeSize() this number is relative to undistorted
00174                 //  size of the cell outside layer.
00175                 const scalarField& finalLayerThickness() const
00176                 {
00177                     return finalLayerThickness_;
00178                 }
00179 
00180                 //- Minimum thickness of cell layer. If for any reason layer
00181                 //  cannot be above minThickness do not add layer.
00182                 //  If relativeSize() this number is relative to undistorted
00183                 //  size of the cell outside layer.
00184                 const scalarField& minThickness() const
00185                 {
00186                     return minThickness_;
00187                 }
00188 
00189 
00190             scalar featureAngle() const
00191             {
00192                 return featureAngle_;
00193             }
00194 
00195             scalar concaveAngle() const
00196             {
00197                 return concaveAngle_;
00198             }
00199 
00200             //- If points get not extruded do nGrow layers of connected faces
00201             //  that are not grown. Is used to not do layers at all close to
00202             //  features.
00203             label nGrow() const
00204             {
00205                 return nGrow_;
00206             }
00207 
00208             //- Number of smoothing iterations of surface normals
00209             label nSmoothSurfaceNormals() const
00210             {
00211                 return nSmoothSurfaceNormals_;
00212             }
00213 
00214             //- Number of smoothing iterations of interior mesh movement
00215             //  direction
00216             label nSmoothNormals() const
00217             {
00218                 return nSmoothNormals_;
00219             }
00220 
00221             //- Stop layer growth on highly warped cells
00222             scalar maxFaceThicknessRatio() const
00223             {
00224                 return maxFaceThicknessRatio_;
00225             }
00226 
00227             scalar layerTerminationCos() const
00228             {
00229                 return layerTerminationCos_;
00230             }
00231 
00232             //- Smooth layer thickness over surface patches
00233             label nSmoothThickness() const
00234             {
00235                 return nSmoothThickness_;
00236             }
00237 
00238             //- Reduce layer growth where ratio thickness to medial
00239             //  distance is large
00240             scalar maxThicknessToMedialRatio() const
00241             {
00242                 return maxThicknessToMedialRatio_;
00243             }
00244 
00245             //- Angle used to pick up medial axis points
00246             scalar minMedianAxisAngleCos() const
00247             {
00248                 return minMedianAxisAngleCos_;
00249             }
00250 
00251             //- Create buffer region for new layer terminations
00252             label nBufferCellsNoExtrude() const
00253             {
00254                 return nBufferCellsNoExtrude_;
00255             }
00256 
00257             label nSnap() const
00258             {
00259                 return nSnap_;
00260             }
00261 
00262             // Overall
00263 
00264                 //- Number of overall layer addition iterations
00265                 label nLayerIter() const
00266                 {
00267                     return nLayerIter_;
00268                 }
00269 
00270                 //- Number of iterations after which relaxed motion rules
00271                 //  are to be used.
00272                 label nRelaxedIter() const
00273                 {
00274                     return nRelaxedIter_;
00275                 }
00276 
00277 
00278 
00279 };
00280 
00281 
00282 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00283 
00284 } // End namespace Foam
00285 
00286 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00287 
00288 #endif
00289 
00290 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines