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

WallInteractionModel.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) 2009-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::WallInteractionModel
00026 
00027 Description
00028     Templated wall interaction model class
00029 
00030 SourceFiles
00031     WallInteractionModel.C
00032     NewWallInteractionModel.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef WallInteractionModel_H
00037 #define WallInteractionModel_H
00038 
00039 #include <OpenFOAM/IOdictionary.H>
00040 #include <OpenFOAM/autoPtr.H>
00041 #include <OpenFOAM/runTimeSelectionTables.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                      Class WallInteractionModel Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 template<class CloudType>
00053 class WallInteractionModel
00054 {
00055     // Private data
00056 
00057         //- The cloud dictionary
00058         const dictionary& dict_;
00059 
00060         // reference to the owner cloud class
00061         CloudType& owner_;
00062 
00063         //- The coefficients dictionary
00064         const dictionary coeffDict_;
00065 
00066 
00067 public:
00068 
00069     //- Runtime type information
00070     TypeName("WallInteractionModel");
00071 
00072     //- Declare runtime constructor selection table
00073     declareRunTimeSelectionTable
00074     (
00075         autoPtr,
00076         WallInteractionModel,
00077         dictionary,
00078         (
00079             const dictionary& dict,
00080             CloudType& owner
00081         ),
00082         (dict, owner)
00083     );
00084 
00085 
00086     // Constructors
00087 
00088         //- Construct from components
00089         WallInteractionModel
00090         (
00091             const dictionary& dict,
00092             CloudType& owner,
00093             const word& type
00094         );
00095 
00096 
00097     // Destructor
00098     virtual ~WallInteractionModel();
00099 
00100 
00101     //- Selector
00102     static autoPtr<WallInteractionModel<CloudType> > New
00103     (
00104         const dictionary& dict,
00105         CloudType& owner
00106     );
00107 
00108 
00109     // Access
00110 
00111         //- Return the owner cloud object
00112         const CloudType& owner() const;
00113 
00114         //- Return non-const access to the owner cloud object
00115         CloudType& owner();
00116 
00117         //- Return the dictionary
00118         const dictionary& dict() const;
00119 
00120         //- Return the coefficients dictionary
00121         const dictionary& coeffDict() const;
00122 
00123 
00124     // Member Functions
00125 
00126         //- Apply wall correction
00127         virtual void correct
00128         (
00129             const wallPolyPatch& wpp,
00130             const label faceId,
00131             vector& U,
00132             scalar& Ei,
00133             label typeId
00134         ) = 0;
00135 };
00136 
00137 
00138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00139 
00140 } // End namespace Foam
00141 
00142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00143 
00144 #define makeWallInteractionModel(CloudType)                                   \
00145                                                                               \
00146     defineNamedTemplateTypeNameAndDebug(WallInteractionModel<CloudType>, 0);  \
00147                                                                               \
00148     defineTemplateRunTimeSelectionTable                                       \
00149     (                                                                         \
00150         WallInteractionModel<CloudType>,                                      \
00151         dictionary                                                            \
00152     );
00153 
00154 
00155 #define makeWallInteractionModelType(SS, CloudType, ParcelType)               \
00156                                                                               \
00157     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
00158                                                                               \
00159     WallInteractionModel<CloudType<ParcelType> >::                            \
00160         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
00161             add##SS##CloudType##ParcelType##ConstructorToTable_;
00162 
00163 
00164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00165 
00166 #ifdef NoRepository
00167 #   include "WallInteractionModel.C"
00168 #endif
00169 
00170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00171 
00172 #endif
00173 
00174 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines